-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
ghcWithPackages environment doesn't build with integer-simple #153319
Comments
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/overriding-ghc-only-for-final-package/16953/2 |
I had the same issue, but with musl and integer-gmp instead. So it's similar to what is described above except |
I'll look into fixing this finally, sorry this fell through the cracks. Since the workaround is so simple it should be quite easy to track down all uses of |
This is an incorrectness pointed out in NixOS#153319 which we already have a proper solution for.
In addition to the testing in the linked PR, I tested both examples from the issue again, which now work correctly in |
Great, thanks for looking into this! |
This will be closed automatically when the fix is in |
I'm getting this error again using ghcHEAD.withPackages.
|
What is the precise expression you are using? |
https://gitlab.homotopic.tech/horizon/horizon-core
I also tried it with your 9.6.1 branch and I get the same. There's a withPackages expression in shell/ |
@locallycompact It'd be nice if you could try narrowing down the issue further in the future! In this case it's a piece of cake, as it affects all |
Thanks for finding it. I don't really get it but I'll take a look. |
No worries, I'll take care of it. |
FYI I think this may have changed once more. Using latest commit of
|
Describe the bug
ghcWithPackages
doesn't appear to work withinteger-simple
.On 4acff2b, I get an error with the following command:
This command works correctly with non-integer-simple:
My guess is that this is caused by the code block in
pkgs/development/haskell-modules/with-packages-wrapper.nix
right here:nixpkgs/pkgs/development/haskell-modules/with-packages-wrapper.nix
Lines 132 to 140 in 18c84ea
The
rm
command fails with the error:rm: cannot remove '/nix/store/48xd2pxvbi00ph96qr5ba6mwn1ypx9iy-ghc-integer-simple-8.10.7-with-packages/lib/ghc-integer-simple-8.10.7/package.conf.d/package.cache.lock': No such file or directory
This error can be worked around with a change like the following:
If you look at the definition of
packageCfgDir
, it appears thatghc.name
is being used where${ghcCommand}-${ghc.version}
should be used.However, even with this change, the resulting environment is not correct. The environment does not correctly contain the
random
package:My guess is that this is because the
ghcWithPackages
environment is created withsymlinkJoin
, but the path to the package config directory is different for integer-simple packages and the integer-simple GHC.Here's what the paths look like for normal GHC:
You can see that
random
's package.conf file ends up inlib/ghc-8.10.7/package.conf.d/
.Here's what the paths look like for the integer-simple GHC:
You can see here that
haskell.compiler.integer-simple.ghc8107
has it'spackage.conf.d
inlib/ghc-8.10.7/package.conf.d/
, butrandom
has it's.conf
file inlib/ghc-integer-simple-8.10.7/package.conf.d/
. So this.conf
file doesn't end up in the right place in thesymlinkJoin
inwith-packages-wrapper.nix
.Possible Solution
I'm not sure what would be the best solution for this, but I imagine we have to be very careful to make sure GHC and our Nix scripts are looking at the right place for the package conf dir in the following files:
pkgs/development/haskell-modules/generic-builder.nix
pkgs/development/haskell-modules/with-packages-wrapper.nix
pkgs/development/compilers/ghc/*.nix
The
packageCfgDir
variable that is currently defined inwith-packages-wrapper.nix
should likely be an attribute exported by the GHC derivations, and reused in the other files.Notify maintainers
@NixOS/haskell
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.The text was updated successfully, but these errors were encountered: