on iko/ghcjs-patch-master help sign in
Allow older `ghc` versions in `cabalProject` (#817)
fa25a67Hamish Mackenzie
lib/call-cabal-project-to-nix.nix+17−10
@@ -21,8 +21,8 @@ in
21, caller ? "callCabalProjectToNix" # Name of the calling funcion for better warning messages
21, caller ? "callCabalProjectToNix" # Name of the calling funcion for better warning messages
22, ghc ? null # Deprecated in favour of `compiler-nix-name`
22, ghc ? null # Deprecated in favour of `compiler-nix-name`
23, ghcOverride ? null # Used when we need to set ghc explicitly during bootstrapping
23, ghcOverride ? null # Used when we need to set ghc explicitly during bootstrapping
24−, nix-tools ? evalPackages.haskell-nix.nix-tools.${compiler-nix-name} # When building cabal projects we use the nix-tools
24+, nix-tools ? evalPackages.haskell-nix.nix-tools-unchecked.${compiler-nix-name} # When building cabal projects we use the nix-tools
25−, cabal-install ? evalPackages.haskell-nix.cabal-install.${compiler-nix-name} # and cabal-install compiled with matching ghc version
25+, cabal-install ? evalPackages.haskell-nix.cabal-install-unchecked.${compiler-nix-name} # and cabal-install compiled with matching ghc version
26, configureArgs ? "" # Extra arguments to pass to `cabal v2-configure`.
26, configureArgs ? "" # Extra arguments to pass to `cabal v2-configure`.
27 # `--enable-tests --enable-benchmarks` are included by default.
27 # `--enable-tests --enable-benchmarks` are included by default.
28 # If the tests and benchmarks are not needed and they
28 # If the tests and benchmarks are not needed and they
@@ -212,14 +212,21 @@ let
212 # The solution here is to capture the GHC outputs that `cabal v2-configure`
212 # The solution here is to capture the GHC outputs that `cabal v2-configure`
213 # requests and materialize it so that the real GHC is only needed
213 # requests and materialize it so that the real GHC is only needed
214 # when `checkMaterialization` is set.
214 # when `checkMaterialization` is set.
215+ dummy-ghc-data =
216+ let
217+ materialized = ../materialized/dummy-ghc + "/${ghc.targetPrefix}${ghc.name}-${pkgs.stdenv.buildPlatform.system}";
215− dummy-ghc-data = pkgs.haskell-nix.materialize ({
218+ in pkgs.haskell-nix.materialize ({
216− sha256 = null;
219+ sha256 = null;
217− sha256Arg = "sha256";
220+ sha256Arg = "sha256";
221+ materialized = if __pathExists materialized
222+ then materialized
223+ else __trace ("WARNING: No materialized dummy-ghc-data for "
218− materialized = ../materialized/dummy-ghc + "/${ghc.targetPrefix}${ghc.name}-${pkgs.stdenv.buildPlatform.system}";
224+ + "${ghc.targetPrefix}${ghc.name}-${pkgs.stdenv.buildPlatform.system}.")
225+ null;
219− reasonNotSafe = null;
226+ reasonNotSafe = null;
220− } // pkgs.lib.optionalAttrs (checkMaterialization != null) {
227+ } // pkgs.lib.optionalAttrs (checkMaterialization != null) {
221− inherit checkMaterialization;
228+ inherit checkMaterialization;
222− }) (
229+ }) (
223 runCommand ("dummy-data-" + ghc.name) {
230 runCommand ("dummy-data-" + ghc.name) {
224 nativeBuildInputs = [ ghc ];
231 nativeBuildInputs = [ ghc ];
225 } ''
232 } ''