!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

723 Members
For discussions and questions about Haskell with Nix, cabal2nix and haskellPackages in nixpkgs | Current Docs: https://haskell4nix.readthedocs.io/ | More Nix: #community:nixos.org | More Haskell: #haskell-space:matrix.org144 Servers

Load older messages


SenderMessageTime
3 Feb 2025
@alexfmpe:matrix.orgalexfmpethis gives an attrset that will attempt to build with tests all packages for which we don't build the tests12:00:33
@alexfmpe:matrix.orgalexfmpe the output of nix-build --keep-going will spit out all the ones who need the tests to stay disabled 12:01:05
@alexfmpe:matrix.orgalexfmpea bit of sed and grep gives us the complement of that with respect to the original attrset: the ones whose tests can now be enabled12:01:57
@alexfmpe:matrix.orgalexfmpe removal itself is still O ( n ), but n here is the number of cleanups, not total packages 12:02:37
@alexfmpe:matrix.orgalexfmpe the same mechanism can be used for jailbreak = false, doHaddock = false 12:03:19
@alexfmpe:matrix.orgalexfmpe and, what I realized today, is that we can also use as predicate the comparison with super.${pkg.pname}.version 12:04:19
@alexfmpe:matrix.orgalexfmpeso we should soon (TM) have a mechanism to sweep over and detect obsolete trivial overrides12:05:18
@alexfmpe:matrix.orgalexfmpeTL;DR: intentional version warnings are nice to have, but if we can't always guarantee them, then we want the full sweep safety net anyway, in which case no need to clutter hydra logs?12:07:38
@alexfmpe:matrix.orgalexfmpe * taking dontCheck as an example:
I have a .nix file that filters haskellPackages and filters for all derivations with doCheck = false, then does doCheck = true for all of them
12:08:00
@alexfmpe:matrix.orgalexfmpe * nix-build --keep-going will spit out all the ones that failed - i.e. the ones who need the tests to stay disabled 12:08:35
@alexfmpe:matrix.orgalexfmpe* taking dontCheck as an example: I have a .nix file that filters haskellPackages and filters for all derivations with doCheck == false, then does doCheck = true for all of them13:51:44
@alexfmpe:matrix.orgalexfmpe* taking `dontCheck` as an example: I have a .nix file that filters haskellPackages and filters for all derivations with `doCheck == false`, then does `doCheck = true` for all of them13:52:03
@alexfmpe:matrix.orgalexfmpe * taking
dontCheck as an example:
I have a .nix file that filters haskellPackages for all derivations with doCheck == false, then does doCheck = true for all of them
13:52:40
@alexfmpe:matrix.orgalexfmpe * taking
dontCheck as an example:
I have a .nix file that filters haskellPackages for derivations with doCheck == false, then does doCheck = true for all of them
13:52:53
@alexfmpe:matrix.orgalexfmpe

if that step turns out to be wonky, can always inject an easily grepable "I built" on the checked packages

  overrideCabal (old: {
    postFixup = ''
      ${old.postFixup or ""}
      echo "Override no longer needed for ${old.pname}"
    '';
  })
14:08:36
@alexfmpe:matrix.orgalexfmpe
$ nix-build -A haskell.packages.ghc98.hello --check 2>&1 | tail -n 3
patching script interpreter paths in /nix/store/6da7xi7dd6wjpgl3bn09xp4p4qjw1ckf-hello-1.0.0.2-doc
Override no longer needed for hello
/nix/store/ais54949224v9ndhgqgj5fz47ah95pij-hello-1.0.0.2
14:10:54
@alexfmpe:matrix.orgalexfmpe at the cost of extra builds due to --check 14:11:25
@alexfmpe:matrix.orgalexfmpe ah huh actually that won't work because --check errors if the input hasn't been built, would need some force rebuild option 14:13:03
@alexfmpe:matrix.orgalexfmpeannoying that nix doesn't output the built store paths when there were also failures 14:13:31
@alex:tunstall.xyzAlex
In reply to @alexfmpe:matrix.org
annoying that nix doesn't output the built store paths when there were also failures
You could achieve this by splitting your nix-build command into a nix-instantiate (gives drv), a nix-build (realises drv into outputs), and a nix-store --query (can list outputs for drv).
21:49:16
4 Feb 2025
@alexfmpe:matrix.orgalexfmpeThanks, I'll try that07:19:39
@axman6:matrix.orgAxman6 joined the room.07:56:52
@unebnf:matrix.orgunebnf joined the room.07:58:14
@magic_rb:matrix.redalder.orgmagic_rb @axman6:matrix.org youll have to go through pkgsCross.something-something.hostPackages.ghc 08:06:36
@magic_rb:matrix.redalder.orgmagic_rbThats the general way to get a cross compiler with nixpkgs. The javascript one works, havent tested the wasm one08:07:06
@axman6:matrix.orgAxman6 so pkgsCross.wasi32.hostPackages.ghc121 or something? 08:07:59
@magic_rb:matrix.redalder.orgmagic_rb Something along those lines, open up a nix repl and see whats available 08:08:20
@axman6:matrix.orgAxman6s/Packages/Platform08:08:57
@axman6:matrix.orgAxman6yeah doing that now08:09:02
@magic_rb:matrix.redalder.orgmagic_rb
In reply to @axman6:matrix.org
s/Packages/Platform
Good catch
08:09:12

Show newer messages


Back to Room ListRoom Version: 6