Skip to content

haskell: fix with-packages-wrapper in ghcjs#42191

Merged
matthewbauer merged 1 commit intoNixOS:masterfrom
obsidiansystems:fix-ghcjs-with-packages
Jun 19, 2018
Merged

haskell: fix with-packages-wrapper in ghcjs#42191
matthewbauer merged 1 commit intoNixOS:masterfrom
obsidiansystems:fix-ghcjs-with-packages

Conversation

@matthewbauer
Copy link
Member

Fixes #42032
Fixes #42070

@matthewbauer matthewbauer requested a review from peti as a code owner June 19, 2018 00:18
@GrahamcOfBorg GrahamcOfBorg added 6.topic: haskell General-purpose, statically typed, purely functional programming language 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Jun 19, 2018
@matthewbauer matthewbauer merged commit 5b09fe1 into NixOS:master Jun 19, 2018
@stepcut
Copy link
Contributor

stepcut commented Jun 19, 2018

I will check when I get a chance, but I suspect this does not fix the problem. Here is the diff of my hack that seemed to work:

diff --git a/pkgs/development/haskell-modules/with-packages-wrapper.nix b/pkgs/development/haskell-modules/with-packages-wrapper.nix
index 03f0a1d..4985c33 100644
--- a/pkgs/development/haskell-modules/with-packages-wrapper.nix
+++ b/pkgs/development/haskell-modules/with-packages-wrapper.nix
@@ -38,9 +38,9 @@ let
   ghcCommand'    = if isGhcjs then "ghcjs" else "ghc";
   ghcCommand = "${ghc.targetPrefix}${ghcCommand'}";
   ghcCommandCaps= lib.toUpper ghcCommand';
-  libDir        = if isHaLVM then "$out/lib/HaLVM-${ghc.version}" else "$out/lib/${ghcCommand}-${ghc.version}";
+  libDir         = "$out/libexec";
   docDir        = "$out/share/doc/ghc/html";
-  packageCfgDir = "${libDir}/package.conf.d";
+  packageCfgDir = "$out/libexec/package.conf.d";
   paths         = lib.filter (x: x ? isHaskellLibrary) (lib.closePropagation packages);
   hasLibraries  = lib.any (x: x.isHaskellLibrary) paths;
   # CLang is needed on Darwin for -fllvm to work:
@@ -92,7 +92,7 @@ symlinkJoin {
     for prg in ${ghcCommand}-pkg ${ghcCommand}-pkg-${ghc.version}; do
       if [[ -x "${ghc}/bin/$prg" ]]; then
         rm -f $out/bin/$prg
-        makeWrapper ${ghc}/bin/$prg $out/bin/$prg --add-flags "${packageDBFlag}=${packageCfgDir}"
+        makeWrapper ${ghc}/bin/$prg $out/bin/$prg --add-flags "${packageDBFlag}=${packageCfgDir}" --add-flags "--user-package-db=$out/lib/${ghcCommand}/package.conf.d"
       fi
     done

Note that I had to modify the call to makeWrapper so that it looks in both lib and libexec. While that works, it seems to be a hack for the underlying problem that the libraries are all supposed to be in libexec or lib but are instead split between the two.

I can provide more details in a few days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: haskell General-purpose, statically typed, purely functional programming language 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants