about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/haskell-modules/with-packages-wrapper.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/haskell-modules/with-packages-wrapper.nix')
-rw-r--r--nixpkgs/pkgs/development/haskell-modules/with-packages-wrapper.nix13
1 files changed, 12 insertions, 1 deletions
diff --git a/nixpkgs/pkgs/development/haskell-modules/with-packages-wrapper.nix b/nixpkgs/pkgs/development/haskell-modules/with-packages-wrapper.nix
index 49beed8549db..081190188742 100644
--- a/nixpkgs/pkgs/development/haskell-modules/with-packages-wrapper.nix
+++ b/nixpkgs/pkgs/development/haskell-modules/with-packages-wrapper.nix
@@ -127,7 +127,18 @@ symlinkJoin {
       rm $f-tmp
     done
   '') + ''
-    ${lib.optionalString hasLibraries "$out/bin/${ghcCommand}-pkg recache"}
+    ${lib.optionalString hasLibraries ''
+     # GHC 8.10 changes.
+     # Instead of replacing package.cache[.lock] with the new file,
+     # ghc-pkg is now trying to open the file.  These file are symlink
+     # to another nix derivation, so they are not writable.  Removing
+     # them allow the correct behavior of ghc-pkg recache
+     # See: https://github.com/NixOS/nixpkgs/issues/79441
+     rm $out/lib/${ghc.name}/package.conf.d/package.cache.lock
+     rm $out/lib/${ghc.name}/package.conf.d/package.cache
+
+     $out/bin/${ghcCommand}-pkg recache
+     ''}
     ${# ghcjs will read the ghc_libdir file when resolving plugins.
       lib.optionalString (isGhcjs && ghcLibdir != null) ''
       mkdir -p "${libDir}"