hackage2nix: do not recurse into haskellPackages#674
hackage2nix: do not recurse into haskellPackages#674sternenseemann wants to merge 2 commits intomasterfrom
Conversation
recurseIntoAttrs was added recently in NixOS/nixpkgs@99c0500 For hackage2nix, this is pointless. Dependencies between haskell packages are resolved directly. System dependencies should not resolve to haskellPackages under normal (any?) circumstances.
6b69c66 to
ecc801a
Compare
hackage2nix can't run if there are unrecoverable errors while generating the nixpkgs package Nix. To create this change, I temporarily added webkitgtk_4_0 = null to all-packages.nix to solve those errors. Then running ./maintainers/scripts/haskell/regenerate-hackage-packages.sh --fast effects the desired change. See also NixOS/cabal2nix#674.
hackage2nix can't run if there are unrecoverable errors while generating the nixpkgs package Nix. To create this change, I temporarily added webkitgtk_4_0 = null to all-packages.nix to solve those errors. Then running ./maintainers/scripts/haskell/regenerate-hackage-packages.sh --fast effects the desired change. See also NixOS/cabal2nix#674.
hackage2nix can't run if there are unrecoverable errors while generating the nixpkgs package Nix. To create this change, I temporarily added webkitgtk_4_0 = null to all-packages.nix to solve those errors. Then running ./maintainers/scripts/haskell/regenerate-hackage-packages.sh --fast effects the desired change. See also NixOS/cabal2nix#674.
wolfgangwalther
left a comment
There was a problem hiding this comment.
However, it's still not possible if the rest of pkgs doesn't eval which is the case in e.g. NixOS/nixpkgs#450065. Missing attributes/arguments are an unrecoverable error in Nix. We can't allow aliases (which would turn the error into a recoverable via throwing aliases) since we may generate dependencies on aliases.
I think this could be solved by "structured aliases" introduced in NixOS/nixpkgs#442066. The aliases would also be exposed without aliases and they could be filtered out.
| let nixpkgsArgs = mconcat [ "{" | ||
| , "overlays = [ (self: super: { haskellPackages = self.lib.dontRecurseIntoAttrs super.haskellPackages; }) ];" | ||
| , "config.allowAliases = false;" | ||
| , "}" | ||
| ] |
There was a problem hiding this comment.
Why don't we put this overlay's code in https://github.com/NixOS/cabal2nix/blob/master/distribution-nixpkgs/derivation-attr-paths.nix?
I think that fits better.
There was a problem hiding this comment.
We could do that, but we can't really add this feature without changing the API for distribution-nixpkgs which I didn't want to commit to yet…
There was a problem hiding this comment.
I have no idea what you mean. Why would that change the API? And if so, why would that be bad?
There was a problem hiding this comment.
Right, this would not change the API, but the behavior, so it's a breaking change, too. The problem I have with that particular change is that it would no longer allow distribution-nixpkgs to be used for searching for any nixpkgs package, but would arbitrarily exclude haskell packages which makes sense for cabal2nix, but not in general.
There was a problem hiding this comment.
it would no longer allow
distribution-nixpkgsto be used for searching for any nixpkgs package, but would arbitrarily exclude haskell packages
I'm confused a bit. Wasn't this just introduced recently via Nixpkgs in the first place? Aka all other users of distribution-nixpkgs would never rely on that, because it was never a thing.
It seems like the change in Nixpkgs effectively was the breaking change and the overlay here reverts that?
There was a problem hiding this comment.
This is true, but arguably distribution-nixpkgs did respect recurseForDerivations, so given changes in Nixpkgs, users would expect it to respect those.
hackage2nix can't run if there are unrecoverable errors while generating the nixpkgs package Nix. To create this change, I temporarily added webkitgtk_4_0 = null to all-packages.nix to solve those errors. Then running ./maintainers/scripts/haskell/regenerate-hackage-packages.sh --fast effects the desired change. See also NixOS/cabal2nix#674.
hackage2nix can't run if there are unrecoverable errors while generating the nixpkgs package Nix. To create this change, I temporarily added webkitgtk_4_0 = null to all-packages.nix to solve those errors. Then running ./maintainers/scripts/haskell/regenerate-hackage-packages.sh --fast effects the desired change. See also NixOS/cabal2nix#674.
recurseIntoAttrs was added recently in
NixOS/nixpkgs@99c0500
For hackage2nix, this is pointless. Dependencies between haskell packages are resolved directly. System dependencies should not resolve to haskellPackages under normal (any?) circumstances.
This is especially useful if a removal of a package causes evaluation failures in
haskellPackages, as it allows running hackage2nix in order to eliminate references to the removed package.However, it's still not possible if the rest of
pkgsdoesn't eval which is the case in e.g. NixOS/nixpkgs#450065. Missing attributes/arguments are an unrecoverable error in Nix. We can't allow aliases (which would turn the error into a recoverable via throwing aliases) since we may generate dependencies on aliases.