diff --git a/pkgs/development/compilers/ghc/common-hadrian.nix b/pkgs/development/compilers/ghc/common-hadrian.nix index 079bbefbae4c..522bcb10222b 100644 --- a/pkgs/development/compilers/ghc/common-hadrian.nix +++ b/pkgs/development/compilers/ghc/common-hadrian.nix @@ -116,8 +116,11 @@ -- no way to set this via the command line finalStage :: Stage finalStage = ${ - if stdenv.hostPlatform == stdenv.targetPlatform - then "Stage2" # native compiler + # Always build the stage 2 compiler if possible. Note we can currently + # assume hostPlatform == buildPlatform. + # TODO(@sternenseemann): improve this condition when we can cross-compile GHC + if stdenv.hostPlatform.canExecute stdenv.targetPlatform + then "Stage2" # native compiler or “native” cross e.g. pkgsStatic else "Stage1" # cross compiler }