haskellPackages.ghcWithPackages: fix for GHC 8.10 #85446
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This closes #79441.
ghcWithPackages is using
ghc-pkg recache
to build its packagedatabase. 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 itwill just write the new files.
Tested with
haskellPackages.ghcWithPackages
(i.e. GHC 8.8) andhaskell.packages.ghc8101.ghcWithPackages
(i.e GHC 8.10) with thefollowing nix file, at the root of the nixpkgs repository:
Then run
/bin/ghci
in the derivation andimport PyF
, it should import the module fine. I think I usedPyF
without any lose of generality.This will test with GHC 8.10. Comment out the
overlays
to test withGHC 8.8.
Motivation for this change
Fixing GHC 8.10
ghcWithPackages
which is currently not usable.Things done
See above comments (Sorry, I did not realize that the template was after my commit message, so I submitted blindly)
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after) (0 changes)