-
-
Notifications
You must be signed in to change notification settings - Fork 158
hackage2nix: do not recurse into haskellPackages #674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea what you mean. Why would that change the API? And if so, why would that be bad?
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
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.