on iko/ghcjs-patch-master help sign in
Avoid filtering nix-tools source for better nix <2.4 support (#1468)

* Avoid filtering nix-tools source for better nix <2.4 support * Add work around for fork() handlers error

commitaa6d7a8e4b2a09c484c1c9b53661628f403b7067 authorHamish Mackenzie <Hamish.K.Mackenzie@gmail.com> dateFri 13 May 2022, 19:21 (4 years ago) parentdbec484
1 file changed+31−16
overlays/bootstrap.nix+31−16
overlays/bootstrap.nix+31−16
@@ -872,28 +872,43 @@ in {
872872 final.haskell-nix.cabalProject ({
873873 caller = "nix-tools-set";
874874 name = "nix-tools";
875− src = final.haskell-nix.sources.nix-tools;
875+ src = {
876+ outPath = final.haskell-nix.sources.nix-tools;
877+ # TODO remove once nix >=2.4 is widely adopted (will trigger rebuilds of everything).
878+ # Disable filtering keeps pre ond post nix 2.4 behaviour the same. This means that
879+ # the same `alex`, `happy` and `hscolour` are used to build GHC. It also means that
880+ # that `tools` in the shell will be built the same.
881+ filterPath = { path, ... }: path;
882+ };
876883 # This is a handy way to use a local git clone of nix-tools when developing
877884 # src = final.haskell-nix.haskellLib.cleanGit { name = "nix-tools"; src = ../../nix-tools; };
878885 cabalProjectLocal = ''
879886 allow-newer: Cabal:base, cryptohash-sha512:base, haskeline:base
880887 '';
881888 materialized = ../materialized + "/${compiler-nix-name}/nix-tools";
882− modules = [{
883− packages.transformers-compat.components.library.doExactConfig = true;
884− packages.time-compat.components.library.doExactConfig = true;
885− packages.time-locale-compat.components.library.doExactConfig = true;
886− # Make Cabal reinstallable
887− nonReinstallablePkgs =
888− [ "rts" "ghc-heap" "ghc-prim" "integer-gmp" "integer-simple" "base"
889− "deepseq" "array" "ghc-boot-th" "pretty" "template-haskell"
890− "ghc-boot"
891− "ghc" "Win32" "array" "binary" "bytestring" "containers"
892− "directory" "filepath" "ghc-boot" "ghc-compact" "ghc-prim"
893− "hpc"
894− "mtl" "parsec" "process" "text" "time" "transformers"
895− "unix" "xhtml"
896− ];
889+ modules = [
890+ # Work around issue when using older ghc on new MacOS versions. The
891+ # old process library used by these versions of ghc uses `fork` in a
892+ # way that can sometimes while evaluating template haskell.
893+ ({pkgs, ...}: final.lib.mkIf (pkgs.stdenv.hostPlatform.isDarwin
894+ && __elem args.compiler-nix-name [ "ghc865" "ghc881" "ghc881" "ghc882" "ghc883" "ghc884" "ghc8101" "ghc8102" "ghc8103" "ghc8104" "ghc810420210212" "ghc8105" "ghc8106" ]
895+ ) { packages.hnix.components.library.ghcOptions = [ "-j1" ]; }
896+ )
897+ {
898+ packages.transformers-compat.components.library.doExactConfig = true;
899+ packages.time-compat.components.library.doExactConfig = true;
900+ packages.time-locale-compat.components.library.doExactConfig = true;
901+ # Make Cabal reinstallable
902+ nonReinstallablePkgs =
903+ [ "rts" "ghc-heap" "ghc-prim" "integer-gmp" "integer-simple" "base"
904+ "deepseq" "array" "ghc-boot-th" "pretty" "template-haskell"
905+ "ghc-boot"
906+ "ghc" "Win32" "array" "binary" "bytestring" "containers"
907+ "directory" "filepath" "ghc-boot" "ghc-compact" "ghc-prim"
908+ "hpc"
909+ "mtl" "parsec" "process" "text" "time" "transformers"
910+ "unix" "xhtml"
911+ ];
897912 }];
898913 } // args // { inherit compiler-nix-name; });
899914 exes =