diff --git a/pkgs/development/tools/haskell/hadrian/hadrian.nix b/pkgs/development/tools/haskell/hadrian/hadrian.nix index 2c3df95f2ea4..62b1a91f6c9b 100644 --- a/pkgs/development/tools/haskell/hadrian/hadrian.nix +++ b/pkgs/development/tools/haskell/hadrian/hadrian.nix @@ -1,4 +1,4 @@ -# See also ./make-hadria.nix +# See also ./make-hadrian.nix { mkDerivation, base, @@ -24,6 +24,8 @@ # GHC source tree to build hadrian from ghcSrc, ghcVersion, + # GHC we are using to bootstrap hadrian (stage0) + bootGhcVersion, # Customization userSettings ? null, }: @@ -48,12 +50,19 @@ mkDerivation { "-O0" ]; jailbreak = - # Ignore lower bound on directory. Upstream uses this to avoid a race condition + # Ignore bound directory >= 1.3.9.0, unless the bootstrapping GHC ships it + # which is the case for >= 9.12. Upstream uses this to avoid a race condition # that only seems to affect Windows. We never build GHC natively on Windows. - # https://gitlab.haskell.org/ghc/ghc/-/issues/24382 - # https://gitlab.haskell.org/ghc/ghc/-/commit/a2c033cf82635c83f3107706634bebee43297b99 - (lib.versionAtLeast ghcVersion "9.6.7" && lib.versionOlder ghcVersion "9.7") - || lib.versionAtLeast ghcVersion "9.12"; + # See also https://gitlab.haskell.org/ghc/ghc/-/issues/24382, + # https://gitlab.haskell.org/ghc/ghc/-/commit/a2c033cf826, + # https://gitlab.haskell.org/ghc/ghc/-/commit/7890f2d8526… + ( + lib.versionOlder bootGhcVersion "9.12" + && ( + (lib.versionAtLeast ghcVersion "9.6.7" && lib.versionOlder ghcVersion "9.7") + || lib.versionAtLeast ghcVersion "9.11" + ) + ); isLibrary = false; isExecutable = true; executableHaskellDepends = [ diff --git a/pkgs/development/tools/haskell/hadrian/make-hadrian.nix b/pkgs/development/tools/haskell/hadrian/make-hadrian.nix index d2463865c199..2d86c96c82b9 100644 --- a/pkgs/development/tools/haskell/hadrian/make-hadrian.nix +++ b/pkgs/development/tools/haskell/hadrian/make-hadrian.nix @@ -55,6 +55,8 @@ in callPackage' ./hadrian.nix ( { inherit userSettings; + # Taking `ghc` as an input may be too confusing + bootGhcVersion = bootPkgs.ghc.version; } // lib.optionalAttrs (lib.versionAtLeast ghcVersion "9.9") { # Starting with GHC 9.9 development, additional in tree packages are required