-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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 wrapper does not work with ghc-8.10.1 #79441
Comments
That looks like Is it possible the version number being 8.10.0.20200123 is causing problems? It may somehow think it is 8.10.1. |
https://gitlab.haskell.org/ghc/ghc/issues/13945 may or may not be relevant. The bug is supposed to be fixed since ghc-8.2.x, but the error messages look exactly like the one we are getting. |
Still doesn't work with the most recent $ nix-shell -I nixpkgs=. -p 'haskell.packages.ghc8101.ghcWithPackages (p: [ p.vector ])'
these derivations will be built:
/nix/store/g42dzyfixjsdic6v941pwr640my07712-ghc-8.10.1-with-packages.drv
building '/nix/store/g42dzyfixjsdic6v941pwr640my07712-ghc-8.10.1-with-packages.drv'...
/nix/store/y5mlq6k40lmglk83g2d4wwrqbnczlfcc-vector-0.12.1.2/nix-support:
propagated-build-inputs: /nix/store/mjgcc312nynrbf4157g6yyll362swykh-primitive-0.7.0.1/nix-support/propagated-build-inputs
/nix/store/si82shf1fvp87zkv0dx6bsr0hw4h0v0q-ghc-8.10.1/nix-support:
propagated-build-inputs: /nix/store/mjgcc312nynrbf4157g6yyll362swykh-primitive-0.7.0.1/nix-support/propagated-build-inputs
ghc-pkg: Couldn't open database /nix/store/8k4pha8h3ah1dar9985g9p1bs64k04a3-ghc-8.10.1-with-packages/lib/ghc-8.10.1/package.conf.d for modification: {handle: /nix/store/8k4pha8h3ah1dar9985g9p1bs64k04a3-ghc-8.10.1-with-packages/lib/ghc-8.10.1/package.conf.d/package.cache.lock}: hLock: invalid argument (Bad file descriptor)
builder for '/nix/store/g42dzyfixjsdic6v941pwr640my07712-ghc-8.10.1-with-packages.drv' failed with exit code 1
error: build of '/nix/store/g42dzyfixjsdic6v941pwr640my07712-ghc-8.10.1-with-packages.drv' failed I asked on the |
@mpickering suggests that this error is related to https://gitlab.haskell.org/ghc/ghc/-/merge_requests/1996, and reverting that patch might make this error go away. |
The
So there is some code in This makes sense to me. You shouldn't be able to I don't know what's the best way to tackle that. Maybe adding a flag to Alternatively you can hack, and make that particular lock file (which is in known place) writable. |
And quick tests suggest that whether you have OFD locking or There is a regression in GHC:
I suggest opening an issue at least for that. |
Thanks for looking into this! I tried the most obvious thing that came to mind and added |
Unfortunately I cannot afford digging further in what the derivation tries to do here, and why. I just don't think this is |
I'm a bit confused: you're saying that there is a regression in GHC, but this isn't a GHC issue? |
@vaibhavsagar the regression is that 8.8.3 says
but 8.10.1 fails with weird error
EDIT: "neither work", but 8.8.3 at least tells you why. |
Thanks for clarifying! |
Shell for 8.10 is not working due to NixOS/nixpkgs#79441
I've opened PR #85446 which does the simplest thing: |
I started from this and realized that it was not writable because it was a symlink to another derivation. However |
This closes #79441. ghcWithPackages is using `ghc-pkg recache` to build its package database. By doing so, it overrides the `package.cache[.lock]` files. Details are unclear, but GHC 8.10 changed a bit the behavior. Previously, it was unconditionally replacing the files by new ones. Now it tries to open (for modification) the files. These files are symlinks to another nix derivation, which is hence read-only. This commit removes the files before running `ghc-pkg recache`, hence it will just write the new files. Tested with `haskellPackages.ghcWithPackages` (i.e. GHC 8.8) and `haskell.packages.ghc8101.ghcWithPackages` (i.e GHC 8.10) with the following nix file, at the root of the nixpkgs repository: ``` with import ./. { overlays = [ ( self: super: { haskellPackages = super.haskell.packages.ghc8101.override { overrides = selfh: superh: { th-lift-instances = super.haskell.lib.doJailbreak superh.th-lift-instances; th-expand-syns = super.haskell.lib.doJailbreak superh.th-expand-syns; th-reify-many = super.haskell.lib.doJailbreak superh.th-reify-many; th-orphans = super.haskell.lib.doJailbreak superh.th-orphans; haskell-src-meta = super.haskell.lib.doJailbreak superh.haskell-src-meta; }; }; } ) ]; }; haskellPackages.ghcWithPackages(p:[p.PyF]) ``` This will test with GHC 8.10. Comment out the `overlays` to test with GHC 8.8.
Could the fix be added to the 20.03 release? |
Seconded, that would be great. |
I'm actively working on cherry picking this into 20.03. I'm just building everything on our work Hydra - if it fixes the build I'll open a PR. |
Thanks @ocharles! |
This closes NixOS#79441. ghcWithPackages is using `ghc-pkg recache` to build its package database. By doing so, it overrides the `package.cache[.lock]` files. Details are unclear, but GHC 8.10 changed a bit the behavior. Previously, it was unconditionally replacing the files by new ones. Now it tries to open (for modification) the files. These files are symlinks to another nix derivation, which is hence read-only. This commit removes the files before running `ghc-pkg recache`, hence it will just write the new files. Tested with `haskellPackages.ghcWithPackages` (i.e. GHC 8.8) and `haskell.packages.ghc8101.ghcWithPackages` (i.e GHC 8.10) with the following nix file, at the root of the nixpkgs repository: ``` with import ./. { overlays = [ ( self: super: { haskellPackages = super.haskell.packages.ghc8101.override { overrides = selfh: superh: { th-lift-instances = super.haskell.lib.doJailbreak superh.th-lift-instances; th-expand-syns = super.haskell.lib.doJailbreak superh.th-expand-syns; th-reify-many = super.haskell.lib.doJailbreak superh.th-reify-many; th-orphans = super.haskell.lib.doJailbreak superh.th-orphans; haskell-src-meta = super.haskell.lib.doJailbreak superh.haskell-src-meta; }; }; } ) ]; }; haskellPackages.ghcWithPackages(p:[p.PyF]) ``` This will test with GHC 8.10. Comment out the `overlays` to test with GHC 8.8. (cherry picked from commit abc4f96)
Using the current
master
branch @ 57ed5db, the following simple development environment cannot be created:The relevant bit is:
The text was updated successfully, but these errors were encountered: