nixpkgs-suyu/pkgs/development/haskell-modules
Guillaume Bouchard abc4f961b4 haskellPackages.ghcWithPackages: fix for GHC 8.10
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.
2020-04-17 20:50:48 +02:00
..
patches haskell-tensorflow: unbreak 2020-04-17 20:50:48 +02:00
configuration-common.nix cabal-install-parsers: update Cabal dependency 2020-04-17 20:50:48 +02:00
configuration-ghc-8.2.x.nix treewide: Per RFC45, remove all unquoted URLs 2020-04-10 17:54:53 +01:00
configuration-ghc-8.4.x.nix treewide: Per RFC45, remove all unquoted URLs 2020-04-10 17:54:53 +01:00
configuration-ghc-8.6.x.nix haskell-Cabal: update overrides for the new 3.2.x release 2020-04-03 22:00:29 +02:00
configuration-ghc-8.8.x.nix darcs: don't try to build the package with ghc-8.8.x 2020-04-10 21:27:47 +02:00
configuration-ghc-8.10.x.nix haskell-ChasingBottoms: jailbreak to fix build with ghc-8.10.x 2020-02-28 20:42:27 +01:00
configuration-ghc-head.nix
configuration-ghcjs.nix configuration-ghcjs.nix: fix evaluation 2019-09-30 12:52:43 +02:00
configuration-hackage2nix.yaml haskell simple-affine-space: Disable test suite 2020-04-17 20:50:48 +02:00
configuration-nix.nix cut-the-crap: init at 1.0.0 2020-04-17 20:50:48 +02:00
configuration-tensorflow.nix haskell-tensorflow: unbreak 2020-04-17 20:50:48 +02:00
default.nix
generic-builder.nix haskell generic-builder: fix Darwin regression for lmdb 2020-02-17 09:41:31 +01:00
generic-stack-builder.nix buildStackProject: Set __noChroot to make it fail without sandbox 2019-11-14 01:32:04 +01:00
hackage-packages.nix hackage-packages.nix: automatic Haskell package set update 2020-04-17 20:50:40 +02:00
hoogle-local-wrapper.sh
hoogle.nix ghcWithHoogle: Fix for cross 2019-12-24 18:17:41 -05:00
initial-packages.nix
lib.nix
make-package-set.nix cabal2nix: split into a lightweight version and a wrapper 2020-03-13 20:18:14 +01:00
non-hackage-packages.nix haskellPackages.multi-ghc-travis: add missing space (PR #76648) 2019-12-29 19:27:25 +01:00
stack-hook.sh
with-packages-wrapper.nix haskellPackages.ghcWithPackages: fix for GHC 8.10 2020-04-17 20:50:48 +02:00