on iko/ghcjs-patch-master help sign in
fix ghc being picked from the wrong package set (#663)
54f6fbfMoritz Angermann
lib/call-cabal-project-to-nix.nix+11−3
@@ -54,7 +54,15 @@ let
54 + "For example use `compiler-nix-name = \"ghc865\";` for ghc 8.6.5") ghc
54 + "For example use `compiler-nix-name = \"ghc865\";` for ghc 8.6.5") ghc
55 else
55 else
56 if compiler-nix-name != null
56 if compiler-nix-name != null
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+ #
57− then pkgs.buildPackages.haskell-nix.compiler."${compiler-nix-name}"
65+ then pkgs.haskell-nix.compiler."${compiler-nix-name}"
58 else defaults.ghc;
66 else defaults.ghc;
59
67
60in
68in
@@ -278,7 +286,7 @@ let
278 > $out/ghc-pkg/dump-global
286 > $out/ghc-pkg/dump-global
279 '');
287 '');
280
288
281− # Dummy `ghc` that uses the captured output
289+ # Dummy `ghc` that uses the captured output
282 dummy-ghc = pkgs.evalPackages.writeTextFile {
290 dummy-ghc = pkgs.evalPackages.writeTextFile {
283 name = "dummy-" + ghc.name;
291 name = "dummy-" + ghc.name;
284 executable = true;
292 executable = true;
@@ -313,7 +321,7 @@ let
313 '';
321 '';
314 };
322 };
315
323
316− # Dummy `ghc-pkg` that uses the captured output
324+ # Dummy `ghc-pkg` that uses the captured output
317 dummy-ghc-pkg = pkgs.evalPackages.writeTextFile {
325 dummy-ghc-pkg = pkgs.evalPackages.writeTextFile {
318 name = "dummy-pkg-" + ghc.name;
326 name = "dummy-pkg-" + ghc.name;
319 executable = true;
327 executable = true;
overlays/haskell.nix+2−2
@@ -451,7 +451,7 @@ final: prev: {
451 mv "${name}-${version}" $out
451 mv "${name}-${version}" $out
452 '';
452 '';
453 in cabalProject' (
453 in cabalProject' (
454− (final.haskell-nix.hackageQuirks { inherit name version; }) //
454+ (final.haskell-nix.hackageQuirks { inherit name version; }) //
455 builtins.removeAttrs args [ "version" ] // { inherit src; });
455 builtins.removeAttrs args [ "version" ] // { inherit src; });
456
456
457 # This function is like `cabalProject` but it makes the plan-nix available
457 # This function is like `cabalProject` but it makes the plan-nix available
@@ -542,7 +542,7 @@ final: prev: {
542 # In your tests module add something that is effectively
542 # In your tests module add something that is effectively
543 # testProjectPlan = withInputs project.plan-nix;
543 # testProjectPlan = withInputs project.plan-nix;
544 withInputs = final.recurseIntoAttrs;
544 withInputs = final.recurseIntoAttrs;
545−
545+
546 # Add this to your tests to make all the dependencies of haskell.nix
546 # Add this to your tests to make all the dependencies of haskell.nix
547 # are tested and cached.
547 # are tested and cached.
548 haskellNixRoots = final.recurseIntoAttrs {
548 haskellNixRoots = final.recurseIntoAttrs {