From 906105ed78fa2a1aeff45692f5dea6347e73dbf4 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Mon, 4 Aug 2025 18:43:29 +0200 Subject: [PATCH] =?UTF-8?q?Revert=20"haskell.compiler.ghc981:=20build=20st?= =?UTF-8?q?age=202=20compiler=20for=20=E2=80=9Cnative=20cross=E2=80=9D"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1dc7345389a2baced186589cab9824cec3dc0281. Reason for revert: The change doesn't work as in intended, i.e. hadrian refuses to build a Stage2 compiler as requested in the “native cross” case. Thus the canExecute condition only served to confuse --- pkgs/development/compilers/ghc/common-hadrian.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/development/compilers/ghc/common-hadrian.nix b/pkgs/development/compilers/ghc/common-hadrian.nix index 7d652f4f8111..05bfe260e7c0 100644 --- a/pkgs/development/compilers/ghc/common-hadrian.nix +++ b/pkgs/development/compilers/ghc/common-hadrian.nix @@ -132,10 +132,12 @@ -- no way to set this via the command line finalStage :: Stage finalStage = ${ - # Always build the stage 2 compiler if possible. - # TODO(@sternensemann): unify condition with make-built GHCs - if stdenv.hostPlatform.canExecute stdenv.targetPlatform then - "Stage2" # native compiler or “native” cross e.g. pkgsStatic + # N. B. hadrian ignores this setting if it doesn't agree it's possible, + # i.e. when its cross-compiling setting is true. So while we could, in theory, + # build Stage2 if hostPlatform.canExecute targetPlatform, hadrian won't play + # ball (with make, Stage2 was built if hostPlatform.system == targetPlatform.system). + if stdenv.hostPlatform == stdenv.targetPlatform then + "Stage2" # native compiler else "Stage1" # cross compiler }