on iko/ghcjs-patch-master help sign in
fix ghc being picked from the wrong package set (#663)
commit54f6fbf607d656c9ce87c709bddf3d0cb96db3de authorMoritz Angermann <moritz.angermann@gmail.com> dateTue 9 Jun 2020, 20:05 (6 years ago) parentedd1d21
2 files changed+13−5
lib/call-cabal-project-to-nix.nix+11−3 overlays/haskell.nix+2−2
lib/call-cabal-project-to-nix.nix+11−3
@@ -54,7 +54,15 @@ let
5454 + "For example use `compiler-nix-name = \"ghc865\";` for ghc 8.6.5") ghc
5555 else
5656 if compiler-nix-name != null
57− then pkgs.buildPackages.haskell-nix.compiler."${compiler-nix-name}"
57+ # Do note that `pkgs = final.buildPackages` in the `overlays/haskell.nix`
58+ # call to this file. And thus `pkgs` here is the proper `buildPackages`
59+ # set and we do not need, nor should pick the compiler from another level
60+ # of `buildPackages`, lest we want to get confusing errors about the Win32
61+ # package.
62+ #
63+ # > The option `packages.Win32.package.identifier.name' is used but not defined.
64+ #
65+ then pkgs.haskell-nix.compiler."${compiler-nix-name}"
5866 else defaults.ghc;
5967
6068in
@@ -278,7 +286,7 @@ let
278286 > $out/ghc-pkg/dump-global
279287 '');
280288
281− # Dummy `ghc` that uses the captured output
289+ # Dummy `ghc` that uses the captured output
282290 dummy-ghc = pkgs.evalPackages.writeTextFile {
283291 name = "dummy-" + ghc.name;
284292 executable = true;
@@ -313,7 +321,7 @@ let
313321 '';
314322 };
315323
316− # Dummy `ghc-pkg` that uses the captured output
324+ # Dummy `ghc-pkg` that uses the captured output
317325 dummy-ghc-pkg = pkgs.evalPackages.writeTextFile {
318326 name = "dummy-pkg-" + ghc.name;
319327 executable = true;
overlays/haskell.nix+2−2
@@ -451,7 +451,7 @@ final: prev: {
451451 mv "${name}-${version}" $out
452452 '';
453453 in cabalProject' (
454− (final.haskell-nix.hackageQuirks { inherit name version; }) //
454+ (final.haskell-nix.hackageQuirks { inherit name version; }) //
455455 builtins.removeAttrs args [ "version" ] // { inherit src; });
456456
457457 # This function is like `cabalProject` but it makes the plan-nix available
@@ -542,7 +542,7 @@ final: prev: {
542542 # In your tests module add something that is effectively
543543 # testProjectPlan = withInputs project.plan-nix;
544544 withInputs = final.recurseIntoAttrs;
545−
545+
546546 # Add this to your tests to make all the dependencies of haskell.nix
547547 # are tested and cached.
548548 haskellNixRoots = final.recurseIntoAttrs {