Sven Tennie pushed to branch wip/supersven/hadrian-cross-stage3 at Glasgow Haskell Compiler / GHC Commits: e41ef1b5 by GHC GitLab CI at 2026-07-28T16:29:02+02:00 CI: Use final cross stage wording more consistently - - - - - 2 changed files: - .gitlab/ci.sh - .gitlab/generate-ci/gen_ci.hs Changes: ===================================== .gitlab/ci.sh ===================================== @@ -62,9 +62,9 @@ Common Modes: Environment variables affecting the build: CROSS_TARGET Triple of cross-compilation target. - CROSS_STAGE The stage of the cross-compiler to build either - * 2: Build a normal cross-compiler bindist - * 3: Build a target executable bindist (with the stage2 cross-compiler) + FINAL_CROSS_STAGE The final stage of the cross-compiler to build either + * 2: Build a cross-compiler bindist + * 3: Build a target executable bindist (implies the cross-compiler bindist of 2) VERBOSE Set to non-empty for verbose build output RUNTEST_ARGS Arguments passed to runtest.py TEST_WAYS Testsuite ways to run @@ -573,7 +573,7 @@ function build_hadrian() { export XZ_OPT="${XZ_OPT:-} -T$cores" fi - case "${CROSS_STAGE:-2}" in + case "${FINAL_CROSS_STAGE:-2}" in 2) BINDIST_TARGET="binary-dist";; # Stage2 cross-compiler bindists are (almost) a byproduct of Stage3 # cross-compiled bindists. So, we bundle both of them when the Stage3 @@ -581,10 +581,10 @@ function build_hadrian() { 3) BINDIST_TARGET="binary-dist binary-dist-stage3" if [[ -z "${BIN_DIST_NAME_STAGE3:-}" ]]; then - fail "CROSS_STAGE=3 requires BIN_DIST_NAME_STAGE3 to be set" + fail "FINAL_CROSS_STAGE=3 requires BIN_DIST_NAME_STAGE3 to be set" fi ;; - *) fail "Unknown CROSS_STAGE, must be 2 or 3";; + *) fail "Unknown FINAL_CROSS_STAGE, must be 2 or 3";; esac if [[ -n "${REINSTALL_GHC:-}" ]]; then @@ -598,7 +598,7 @@ function build_hadrian() { *) run_hadrian test:all_deps $BINDIST_TARGET mv _build/bindist/ghc*.tar.xz "$BIN_DIST_NAME.tar.xz" - if [[ "${CROSS_STAGE:-2}" == "3" ]]; then + if [[ "${FINAL_CROSS_STAGE:-2}" == "3" ]]; then mv _build/bindist-stage3/ghc*.tar.xz "$BIN_DIST_NAME_STAGE3.tar.xz" fi ;; @@ -708,7 +708,7 @@ function test_hadrian() { # > main = putStrLn "hello world" run diff -w expected actual - if [[ "${CROSS_STAGE:-2}" == "3" ]]; then + if [[ "${FINAL_CROSS_STAGE:-2}" == "3" ]]; then local stage3_dir stage3_dir="$(echo _build/bindist-stage3/ghc-*/)" local stage3_ghc="$stage3_dir/bin/ghc$exe" ===================================== .gitlab/generate-ci/gen_ci.hs ===================================== @@ -159,7 +159,7 @@ data BuildConfig , withNuma :: Bool , withZstd :: Bool , crossTarget :: Maybe String - , crossStage :: Maybe FinalCrossStage + , finalCrossStage :: Maybe FinalCrossStage , crossEmulator :: CrossEmulator , configureWrapper :: Maybe String , fullyStatic :: Bool @@ -229,7 +229,7 @@ vanilla = BuildConfig , withNuma = False , withZstd = False , crossTarget = Nothing - , crossStage = Nothing + , finalCrossStage = Nothing , crossEmulator = NoEmulator , configureWrapper = Nothing , fullyStatic = False @@ -275,7 +275,7 @@ static = vanilla { fullyStatic = True } staticNativeInt :: BuildConfig staticNativeInt = static { bignumBackend = Native } --- | The final stage for which binary distrubutions should be built +-- | The final stage for which binary distributions should be built -- -- `Stage2` builds a cross-compiler (build == host, host /= target). `Stage3` -- implies `Stage2` and additionally builds a cross-compiled compiler (build /= @@ -294,7 +294,7 @@ crossConfig :: String -- ^ target triple -> BuildConfig crossConfig triple emulator configure_wrapper crossStage = vanilla { crossTarget = Just triple - , crossStage = Just crossStage + , finalCrossStage = Just crossStage , crossEmulator = emulator , configureWrapper = configure_wrapper } @@ -370,8 +370,7 @@ binDistName :: Arch -> Opsys -> BuildConfig -> String binDistName arch opsys bc = "ghc-" ++ testEnv arch opsys bc -- | The bindist name for the stage3 (target) artifact produced by a combined --- cross job (crossStage == Just 3). This preserves the naming convention --- expected by downstream consumers. +-- cross job (crossStage == Just 3). binDistNameStage3 :: Arch -> Opsys -> BuildConfig -> String binDistNameStage3 arch opsys bc = "ghc-" ++ intercalate "-" (concat [ [ archName arch, opsysName opsys ] @@ -907,7 +906,7 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} } [ opsysVariables arch opsys , "TEST_ENV" =: testEnv arch opsys buildConfig , "BIN_DIST_NAME" =: binDistName arch opsys buildConfig - , if crossStage buildConfig == Just Stage3 + , if finalCrossStage buildConfig == Just Stage3 then "BIN_DIST_NAME_STAGE3" =: binDistNameStage3 arch opsys buildConfig else mempty , "BUILD_FLAVOUR" =: flavourString jobFlavour @@ -916,7 +915,7 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} } , "INSTALL_CONFIGURE_ARGS" =: "--enable-strict-ghc-toolchain-check" , maybe mempty ("CONFIGURE_WRAPPER" =:) (configureWrapper buildConfig) , maybe mempty ("CROSS_TARGET" =:) (crossTarget buildConfig) - , maybe mempty (("CROSS_STAGE" =:) . show . crossStageToInt) (crossStage buildConfig) + , maybe mempty (("FINAL_CROSS_STAGE" =:) . show . crossStageToInt) (finalCrossStage buildConfig) , case crossEmulator buildConfig of NoEmulator -- we need an emulator but it isn't set. Won't run the testsuite @@ -950,7 +949,7 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} } trim = dropWhileEnd isSpace . dropWhile isSpace stage3Artifacts - | crossStage buildConfig == Just Stage3 = + | finalCrossStage buildConfig == Just Stage3 = [binDistNameStage3 arch opsys buildConfig ++ ".tar.xz"] | otherwise = [] @@ -1323,7 +1322,8 @@ cross_jobs = [ -- x86 -> aarch64 validateBuilds Amd64 (Linux Debian13) (crossConfig "aarch64-linux-gnu" (Emulator "qemu-aarch64 -L /usr/aarch64-linux-gnu") Nothing Stage2) - -- x86_64 (build) -> riscv64 (host/target) + -- Stage2: x86_64 (build/host) -> riscv64 (target) + -- Stage3: x86_64 (build) -> riscv64 (host/target) , addValidateRule RiscV (validateBuilds Amd64 (Linux Debian13Riscv) (crossConfig "riscv64-linux-gnu" (Emulator "qemu-riscv64 -L /usr/riscv64-linux-gnu") Nothing Stage3)) -- x86_64 -> loongarch64 View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e41ef1b5fe957a79cc74622e3f5c5808... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e41ef1b5fe957a79cc74622e3f5c5808... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help