Sven Tennie pushed to branch wip/supersven/hadrian-cross-stage3 at Glasgow Haskell Compiler / GHC
Commits:
-
2c132e4d
by GHC GitLab CI at 2026-07-28T16:22:50+02:00
2 changed files:
Changes:
| ... | ... | @@ -62,9 +62,9 @@ Common Modes: |
| 62 | 62 | Environment variables affecting the build:
|
| 63 | 63 | |
| 64 | 64 | CROSS_TARGET Triple of cross-compilation target.
|
| 65 | - CROSS_STAGE The stage of the cross-compiler to build either
|
|
| 66 | - * 2: Build a normal cross-compiler bindist
|
|
| 67 | - * 3: Build a target executable bindist (with the stage2 cross-compiler)
|
|
| 65 | + FINAL_CROSS_STAGE The final stage of the cross-compiler to build either
|
|
| 66 | + * 2: Build a cross-compiler bindist
|
|
| 67 | + * 3: Build a target executable bindist (implies the cross-compiler bindist of 2)
|
|
| 68 | 68 | VERBOSE Set to non-empty for verbose build output
|
| 69 | 69 | RUNTEST_ARGS Arguments passed to runtest.py
|
| 70 | 70 | TEST_WAYS Testsuite ways to run
|
| ... | ... | @@ -573,7 +573,7 @@ function build_hadrian() { |
| 573 | 573 | export XZ_OPT="${XZ_OPT:-} -T$cores"
|
| 574 | 574 | fi
|
| 575 | 575 | |
| 576 | - case "${CROSS_STAGE:-2}" in
|
|
| 576 | + case "${FINAL_CROSS_STAGE:-2}" in
|
|
| 577 | 577 | 2) BINDIST_TARGET="binary-dist";;
|
| 578 | 578 | # Stage2 cross-compiler bindists are (almost) a byproduct of Stage3
|
| 579 | 579 | # cross-compiled bindists. So, we bundle both of them when the Stage3
|
| ... | ... | @@ -581,10 +581,10 @@ function build_hadrian() { |
| 581 | 581 | 3)
|
| 582 | 582 | BINDIST_TARGET="binary-dist binary-dist-stage3"
|
| 583 | 583 | if [[ -z "${BIN_DIST_NAME_STAGE3:-}" ]]; then
|
| 584 | - fail "CROSS_STAGE=3 requires BIN_DIST_NAME_STAGE3 to be set"
|
|
| 584 | + fail "FINAL_CROSS_STAGE=3 requires BIN_DIST_NAME_STAGE3 to be set"
|
|
| 585 | 585 | fi
|
| 586 | 586 | ;;
|
| 587 | - *) fail "Unknown CROSS_STAGE, must be 2 or 3";;
|
|
| 587 | + *) fail "Unknown FINAL_CROSS_STAGE, must be 2 or 3";;
|
|
| 588 | 588 | esac
|
| 589 | 589 | |
| 590 | 590 | if [[ -n "${REINSTALL_GHC:-}" ]]; then
|
| ... | ... | @@ -598,7 +598,7 @@ function build_hadrian() { |
| 598 | 598 | *)
|
| 599 | 599 | run_hadrian test:all_deps $BINDIST_TARGET
|
| 600 | 600 | mv _build/bindist/ghc*.tar.xz "$BIN_DIST_NAME.tar.xz"
|
| 601 | - if [[ "${CROSS_STAGE:-2}" == "3" ]]; then
|
|
| 601 | + if [[ "${FINAL_CROSS_STAGE:-2}" == "3" ]]; then
|
|
| 602 | 602 | mv _build/bindist-stage3/ghc*.tar.xz "$BIN_DIST_NAME_STAGE3.tar.xz"
|
| 603 | 603 | fi
|
| 604 | 604 | ;;
|
| ... | ... | @@ -708,7 +708,7 @@ function test_hadrian() { |
| 708 | 708 | # > main = putStrLn "hello world"
|
| 709 | 709 | run diff -w expected actual
|
| 710 | 710 | |
| 711 | - if [[ "${CROSS_STAGE:-2}" == "3" ]]; then
|
|
| 711 | + if [[ "${FINAL_CROSS_STAGE:-2}" == "3" ]]; then
|
|
| 712 | 712 | local stage3_dir
|
| 713 | 713 | stage3_dir="$(echo _build/bindist-stage3/ghc-*/)"
|
| 714 | 714 | local stage3_ghc="$stage3_dir/bin/ghc$exe"
|
| ... | ... | @@ -159,7 +159,7 @@ data BuildConfig |
| 159 | 159 | , withNuma :: Bool
|
| 160 | 160 | , withZstd :: Bool
|
| 161 | 161 | , crossTarget :: Maybe String
|
| 162 | - , crossStage :: Maybe FinalCrossStage
|
|
| 162 | + , finalCrossStage :: Maybe FinalCrossStage
|
|
| 163 | 163 | , crossEmulator :: CrossEmulator
|
| 164 | 164 | , configureWrapper :: Maybe String
|
| 165 | 165 | , fullyStatic :: Bool
|
| ... | ... | @@ -229,7 +229,7 @@ vanilla = BuildConfig |
| 229 | 229 | , withNuma = False
|
| 230 | 230 | , withZstd = False
|
| 231 | 231 | , crossTarget = Nothing
|
| 232 | - , crossStage = Nothing
|
|
| 232 | + , finalCrossStage = Nothing
|
|
| 233 | 233 | , crossEmulator = NoEmulator
|
| 234 | 234 | , configureWrapper = Nothing
|
| 235 | 235 | , fullyStatic = False
|
| ... | ... | @@ -294,7 +294,7 @@ crossConfig :: String -- ^ target triple |
| 294 | 294 | -> BuildConfig
|
| 295 | 295 | crossConfig triple emulator configure_wrapper crossStage =
|
| 296 | 296 | vanilla { crossTarget = Just triple
|
| 297 | - , crossStage = Just crossStage
|
|
| 297 | + , finalCrossStage = Just crossStage
|
|
| 298 | 298 | , crossEmulator = emulator
|
| 299 | 299 | , configureWrapper = configure_wrapper
|
| 300 | 300 | }
|
| ... | ... | @@ -907,7 +907,7 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} } |
| 907 | 907 | [ opsysVariables arch opsys
|
| 908 | 908 | , "TEST_ENV" =: testEnv arch opsys buildConfig
|
| 909 | 909 | , "BIN_DIST_NAME" =: binDistName arch opsys buildConfig
|
| 910 | - , if crossStage buildConfig == Just Stage3
|
|
| 910 | + , if finalCrossStage buildConfig == Just Stage3
|
|
| 911 | 911 | then "BIN_DIST_NAME_STAGE3" =: binDistNameStage3 arch opsys buildConfig
|
| 912 | 912 | else mempty
|
| 913 | 913 | , "BUILD_FLAVOUR" =: flavourString jobFlavour
|
| ... | ... | @@ -916,7 +916,7 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} } |
| 916 | 916 | , "INSTALL_CONFIGURE_ARGS" =: "--enable-strict-ghc-toolchain-check"
|
| 917 | 917 | , maybe mempty ("CONFIGURE_WRAPPER" =:) (configureWrapper buildConfig)
|
| 918 | 918 | , maybe mempty ("CROSS_TARGET" =:) (crossTarget buildConfig)
|
| 919 | - , maybe mempty (("CROSS_STAGE" =:) . show . crossStageToInt) (crossStage buildConfig)
|
|
| 919 | + , maybe mempty (("FINAL_CROSS_STAGE" =:) . show . crossStageToInt) (finalCrossStage buildConfig)
|
|
| 920 | 920 | , case crossEmulator buildConfig of
|
| 921 | 921 | NoEmulator
|
| 922 | 922 | -- we need an emulator but it isn't set. Won't run the testsuite
|
| ... | ... | @@ -950,7 +950,7 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} } |
| 950 | 950 | trim = dropWhileEnd isSpace . dropWhile isSpace
|
| 951 | 951 | |
| 952 | 952 | stage3Artifacts
|
| 953 | - | crossStage buildConfig == Just Stage3 =
|
|
| 953 | + | finalCrossStage buildConfig == Just Stage3 =
|
|
| 954 | 954 | [binDistNameStage3 arch opsys buildConfig ++ ".tar.xz"]
|
| 955 | 955 | | otherwise = []
|
| 956 | 956 |