From 383fbfadccaa12f908f79ab83f21fa5dbe10c6be Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Thu, 31 Mar 2022 12:37:00 +0200 Subject: [PATCH] ghcWithPackages: use packageCfgDir over ghc.name where appropriate This is an incorrectness pointed out in #153319 which we already have a proper solution for. --- pkgs/development/haskell-modules/with-packages-wrapper.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/haskell-modules/with-packages-wrapper.nix b/pkgs/development/haskell-modules/with-packages-wrapper.nix index 7c7add61679d..65a575e08e8a 100644 --- a/pkgs/development/haskell-modules/with-packages-wrapper.nix +++ b/pkgs/development/haskell-modules/with-packages-wrapper.nix @@ -121,7 +121,7 @@ symlinkJoin { '' + (lib.optionalString (stdenv.targetPlatform.isDarwin && !isGhcjs && !stdenv.targetPlatform.isiOS) '' # Work around a linker limit in macOS Sierra (see generic-builder.nix): - local packageConfDir="$out/lib/${ghc.name}/package.conf.d"; + local packageConfDir="${packageCfgDir}"; local dynamicLinksDir="$out/lib/links" mkdir -p $dynamicLinksDir # Clean up the old links that may have been (transitively) included by @@ -148,8 +148,8 @@ symlinkJoin { # 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 + rm ${packageCfgDir}/package.cache.lock + rm ${packageCfgDir}/package.cache $out/bin/${ghcCommand}-pkg recache ''}