Sven Tennie pushed to branch wip/supersven/hadrian-cross-stage3 at Glasgow Haskell Compiler / GHC
Commits:
-
10c23983
by Sven Tennie at 2026-10-11T06:54:09+00:00
-
ceaa3ddb
by Sven Tennie at 2026-10-11T06:54:09+00:00
-
d0570c3e
by Sven Tennie at 2026-10-11T06:54:09+00:00
-
2c7a99fc
by Sven Tennie at 2026-10-11T06:54:27+00:00
-
cf4361ca
by Sven Tennie at 2026-10-11T06:54:28+00:00
-
f4e45edd
by Sven Tennie at 2026-10-11T06:54:28+00:00
-
119a2f36
by Sven Tennie at 2026-10-11T06:54:34+00:00
-
28789d48
by Sven Tennie at 2026-10-11T09:02:38+02:00
6 changed files:
- .gitlab/ci.sh
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- hadrian/src/Rules/BinaryDist.hs
- hadrian/src/Rules/Generate.hs
- hadrian/src/Settings/Packages.hs
Changes:
| ... | ... | @@ -62,9 +62,10 @@ 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: Also build the target executable bindist
|
|
| 68 | + (builds stages 2 and 3; implies the bindist of 2)
|
|
| 68 | 69 | VERBOSE Set to non-empty for verbose build output
|
| 69 | 70 | RUNTEST_ARGS Arguments passed to runtest.py
|
| 70 | 71 | TEST_WAYS Testsuite ways to run
|
| ... | ... | @@ -573,10 +574,17 @@ function build_hadrian() { |
| 573 | 574 | export XZ_OPT="${XZ_OPT:-} -T$cores"
|
| 574 | 575 | fi
|
| 575 | 576 | |
| 576 | - case "${CROSS_STAGE:-2}" in
|
|
| 577 | + case "${FINAL_CROSS_STAGE:-2}" in
|
|
| 577 | 578 | 2) BINDIST_TARGET="binary-dist";;
|
| 578 | - 3) BINDIST_TARGET="binary-dist-stage3";;
|
|
| 579 | - *) fail "Unknown CROSS_STAGE, must be 2 or 3";;
|
|
| 579 | + # Stage2 bindists are (almost) a byproduct of Stage3 bindists. So, we
|
|
| 580 | + # bundle both of them when the Stage3 bindist is built.
|
|
| 581 | + 3)
|
|
| 582 | + BINDIST_TARGET="binary-dist binary-dist-stage3"
|
|
| 583 | + if [[ -z "${BIN_DIST_NAME_STAGE3:-}" ]]; then
|
|
| 584 | + fail "FINAL_CROSS_STAGE=3 requires BIN_DIST_NAME_STAGE3 to be set"
|
|
| 585 | + fi
|
|
| 586 | + ;;
|
|
| 587 | + *) fail "Unknown FINAL_CROSS_STAGE, must be 2 or 3";;
|
|
| 580 | 588 | esac
|
| 581 | 589 | |
| 582 | 590 | if [[ -n "${REINSTALL_GHC:-}" ]]; then
|
| ... | ... | @@ -590,6 +598,9 @@ function build_hadrian() { |
| 590 | 598 | *)
|
| 591 | 599 | run_hadrian test:all_deps $BINDIST_TARGET
|
| 592 | 600 | mv _build/bindist/ghc*.tar.xz "$BIN_DIST_NAME.tar.xz"
|
| 601 | + if [[ "${FINAL_CROSS_STAGE:-2}" == "3" ]]; then
|
|
| 602 | + mv _build/bindist-stage3/ghc*.tar.xz "$BIN_DIST_NAME_STAGE3.tar.xz"
|
|
| 603 | + fi
|
|
| 593 | 604 | ;;
|
| 594 | 605 | esac
|
| 595 | 606 | fi
|
| ... | ... | @@ -648,6 +659,74 @@ function install_bindist() { |
| 648 | 659 | end_section install-bindist
|
| 649 | 660 | }
|
| 650 | 661 | |
| 662 | +# Smoke-test the cross-compiled Stage2 and Stage2 bindists using the emulator.
|
|
| 663 | +# For cross jobs with a working emulator this runs instead of `test_hadrian`
|
|
| 664 | +# as a separate validation step after the build.
|
|
| 665 | +function smoke_test() {
|
|
| 666 | + check_msys2_deps _build/stage1/bin/ghc --version
|
|
| 667 | + check_release_build
|
|
| 668 | + |
|
| 669 | + if [[ "${CROSS_EMULATOR:-}" == "NOT_SET" ]]; then
|
|
| 670 | + info "Cannot test cross-compiled build without CROSS_EMULATOR being set."
|
|
| 671 | + return
|
|
| 672 | + fi
|
|
| 673 | + |
|
| 674 | + local instdir="$TOP/_build/install"
|
|
| 675 | + local test_compiler="$instdir/bin/${cross_prefix}ghc$exe"
|
|
| 676 | + install_bindist _build/bindist/ghc-*/ "$instdir"
|
|
| 677 | + echo 'main = putStrLn "hello world"' > expected
|
|
| 678 | + run "$test_compiler" -package ghc "$TOP/.gitlab/hello.hs" -o hello
|
|
| 679 | + |
|
| 680 | + if [[ "${CROSS_TARGET:-no_cross_target}" =~ "mingw" ]]; then
|
|
| 681 | + ${CROSS_EMULATOR:-} ./hello.exe > actual
|
|
| 682 | + else
|
|
| 683 | + ${CROSS_EMULATOR:-} ./hello > actual
|
|
| 684 | + fi
|
|
| 685 | + |
|
| 686 | + # We have to use `-w` to make the test more stable across supported
|
|
| 687 | + # platforms, i.e. Windows:
|
|
| 688 | + # $ cmp expected actual
|
|
| 689 | + # differ: byte 30, line 1
|
|
| 690 | + # $ diff expected actual
|
|
| 691 | + # 1c1
|
|
| 692 | + # < main = putStrLn "hello world"
|
|
| 693 | + # ---
|
|
| 694 | + # > main = putStrLn "hello world"
|
|
| 695 | + run diff -w expected actual
|
|
| 696 | + |
|
| 697 | + if [[ "${FINAL_CROSS_STAGE:-2}" == "3" ]]; then
|
|
| 698 | + local stage3_dir
|
|
| 699 | + stage3_dir="$(echo _build/bindist-stage3/ghc-*/)"
|
|
| 700 | + local stage3_ghc="$stage3_dir/bin/ghc$exe"
|
|
| 701 | + |
|
| 702 | + info "Smoke-testing stage3 compiler..."
|
|
| 703 | + run ${CROSS_EMULATOR} "$stage3_ghc" --info > stage3-info
|
|
| 704 | + cat stage3-info
|
|
| 705 | + |
|
| 706 | + # The stage3 compiler is a native target compiler: it must not consider
|
|
| 707 | + # itself a cross-compiler, and GHCi support must be compiled in when the
|
|
| 708 | + # target supports it.
|
|
| 709 | + grep -q '"cross compiling","NO"' stage3-info \
|
|
| 710 | + || fail "stage3 compiler reports itself as cross-compiling"
|
|
| 711 | + |
|
| 712 | + if grep -q '"Use interpreter","YES"' stage3-info; then
|
|
| 713 | + echo 'ghci works' > ghci-expected
|
|
| 714 | + ${CROSS_EMULATOR:-} "$stage3_ghc" -e 'putStrLn "ghci works"' > ghci-actual
|
|
| 715 | + run diff -w ghci-expected ghci-actual
|
|
| 716 | + fi
|
|
| 717 | + |
|
| 718 | + run ${CROSS_EMULATOR} "$stage3_ghc" -package ghc "$TOP/.gitlab/hello.hs" -o hello-stage3
|
|
| 719 | + |
|
| 720 | + if [[ "${CROSS_TARGET:-no_cross_target}" =~ "mingw" ]]; then
|
|
| 721 | + ${CROSS_EMULATOR:-} ./hello-stage3.exe > actual-stage3
|
|
| 722 | + else
|
|
| 723 | + ${CROSS_EMULATOR:-} ./hello-stage3 > actual-stage3
|
|
| 724 | + fi
|
|
| 725 | + |
|
| 726 | + run diff -w expected actual-stage3
|
|
| 727 | + fi
|
|
| 728 | +}
|
|
| 729 | + |
|
| 651 | 730 | function test_hadrian() {
|
| 652 | 731 | check_msys2_deps _build/stage1/bin/ghc --version
|
| 653 | 732 | check_release_build
|
| ... | ... | @@ -672,35 +751,7 @@ function test_hadrian() { |
| 672 | 751 | fi
|
| 673 | 752 | fi
|
| 674 | 753 | |
| 675 | - |
|
| 676 | - if [[ "${CROSS_EMULATOR:-}" == "NOT_SET" ]]; then
|
|
| 677 | - info "Cannot test cross-compiled build without CROSS_EMULATOR being set."
|
|
| 678 | - return
|
|
| 679 | - # If we have set CROSS_EMULATOR, then can't test using normal testsuite.
|
|
| 680 | - elif [ -n "${CROSS_EMULATOR:-}" ] && [[ "${CROSS_TARGET:-}" != *"wasm"* ]]; then
|
|
| 681 | - local instdir="$TOP/_build/install"
|
|
| 682 | - local test_compiler="$instdir/bin/${cross_prefix}ghc$exe"
|
|
| 683 | - install_bindist _build/bindist/ghc-*/ "$instdir"
|
|
| 684 | - echo 'main = putStrLn "hello world"' > expected
|
|
| 685 | - run "$test_compiler" -package ghc "$TOP/.gitlab/hello.hs" -o hello
|
|
| 686 | - |
|
| 687 | - if [[ "${CROSS_TARGET:-no_cross_target}" =~ "mingw" ]]; then
|
|
| 688 | - ${CROSS_EMULATOR:-} ./hello.exe > actual
|
|
| 689 | - else
|
|
| 690 | - ${CROSS_EMULATOR:-} ./hello > actual
|
|
| 691 | - fi
|
|
| 692 | - |
|
| 693 | - # We have to use `-w` to make the test more stable across supported
|
|
| 694 | - # platforms, i.e. Windows:
|
|
| 695 | - # $ cmp expected actual
|
|
| 696 | - # differ: byte 30, line 1
|
|
| 697 | - # $ diff expected actual
|
|
| 698 | - # 1c1
|
|
| 699 | - # < main = putStrLn "hello world"
|
|
| 700 | - # ---
|
|
| 701 | - # > main = putStrLn "hello world"
|
|
| 702 | - run diff -w expected actual
|
|
| 703 | - elif [[ -n "${REINSTALL_GHC:-}" ]]; then
|
|
| 754 | + if [[ -n "${REINSTALL_GHC:-}" ]]; then
|
|
| 704 | 755 | run_hadrian \
|
| 705 | 756 | test \
|
| 706 | 757 | --test-root-dirs=testsuite/tests/stage1 \
|
| ... | ... | @@ -1131,6 +1182,7 @@ case ${1:-help} in |
| 1131 | 1182 | time_it "test" test_hadrian || res=$?
|
| 1132 | 1183 | push_perf_notes
|
| 1133 | 1184 | exit $res ;;
|
| 1185 | + smoke_test) time_it "smoke-test" smoke_test ;;
|
|
| 1134 | 1186 | run_hadrian) shift; run_hadrian "$@" ;;
|
| 1135 | 1187 | perf_test) run_perf_test ;;
|
| 1136 | 1188 | abi_test) abi_test ;;
|
| ... | ... | @@ -110,26 +110,49 @@ data Opsys |
| 110 | 110 | = Linux LinuxDistro
|
| 111 | 111 | | Darwin
|
| 112 | 112 | | FreeBSD14
|
| 113 | - | Windows deriving (Eq)
|
|
| 113 | + | Windows deriving (Eq, Show)
|
|
| 114 | 114 | |
| 115 | 115 | data LinuxDistro
|
| 116 | 116 | = Debian13
|
| 117 | 117 | | Debian12
|
| 118 | - | Debian12Wine
|
|
| 119 | - | Debian13Riscv
|
|
| 120 | 118 | | Debian11
|
| 121 | - | Debian11Js
|
|
| 122 | 119 | | Fedora43
|
| 123 | - | Ubuntu2404LoongArch64
|
|
| 124 | 120 | | Ubuntu2404
|
| 125 | 121 | | Ubuntu2204
|
| 126 | 122 | | Alpine312
|
| 127 | 123 | | Alpine323
|
| 128 | - | AlpineWasm
|
|
| 129 | 124 | | Rocky8
|
| 130 | - deriving (Eq)
|
|
| 131 | - |
|
| 132 | -data Arch = Amd64 | AArch64 | I386
|
|
| 125 | + deriving (Eq, Show)
|
|
| 126 | + |
|
| 127 | +data Arch = Amd64 | AArch64 | I386 | RiscV64 | LoongArch | Wasm32 | JavaScript
|
|
| 128 | + deriving (Show)
|
|
| 129 | + |
|
| 130 | +-- | Describes what the docker image is for: the development flavour of the
|
|
| 131 | +-- build environment, orthogonal to the image's own architecture ('Arch').
|
|
| 132 | +-- E.g. @FlavorRiscV@ denotes the image that carries the RISC-V cross
|
|
| 133 | +-- toolchain.
|
|
| 134 | +data ImageFlavor
|
|
| 135 | + = FlavorVanilla
|
|
| 136 | + | FlavorRiscV
|
|
| 137 | + | FlavorLoongArch
|
|
| 138 | + | FlavorWine
|
|
| 139 | + | FlavorEmscripten
|
|
| 140 | + | FlavorWasm
|
|
| 141 | + deriving (Eq, Show)
|
|
| 142 | + |
|
| 143 | +-- | OS element of a configure target triple: this is the OS of the *target*
|
|
| 144 | +-- platform, not the build environment (that is 'Opsys'/'LinuxDistro').
|
|
| 145 | +data TargetOs
|
|
| 146 | + = TargetOsLinuxGnu
|
|
| 147 | + | TargetOsGhcjs
|
|
| 148 | + | TargetOsMingw32
|
|
| 149 | + | TargetOsWasi
|
|
| 150 | + deriving (Eq, Show)
|
|
| 151 | + |
|
| 152 | +data TargetPlatform = TargetPlatform
|
|
| 153 | + { tpArch :: Arch -- ^ target architecture, e.g. 'RiscV64'
|
|
| 154 | + , tpOs :: TargetOs -- ^ target OS, e.g. 'TargetOsLinuxGnu'
|
|
| 155 | + }
|
|
| 133 | 156 | |
| 134 | 157 | data BignumBackend = Native | Gmp deriving Eq
|
| 135 | 158 | |
| ... | ... | @@ -158,8 +181,8 @@ data BuildConfig |
| 158 | 181 | , withAssertions :: Bool
|
| 159 | 182 | , withNuma :: Bool
|
| 160 | 183 | , withZstd :: Bool
|
| 161 | - , crossTarget :: Maybe String
|
|
| 162 | - , crossStage :: Maybe Int
|
|
| 184 | + , crossTarget :: Maybe TargetPlatform
|
|
| 185 | + , crossStages :: Maybe CrossStages
|
|
| 163 | 186 | , crossEmulator :: CrossEmulator
|
| 164 | 187 | , configureWrapper :: Maybe String
|
| 165 | 188 | , fullyStatic :: Bool
|
| ... | ... | @@ -180,7 +203,7 @@ configureArgsStr bc = unwords $ |
| 180 | 203 | ["--enable-unregisterised"| unregisterised bc ]
|
| 181 | 204 | ++ ["--disable-tables-next-to-code" | not (tablesNextToCode bc) ]
|
| 182 | 205 | ++ ["--with-intree-gmp" | Just _ <- [crossTarget bc] ]
|
| 183 | - ++ ["--with-system-libffi" | crossTarget bc == Just "wasm32-wasi" ]
|
|
| 206 | + ++ ["--with-system-libffi" | (tpOs <$> crossTarget bc) == Just TargetOsWasi ]
|
|
| 184 | 207 | ++ ["--enable-ipe-data-compression" | withZstd bc ]
|
| 185 | 208 | ++ ["--enable-strict-ghc-toolchain-check"]
|
| 186 | 209 | |
| ... | ... | @@ -229,7 +252,7 @@ vanilla = BuildConfig |
| 229 | 252 | , withNuma = False
|
| 230 | 253 | , withZstd = False
|
| 231 | 254 | , crossTarget = Nothing
|
| 232 | - , crossStage = Nothing
|
|
| 255 | + , crossStages = Nothing
|
|
| 233 | 256 | , crossEmulator = NoEmulator
|
| 234 | 257 | , configureWrapper = Nothing
|
| 235 | 258 | , fullyStatic = False
|
| ... | ... | @@ -275,17 +298,54 @@ static = vanilla { fullyStatic = True } |
| 275 | 298 | staticNativeInt :: BuildConfig
|
| 276 | 299 | staticNativeInt = static { bignumBackend = Native }
|
| 277 | 300 | |
| 278 | -crossConfig :: String -- ^ target triple
|
|
| 301 | +-- | The cross stages a build produces binary distributions for
|
|
| 302 | +data CrossStages
|
|
| 303 | + = -- | Builds a cross-compiler (build == host, host /= target):
|
|
| 304 | + -- its bindist runs on the build host.
|
|
| 305 | + Stage2
|
|
| 306 | + | -- | Implies `Stage2` and additionally builds a cross-compiled compiler
|
|
| 307 | + -- (build /= host, host == target).
|
|
| 308 | + Stage2And3
|
|
| 309 | + deriving stock (Eq, Ord)
|
|
| 310 | + |
|
| 311 | +crossConfig :: TargetPlatform -- ^ target platform
|
|
| 279 | 312 | -> CrossEmulator -- ^ emulator for testing
|
| 280 | 313 | -> Maybe String -- ^ Configure wrapper
|
| 314 | + -> CrossStages -- ^ final cross stages to build bindists for
|
|
| 281 | 315 | -> BuildConfig
|
| 282 | -crossConfig triple emulator configure_wrapper =
|
|
| 283 | - vanilla { crossTarget = Just triple
|
|
| 284 | - , crossStage = Just 2
|
|
| 316 | +crossConfig targetPlatform emulator configure_wrapper crossStage =
|
|
| 317 | + vanilla { crossTarget = Just targetPlatform
|
|
| 318 | + , crossStages = Just crossStage
|
|
| 285 | 319 | , crossEmulator = emulator
|
| 286 | 320 | , configureWrapper = configure_wrapper
|
| 287 | 321 | }
|
| 288 | 322 | |
| 323 | +-- | The docker image flavour of a build, derived from its cross target
|
|
| 324 | +-- (the image must carry the target's toolchain) or 'FlavorVanilla' for
|
|
| 325 | +-- plain builds.
|
|
| 326 | +buildFlavor :: BuildConfig -> ImageFlavor
|
|
| 327 | +buildFlavor bc = maybe FlavorVanilla flavorOf (crossTarget bc)
|
|
| 328 | + where
|
|
| 329 | + flavorOf :: TargetPlatform -> ImageFlavor
|
|
| 330 | + flavorOf TargetPlatform{ tpArch = arch, tpOs = os } = case (arch, os) of
|
|
| 331 | + (AArch64, TargetOsLinuxGnu) -> FlavorVanilla
|
|
| 332 | + (AArch64, TargetOsMingw32) -> FlavorWine
|
|
| 333 | + (RiscV64, TargetOsLinuxGnu) -> FlavorRiscV
|
|
| 334 | + (LoongArch, TargetOsLinuxGnu) -> FlavorLoongArch
|
|
| 335 | + (Wasm32, TargetOsWasi) -> FlavorWasm
|
|
| 336 | + (JavaScript, TargetOsGhcjs) -> FlavorEmscripten
|
|
| 337 | + _ -> error $
|
|
| 338 | + "flavorOf: no image flavour for target " ++ show arch ++ "/" ++ show os
|
|
| 339 | + |
|
| 340 | +-- | The configure target triple the build system consumes, e.g.
|
|
| 341 | +-- @"riscv64-linux-gnu"@.
|
|
| 342 | +renderTriple :: TargetPlatform -> String
|
|
| 343 | +renderTriple TargetPlatform{ tpArch = arch, tpOs = os } = case os of
|
|
| 344 | + TargetOsLinuxGnu -> archName arch ++ "-linux-gnu"
|
|
| 345 | + TargetOsGhcjs -> archName arch ++ "-unknown-ghcjs"
|
|
| 346 | + TargetOsMingw32 -> archName arch ++ "-unknown-mingw32"
|
|
| 347 | + TargetOsWasi -> archName arch ++ "-wasi"
|
|
| 348 | + |
|
| 289 | 349 | llvm :: BuildConfig
|
| 290 | 350 | llvm = vanilla { llvmBootstrap = True, testsuiteWays = ["llvm", "optllvm"] }
|
| 291 | 351 | |
| ... | ... | @@ -307,16 +367,16 @@ usePerfProfilingTestsuite bc = bc { testsuiteUsePerf = True } |
| 307 | 367 | |
| 308 | 368 | -- | These tags have to match what we call the runners on gitlab
|
| 309 | 369 | runnerTag :: Arch -> Opsys -> String
|
| 310 | -runnerTag arch (Linux _) =
|
|
| 311 | - case arch of
|
|
| 312 | - Amd64 -> "x86_64-linux"
|
|
| 313 | - AArch64 -> "aarch64-linux"
|
|
| 314 | - I386 -> "x86_64-linux"
|
|
| 315 | -runnerTag AArch64 Darwin = "aarch64-darwin"
|
|
| 316 | -runnerTag Amd64 Darwin = "x86_64-darwin-m1"
|
|
| 317 | -runnerTag Amd64 Windows = "new-x86_64-windows"
|
|
| 318 | -runnerTag Amd64 FreeBSD14 = "x86_64-freebsd14"
|
|
| 319 | -runnerTag _ _ = error "Invalid arch/opsys"
|
|
| 370 | +runnerTag arch opsys = case (arch, opsys) of
|
|
| 371 | + (Amd64, Linux{}) -> "x86_64-linux"
|
|
| 372 | + (AArch64, Linux{}) -> "aarch64-linux"
|
|
| 373 | + (I386, Linux{}) -> "x86_64-linux"
|
|
| 374 | + (AArch64, Darwin) -> "aarch64-darwin"
|
|
| 375 | + (Amd64, Darwin) -> "x86_64-darwin-m1"
|
|
| 376 | + (Amd64, Windows) -> "new-x86_64-windows"
|
|
| 377 | + (Amd64, FreeBSD14) -> "x86_64-freebsd14"
|
|
| 378 | + _ -> error $ "runnerTag: no runner for "
|
|
| 379 | + ++ show arch ++ "/" ++ show opsys
|
|
| 320 | 380 | |
| 321 | 381 | tags :: Arch -> Opsys -> BuildConfig -> [String]
|
| 322 | 382 | tags arch opsys _bc = [runnerTag arch opsys] -- Tag for which runners we can use
|
| ... | ... | @@ -324,52 +384,92 @@ tags arch opsys _bc = [runnerTag arch opsys] -- Tag for which runners we can use |
| 324 | 384 | runnerPerfTag :: Arch -> Opsys -> String
|
| 325 | 385 | runnerPerfTag arch sys = runnerTag arch sys ++ "-perf"
|
| 326 | 386 | |
| 327 | --- These names are used to find the docker image so they have to match what is
|
|
| 328 | --- in the docker registry.
|
|
| 387 | +-- | These names are used to find the docker image so they have to match what
|
|
| 388 | +-- is in the docker registry.
|
|
| 329 | 389 | distroName :: LinuxDistro -> String
|
| 330 | 390 | distroName Debian13 = "deb13"
|
| 331 | 391 | distroName Debian12 = "deb12"
|
| 332 | 392 | distroName Debian11 = "deb11"
|
| 333 | -distroName Debian11Js = "deb11-emsdk-closure"
|
|
| 334 | -distroName Debian13Riscv = "deb13-riscv"
|
|
| 335 | -distroName Debian12Wine = "deb12-wine"
|
|
| 336 | 393 | distroName Fedora43 = "fedora43"
|
| 337 | -distroName Ubuntu2404LoongArch64 = "ubuntu24_04-loongarch"
|
|
| 338 | 394 | distroName Ubuntu2204 = "ubuntu22_04"
|
| 339 | 395 | distroName Ubuntu2404 = "ubuntu24_04"
|
| 340 | 396 | distroName Alpine312 = "alpine3_12"
|
| 341 | 397 | distroName Alpine323 = "alpine3_23"
|
| 342 | -distroName AlpineWasm = "alpine3_23-wasm"
|
|
| 343 | 398 | distroName Rocky8 = "rocky8"
|
| 344 | 399 | |
| 345 | -opsysName :: Opsys -> String
|
|
| 346 | -opsysName (Linux distro) = "linux-" ++ distroName distro
|
|
| 347 | -opsysName Darwin = "darwin"
|
|
| 348 | -opsysName FreeBSD14 = "freebsd14"
|
|
| 349 | -opsysName Windows = "windows"
|
|
| 400 | +-- | The distro tag used in docker image names, extended with the toolchain
|
|
| 401 | +-- suffix of the image flavour (e.g. 'Debian13'' + 'FlavorRiscV' ->
|
|
| 402 | +-- @"deb13-riscv"@).
|
|
| 403 | +distroImageTag :: LinuxDistro -> ImageFlavor -> String
|
|
| 404 | +distroImageTag distro flavor = distroName distro ++ flavorSuffix flavor
|
|
| 405 | + where
|
|
| 406 | + flavorSuffix :: ImageFlavor -> String
|
|
| 407 | + flavorSuffix FlavorVanilla = ""
|
|
| 408 | + flavorSuffix FlavorRiscV = "-riscv"
|
|
| 409 | + flavorSuffix FlavorLoongArch = "-loongarch"
|
|
| 410 | + flavorSuffix FlavorWine = "-wine"
|
|
| 411 | + flavorSuffix FlavorEmscripten = "-emsdk-closure"
|
|
| 412 | + flavorSuffix FlavorWasm = "-wasm"
|
|
| 413 | + |
|
| 414 | +-- | OS name as it appears for job identity and docker image tags, qualified
|
|
| 415 | +-- by the working image flavour if any (e.g. @"linux-deb13-riscv"@).
|
|
| 416 | +opsysNameWithFlavor :: Opsys -> ImageFlavor -> String
|
|
| 417 | +opsysNameWithFlavor (Linux distro) flavor = "linux-" ++ distroImageTag distro flavor
|
|
| 418 | +opsysNameWithFlavor opsys _ = opsysName opsys
|
|
| 419 | + where
|
|
| 420 | + opsysName :: Opsys -> String
|
|
| 421 | + opsysName (Linux distro) = "linux-" ++ distroName distro
|
|
| 422 | + opsysName Darwin = "darwin"
|
|
| 423 | + opsysName FreeBSD14 = "freebsd14"
|
|
| 424 | + opsysName Windows = "windows"
|
|
| 350 | 425 | |
| 351 | 426 | archName :: Arch -> String
|
| 352 | -archName Amd64 = "x86_64"
|
|
| 353 | -archName AArch64 = "aarch64"
|
|
| 354 | -archName I386 = "i386"
|
|
| 427 | +archName Amd64 = "x86_64"
|
|
| 428 | +archName AArch64 = "aarch64"
|
|
| 429 | +archName I386 = "i386"
|
|
| 430 | +archName RiscV64 = "riscv64"
|
|
| 431 | +archName LoongArch = "loongarch64"
|
|
| 432 | +archName Wasm32 = "wasm32"
|
|
| 433 | +archName JavaScript = "javascript"
|
|
| 355 | 434 | |
| 356 | 435 | binDistName :: Arch -> Opsys -> BuildConfig -> String
|
| 357 | -binDistName arch opsys bc = "ghc-" ++ testEnv arch opsys bc
|
|
| 436 | +binDistName arch opsys bc = "ghc-" ++ testEnvWith (archName arch) opsys bc
|
|
| 437 | + |
|
| 438 | +-- | Name of the stage3 (target-platform) bindist.
|
|
| 439 | +--
|
|
| 440 | +-- Because that bindist lives on its target, it is named as if built natively
|
|
| 441 | +-- on the target: target architecture, the OS of the job, and no
|
|
| 442 | +-- cross/toolchain flavour markers.
|
|
| 443 | +stage3BinDistName :: Opsys -> BuildConfig -> Maybe String
|
|
| 444 | +stage3BinDistName opsys bc
|
|
| 445 | + | buildsTargetBindist
|
|
| 446 | + , Just TargetPlatform{ tpArch = arch } <- crossTarget bc
|
|
| 447 | + = Just $ binDistName arch opsys (bc { crossTarget = Nothing })
|
|
| 448 | + | otherwise
|
|
| 449 | + = Nothing
|
|
| 450 | + where
|
|
| 451 | + -- Whether any bindist produced by this build configuration runs on its
|
|
| 452 | + -- target platform rather than on the build host.
|
|
| 453 | + buildsTargetBindist :: Bool
|
|
| 454 | + buildsTargetBindist = crossStages bc == Just Stage2And3
|
|
| 358 | 455 | |
| 359 | 456 | -- | Test env should create a string which changes whenever the 'BuildConfig' changes.
|
| 360 | 457 | -- Either the change is reflected by modifying the flavourString or directly (as is
|
| 361 | 458 | -- the case for settings which affect environment variables)
|
| 362 | 459 | testEnv :: Arch -> Opsys -> BuildConfig -> String
|
| 363 | -testEnv arch opsys bc =
|
|
| 460 | +testEnv arch = testEnvWith (archName arch)
|
|
| 461 | + |
|
| 462 | +testEnvWith :: String -> Opsys -> BuildConfig -> String
|
|
| 463 | +testEnvWith archN opsys bc =
|
|
| 364 | 464 | intercalate "-" $ concat
|
| 365 | - [ [ archName arch
|
|
| 366 | - , opsysName opsys ]
|
|
| 465 | + [ [ archN
|
|
| 466 | + , opsysNameWithFlavor opsys (buildFlavor bc) ]
|
|
| 367 | 467 | , ["int_" ++ bignumString (bignumBackend bc) | bignumBackend bc /= Gmp]
|
| 368 | 468 | , ["unreg" | unregisterised bc ]
|
| 369 | 469 | , ["numa" | withNuma bc ]
|
| 370 | 470 | , ["zstd" | withZstd bc ]
|
| 371 | 471 | , ["no_tntc" | not (tablesNextToCode bc) ]
|
| 372 | - , ["cross_"++triple | Just triple <- pure $ crossTarget bc ]
|
|
| 472 | + , ["cross_"++renderTriple ct | Just ct <- pure $ crossTarget bc ]
|
|
| 373 | 473 | , [flavourString (mkJobFlavour bc)]
|
| 374 | 474 | ]
|
| 375 | 475 | |
| ... | ... | @@ -392,18 +492,18 @@ flavourString (Flavour base trans) = base_string base ++ concatMap (("+" ++) . f |
| 392 | 492 | flavour_string TextWithSIMDUTF = "text_simdutf"
|
| 393 | 493 | |
| 394 | 494 | -- The path to the docker image (just for linux builders)
|
| 395 | -dockerImage :: Arch -> Opsys -> Maybe String
|
|
| 396 | -dockerImage arch (Linux distro) =
|
|
| 495 | +dockerImage :: Arch -> Opsys -> BuildConfig -> Maybe String
|
|
| 496 | +dockerImage arch (Linux distro) bc =
|
|
| 397 | 497 | Just image
|
| 398 | 498 | where
|
| 399 | 499 | image = mconcat
|
| 400 | 500 | [ "registry.gitlab.haskell.org/ghc/ci-images/"
|
| 401 | 501 | , archName arch
|
| 402 | 502 | , "-linux-"
|
| 403 | - , distroName distro
|
|
| 503 | + , distroImageTag distro (buildFlavor bc)
|
|
| 404 | 504 | , ":$DOCKER_REV"
|
| 405 | 505 | ]
|
| 406 | -dockerImage _ _ = Nothing
|
|
| 506 | +dockerImage _ _ _ = Nothing
|
|
| 407 | 507 | |
| 408 | 508 | -----------------------------------------------------------------------------
|
| 409 | 509 | -- Platform-specific variables
|
| ... | ... | @@ -444,8 +544,8 @@ brokenTest :: TestName -- ^ test name |
| 444 | 544 | -> Variables
|
| 445 | 545 | brokenTest test _why = "BROKEN_TESTS" =: test
|
| 446 | 546 | |
| 447 | -opsysVariables :: Arch -> Opsys -> Variables
|
|
| 448 | -opsysVariables _ FreeBSD14 = mconcat
|
|
| 547 | +opsysVariables :: Arch -> Opsys -> ImageFlavor -> Variables
|
|
| 548 | +opsysVariables _ FreeBSD14 _ = mconcat
|
|
| 449 | 549 | [ -- N.B. we use iconv from ports as I see linker errors when we attempt
|
| 450 | 550 | -- to use the "native" iconv embedded in libc as suggested by the
|
| 451 | 551 | -- porting guide [1].
|
| ... | ... | @@ -459,8 +559,8 @@ opsysVariables _ FreeBSD14 = mconcat |
| 459 | 559 | , "FETCH_GHC_VERSION" =: "9.10.3"
|
| 460 | 560 | , "CABAL_INSTALL_VERSION" =: "3.14.2.0"
|
| 461 | 561 | ]
|
| 462 | -opsysVariables arch (Linux distro) = distroVariables arch distro
|
|
| 463 | -opsysVariables AArch64 (Darwin {}) = mconcat
|
|
| 562 | +opsysVariables arch (Linux distro) flavor = distroVariables arch distro flavor
|
|
| 563 | +opsysVariables AArch64 (Darwin {}) _ = mconcat
|
|
| 464 | 564 | [ "NIX_SYSTEM" =: "aarch64-darwin"
|
| 465 | 565 | , "MACOSX_DEPLOYMENT_TARGET" =: "11.0"
|
| 466 | 566 | , "LANG" =: "en_US.UTF-8"
|
| ... | ... | @@ -468,7 +568,7 @@ opsysVariables AArch64 (Darwin {}) = mconcat |
| 468 | 568 | -- Fonts can't be installed on darwin
|
| 469 | 569 | , "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs"
|
| 470 | 570 | ]
|
| 471 | -opsysVariables Amd64 (Darwin {}) = mconcat
|
|
| 571 | +opsysVariables Amd64 (Darwin {}) _ = mconcat
|
|
| 472 | 572 | [ "NIX_SYSTEM" =: "x86_64-darwin"
|
| 473 | 573 | , "MACOSX_DEPLOYMENT_TARGET" =: "11.0"
|
| 474 | 574 | -- Only Sierra and onwards supports clock_gettime. See #12858
|
| ... | ... | @@ -481,16 +581,15 @@ opsysVariables Amd64 (Darwin {}) = mconcat |
| 481 | 581 | , "CONFIGURE_ARGS" =: "--with-intree-gmp --with-system-libffi"
|
| 482 | 582 | -- Fonts can't be installed on darwin
|
| 483 | 583 | , "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs"
|
| 484 | - |
|
| 485 | 584 | ]
|
| 486 | -opsysVariables _ (Windows {}) = mconcat
|
|
| 585 | +opsysVariables _ (Windows {}) _ = mconcat
|
|
| 487 | 586 | [ "MSYSTEM" =: "CLANG64"
|
| 488 | 587 | , "LANG" =: "en_US.UTF-8"
|
| 489 | 588 | , "CABAL_INSTALL_VERSION" =: "3.14.2.0"
|
| 490 | 589 | , "HADRIAN_ARGS" =: "--docs=no-sphinx-pdfs"
|
| 491 | 590 | , "FETCH_GHC_VERSION" =: "9.10.3"
|
| 492 | 591 | ]
|
| 493 | -opsysVariables _ _ = mempty
|
|
| 592 | +opsysVariables _ _ _ = mempty
|
|
| 494 | 593 | |
| 495 | 594 | alpineVariables :: Arch -> Variables
|
| 496 | 595 | alpineVariables arch = mconcat $
|
| ... | ... | @@ -509,10 +608,13 @@ alpineVariables arch = mconcat $ |
| 509 | 608 | ]
|
| 510 | 609 | |
| 511 | 610 | |
| 512 | -distroVariables :: Arch -> LinuxDistro -> Variables
|
|
| 513 | -distroVariables arch Alpine312 = alpineVariables arch
|
|
| 514 | -distroVariables arch Alpine323 = alpineVariables arch
|
|
| 515 | -distroVariables _ _ = mempty
|
|
| 611 | +distroVariables :: Arch -> LinuxDistro -> ImageFlavor -> Variables
|
|
| 612 | +distroVariables arch Alpine312 _ = alpineVariables arch
|
|
| 613 | +-- The wasm image runs its own (libc-free) toolchain, so the alpine broken
|
|
| 614 | +-- tests do not apply to it.
|
|
| 615 | +distroVariables _ Alpine323 FlavorWasm = mempty
|
|
| 616 | +distroVariables arch Alpine323 _ = alpineVariables arch
|
|
| 617 | +distroVariables _ _ _ = mempty
|
|
| 516 | 618 | |
| 517 | 619 | -----------------------------------------------------------------------------
|
| 518 | 620 | -- Cache settings, what to cache and when can we share the cache
|
| ... | ... | @@ -524,8 +626,8 @@ data Cache |
| 524 | 626 | }
|
| 525 | 627 | |
| 526 | 628 | -- The cache doesn't depend on the BuildConfig because we only cache the cabal store.
|
| 527 | -mkCacheKey :: Arch -> Opsys -> String
|
|
| 528 | -mkCacheKey arch opsys = archName arch <> "-" <> opsysName opsys <> "-$CACHE_REV"
|
|
| 629 | +mkCacheKey :: Arch -> Opsys -> ImageFlavor -> String
|
|
| 630 | +mkCacheKey arch opsys flavor = archName arch <> "-" <> opsysNameWithFlavor opsys flavor <> "-$CACHE_REV"
|
|
| 529 | 631 | |
| 530 | 632 | instance ToJSON Cache where
|
| 531 | 633 | toJSON Cache {..} = object
|
| ... | ... | @@ -807,7 +909,7 @@ data Job |
| 807 | 909 | , jobArtifacts :: Artifacts
|
| 808 | 910 | , jobCache :: Cache
|
| 809 | 911 | , jobRules :: OnOffRules
|
| 810 | - , jobPlatform :: (Arch, Opsys)
|
|
| 912 | + , jobPlatform :: (Arch, Opsys, ImageFlavor)
|
|
| 811 | 913 | }
|
| 812 | 914 | |
| 813 | 915 | instance Show Job where
|
| ... | ... | @@ -837,7 +939,7 @@ instance ToJSON Job where |
| 837 | 939 | job :: Arch -> Opsys -> BuildConfig -> NamedJob Job
|
| 838 | 940 | job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} }
|
| 839 | 941 | where
|
| 840 | - jobPlatform = (arch, opsys)
|
|
| 942 | + jobPlatform = (arch, opsys, buildFlavor buildConfig)
|
|
| 841 | 943 | |
| 842 | 944 | jobRules = emptyRules jobName
|
| 843 | 945 | |
| ... | ... | @@ -845,14 +947,14 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} } |
| 845 | 947 | |
| 846 | 948 | jobTags = tags arch opsys buildConfig
|
| 847 | 949 | |
| 848 | - jobDockerImage = dockerImage arch opsys
|
|
| 950 | + jobDockerImage = dockerImage arch opsys buildConfig
|
|
| 849 | 951 | |
| 850 | 952 | jobScript
|
| 851 | 953 | | Windows <- opsys
|
| 852 | 954 | = [ "bash .gitlab/ci.sh setup"
|
| 853 | 955 | , "bash .gitlab/ci.sh configure"
|
| 854 | 956 | , "bash .gitlab/ci.sh build_hadrian"
|
| 855 | - , "bash .gitlab/ci.sh test_hadrian"
|
|
| 957 | + , "bash " ++ testStep
|
|
| 856 | 958 | ]
|
| 857 | 959 | | otherwise
|
| 858 | 960 | = [ "find libraries -name config.sub -exec cp config.sub {} \\;" | Darwin == opsys ] ++
|
| ... | ... | @@ -860,9 +962,16 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} } |
| 860 | 962 | [ ".gitlab/ci.sh setup"
|
| 861 | 963 | , ".gitlab/ci.sh configure"
|
| 862 | 964 | , ".gitlab/ci.sh build_hadrian"
|
| 863 | - , ".gitlab/ci.sh test_hadrian"
|
|
| 965 | + , testStep
|
|
| 864 | 966 | ]
|
| 865 | 967 | |
| 968 | + -- Cross jobs with a working emulator smoke-test the bindist under the
|
|
| 969 | + -- emulator as a separate step after the build; everything else runs the
|
|
| 970 | + -- testsuite.
|
|
| 971 | + testStep
|
|
| 972 | + | Emulator _ <- crossEmulator buildConfig = ".gitlab/ci.sh smoke_test"
|
|
| 973 | + | otherwise = ".gitlab/ci.sh test_hadrian"
|
|
| 974 | + |
|
| 866 | 975 | jobAfterScript
|
| 867 | 976 | | Windows <- opsys =
|
| 868 | 977 | [ "bash .gitlab/ci.sh save_cache"
|
| ... | ... | @@ -880,16 +989,20 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} } |
| 880 | 989 | |
| 881 | 990 | jobDependencies = []
|
| 882 | 991 | jobVariables = mconcat
|
| 883 | - [ opsysVariables arch opsys
|
|
| 992 | + [ opsysVariables arch opsys (buildFlavor buildConfig)
|
|
| 884 | 993 | , "TEST_ENV" =: testEnv arch opsys buildConfig
|
| 885 | 994 | , "BIN_DIST_NAME" =: binDistName arch opsys buildConfig
|
| 995 | + , maybe mempty ("BIN_DIST_NAME_STAGE3" =:) (stage3BinDistName opsys buildConfig)
|
|
| 886 | 996 | , "BUILD_FLAVOUR" =: flavourString jobFlavour
|
| 887 | 997 | , "BIGNUM_BACKEND" =: bignumString (bignumBackend buildConfig)
|
| 888 | 998 | , "CONFIGURE_ARGS" =: configureArgsStr buildConfig
|
| 889 | 999 | , "INSTALL_CONFIGURE_ARGS" =: "--enable-strict-ghc-toolchain-check"
|
| 890 | 1000 | , maybe mempty ("CONFIGURE_WRAPPER" =:) (configureWrapper buildConfig)
|
| 891 | - , maybe mempty ("CROSS_TARGET" =:) (crossTarget buildConfig)
|
|
| 892 | - , maybe mempty (("CROSS_STAGE" =:) . show) (crossStage buildConfig)
|
|
| 1001 | + , maybe mempty (("CROSS_TARGET" =:) . renderTriple) (crossTarget buildConfig)
|
|
| 1002 | + , case crossStages buildConfig of
|
|
| 1003 | + Nothing -> mempty
|
|
| 1004 | + Just Stage2 -> "FINAL_CROSS_STAGE" =: "2"
|
|
| 1005 | + Just Stage2And3 -> "FINAL_CROSS_STAGE" =: "3"
|
|
| 893 | 1006 | , case crossEmulator buildConfig of
|
| 894 | 1007 | NoEmulator
|
| 895 | 1008 | -- we need an emulator but it isn't set. Won't run the testsuite
|
| ... | ... | @@ -922,6 +1035,8 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} } |
| 922 | 1035 | trim :: String -> String
|
| 923 | 1036 | trim = dropWhileEnd isSpace . dropWhile isSpace
|
| 924 | 1037 | |
| 1038 | + stage3Artifacts = maybe [] (\n -> [n ++ ".tar.xz"]) (stage3BinDistName opsys buildConfig)
|
|
| 1039 | + |
|
| 925 | 1040 | -- Keep in sync with the exclude list in `function clean()` in
|
| 926 | 1041 | -- `.gitlab/ci.sh`!
|
| 927 | 1042 | jobArtifacts = Artifacts
|
| ... | ... | @@ -930,6 +1045,7 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} } |
| 930 | 1045 | , artifactPaths = [binDistName arch opsys buildConfig ++ ".tar.xz"
|
| 931 | 1046 | ,"junit.xml"
|
| 932 | 1047 | ,"unexpected-test-output.tar.gz"]
|
| 1048 | + ++ stage3Artifacts
|
|
| 933 | 1049 | , artifactsWhen = ArtifactsAlways
|
| 934 | 1050 | }
|
| 935 | 1051 | |
| ... | ... | @@ -940,7 +1056,7 @@ job arch opsys buildConfig = NamedJob { name = jobName, jobInfo = Job {..} } |
| 940 | 1056 | Cache { cachePaths = [], cacheKey = "no-caching" }
|
| 941 | 1057 | | otherwise = Cache
|
| 942 | 1058 | { cachePaths = [ "cabal-cache", "toolchain" ]
|
| 943 | - , cacheKey = mkCacheKey arch opsys
|
|
| 1059 | + , cacheKey = mkCacheKey arch opsys (buildFlavor buildConfig)
|
|
| 944 | 1060 | |
| 945 | 1061 | }
|
| 946 | 1062 | |
| ... | ... | @@ -1163,7 +1279,6 @@ debian_x86 = |
| 1163 | 1279 | , disableValidate (standardBuilds Amd64 (Linux Debian12))
|
| 1164 | 1280 | , disableValidate (standardBuilds Amd64 (Linux Debian13))
|
| 1165 | 1281 | |
| 1166 | - |
|
| 1167 | 1282 | -- Validate only builds
|
| 1168 | 1283 | , fastCI (validateBuilds Amd64 (Linux validate_debian) debug)
|
| 1169 | 1284 | , validateBuilds Amd64 (Linux validate_debian) nativeInt
|
| ... | ... | @@ -1288,16 +1403,17 @@ alpine_aarch64 = [ |
| 1288 | 1403 | cross_jobs :: [JobGroup Job]
|
| 1289 | 1404 | cross_jobs = [
|
| 1290 | 1405 | -- x86 -> aarch64
|
| 1291 | - validateBuilds Amd64 (Linux Debian13) (crossConfig "aarch64-linux-gnu" (Emulator "qemu-aarch64 -L /usr/aarch64-linux-gnu") Nothing)
|
|
| 1406 | + validateBuilds Amd64 (Linux Debian13) (crossConfig (TargetPlatform AArch64 TargetOsLinuxGnu) (Emulator "qemu-aarch64 -L /usr/aarch64-linux-gnu") Nothing Stage2)
|
|
| 1292 | 1407 | |
| 1293 | - -- x86_64 -> riscv
|
|
| 1294 | - , addValidateRule RiscV (validateBuilds Amd64 (Linux Debian13Riscv) (crossConfig "riscv64-linux-gnu" (Emulator "qemu-riscv64 -L /usr/riscv64-linux-gnu") Nothing))
|
|
| 1408 | + -- Stage2: x86_64 (build/host) -> riscv64 (target)
|
|
| 1409 | + -- Stage3: x86_64 (build) -> riscv64 (host/target)
|
|
| 1410 | + , addValidateRule RiscV (validateBuilds Amd64 (Linux Debian13) (crossConfig (TargetPlatform RiscV64 TargetOsLinuxGnu) (Emulator "qemu-riscv64 -L /usr/riscv64-linux-gnu") Nothing Stage2And3))
|
|
| 1295 | 1411 | |
| 1296 | 1412 | -- x86_64 -> loongarch64
|
| 1297 | - , addValidateRule LoongArch64 (validateBuilds Amd64 (Linux Ubuntu2404LoongArch64) (crossConfig "loongarch64-linux-gnu" (Emulator "qemu-loongarch64 -L /usr/loongarch64-linux-gnu") Nothing))
|
|
| 1413 | + , addValidateRule LoongArch64 (validateBuilds Amd64 (Linux Ubuntu2404) (crossConfig (TargetPlatform LoongArch TargetOsLinuxGnu) (Emulator "qemu-loongarch64 -L /usr/loongarch64-linux-gnu") Nothing Stage2))
|
|
| 1298 | 1414 | |
| 1299 | 1415 | -- Javascript
|
| 1300 | - , addValidateRule JSBackend (validateBuilds Amd64 (Linux Debian11Js) javascriptConfig)
|
|
| 1416 | + , addValidateRule JSBackend (validateBuilds Amd64 (Linux Debian11) javascriptConfig)
|
|
| 1301 | 1417 | |
| 1302 | 1418 | -- Wasm
|
| 1303 | 1419 | , make_wasm_jobs wasm_build_config
|
| ... | ... | @@ -1309,13 +1425,13 @@ cross_jobs = [ |
| 1309 | 1425 | -- Linux Aarch64 (Wine + FEX + MSYS64) => Windows Aarch64
|
| 1310 | 1426 | , makeWinArmJobs
|
| 1311 | 1427 | $ addValidateRule WinArm64
|
| 1312 | - (validateBuilds AArch64 (Linux Debian12Wine) winAarch64Config)
|
|
| 1428 | + (validateBuilds AArch64 (Linux Debian12) winAarch64Config)
|
|
| 1313 | 1429 | , makeWinArmJobs
|
| 1314 | 1430 | $ addValidateRule WinArm64LLVM
|
| 1315 | - (validateBuilds AArch64 (Linux Debian12Wine) (winAarch64Config {llvmBootstrap = True}))
|
|
| 1431 | + (validateBuilds AArch64 (Linux Debian12) (winAarch64Config {llvmBootstrap = True}))
|
|
| 1316 | 1432 | ]
|
| 1317 | 1433 | where
|
| 1318 | - javascriptConfig = (crossConfig "javascript-unknown-ghcjs" (NoEmulatorNeeded TimeoutIncrease) (Just "emconfigure"))
|
|
| 1434 | + javascriptConfig = (crossConfig (TargetPlatform JavaScript TargetOsGhcjs) (NoEmulatorNeeded TimeoutIncrease) (Just "emconfigure") Stage2)
|
|
| 1319 | 1435 | { bignumBackend = Native }
|
| 1320 | 1436 | |
| 1321 | 1437 | makeWinArmJobs = modifyJobs
|
| ... | ... | @@ -1354,7 +1470,7 @@ cross_jobs = [ |
| 1354 | 1470 | llvm_prefix = "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-"
|
| 1355 | 1471 | cflags = "-fuse-ld=" ++ llvm_prefix ++ "ld --rtlib=compiler-rt"
|
| 1356 | 1472 | |
| 1357 | - winAarch64Config = (crossConfig "aarch64-unknown-mingw32" (Emulator "/opt/wine-arm64ec-msys2-deb12/bin/wine") Nothing)
|
|
| 1473 | + winAarch64Config = (crossConfig (TargetPlatform AArch64 TargetOsMingw32) (Emulator "/opt/wine-arm64ec-msys2-deb12/bin/wine") Nothing Stage2)
|
|
| 1358 | 1474 | { bignumBackend = Native }
|
| 1359 | 1475 | |
| 1360 | 1476 | make_wasm_jobs cfg =
|
| ... | ... | @@ -1364,10 +1480,10 @@ cross_jobs = [ |
| 1364 | 1480 | . setVariable "HADRIAN_ARGS" "--docs=no-sphinx-pdfs --docs=no-sphinx-man"
|
| 1365 | 1481 | . delVariable "INSTALL_CONFIGURE_ARGS"
|
| 1366 | 1482 | )
|
| 1367 | - $ addValidateRule WasmBackend $ validateBuilds Amd64 (Linux AlpineWasm) cfg
|
|
| 1483 | + $ addValidateRule WasmBackend $ validateBuilds Amd64 (Linux Alpine323) cfg
|
|
| 1368 | 1484 | |
| 1369 | 1485 | wasm_build_config =
|
| 1370 | - (crossConfig "wasm32-wasi" (NoEmulatorNeeded NoTimeoutIncrease) Nothing)
|
|
| 1486 | + (crossConfig (TargetPlatform Wasm32 TargetOsWasi) (NoEmulatorNeeded NoTimeoutIncrease) Nothing Stage2)
|
|
| 1371 | 1487 | { hostFullyStatic = True
|
| 1372 | 1488 | , buildFlavour = Release -- TODO: This needs to be validate but wasm backend doesn't pass yet
|
| 1373 | 1489 | , textWithSIMDUTF = True
|
| ... | ... | @@ -1392,8 +1508,8 @@ job_groups = |
| 1392 | 1508 | -- Platform mapping for GHCup metadata
|
| 1393 | 1509 | ---------------------------------------------------------------------
|
| 1394 | 1510 | |
| 1395 | -mkPlatform :: Arch -> Opsys -> String
|
|
| 1396 | -mkPlatform arch opsys = archName arch <> "-" <> opsysName opsys
|
|
| 1511 | +mkPlatform :: (Arch, Opsys, ImageFlavor) -> String
|
|
| 1512 | +mkPlatform (arch, opsys, flavor) = archName arch <> "-" <> opsysNameWithFlavor opsys flavor
|
|
| 1397 | 1513 | |
| 1398 | 1514 | -- | This map tells us for a specific arch/opsys combo what the job name for
|
| 1399 | 1515 | -- nightly/release pipelines is. This is used by the ghcup metadata generation so that
|
| ... | ... | @@ -1438,7 +1554,7 @@ platform_mapping = Map.map go combined_result |
| 1438 | 1554 | |
| 1439 | 1555 | process sel =
|
| 1440 | 1556 | Map.fromListWith combine
|
| 1441 | - [ (uncurry mkPlatform (jobPlatform (jobInfo j)), j)
|
|
| 1557 | + [ (mkPlatform (jobPlatform (jobInfo j)), j)
|
|
| 1442 | 1558 | | (sel -> Just j) <- job_groups
|
| 1443 | 1559 | ]
|
| 1444 | 1560 |
| ... | ... | @@ -303,7 +303,7 @@ |
| 303 | 303 | ".gitlab/ci.sh setup",
|
| 304 | 304 | ".gitlab/ci.sh configure",
|
| 305 | 305 | ".gitlab/ci.sh build_hadrian",
|
| 306 | - ".gitlab/ci.sh test_hadrian"
|
|
| 306 | + ".gitlab/ci.sh smoke_test"
|
|
| 307 | 307 | ],
|
| 308 | 308 | "stage": "full-build",
|
| 309 | 309 | "tags": [
|
| ... | ... | @@ -319,9 +319,9 @@ |
| 319 | 319 | "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
|
| 320 | 320 | "CONF_CC_OPTS_STAGE2": "-fuse-ld=/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-ld --rtlib=compiler-rt",
|
| 321 | 321 | "CROSS_EMULATOR": "/opt/wine-arm64ec-msys2-deb12/bin/wine",
|
| 322 | - "CROSS_STAGE": "2",
|
|
| 323 | 322 | "CROSS_TARGET": "aarch64-unknown-mingw32",
|
| 324 | 323 | "CXX": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-clang++",
|
| 324 | + "FINAL_CROSS_STAGE": "2",
|
|
| 325 | 325 | "HADRIAN_ARGS": "--docs=none",
|
| 326 | 326 | "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
|
| 327 | 327 | "LD": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-ld",
|
| ... | ... | @@ -387,7 +387,7 @@ |
| 387 | 387 | ".gitlab/ci.sh setup",
|
| 388 | 388 | ".gitlab/ci.sh configure",
|
| 389 | 389 | ".gitlab/ci.sh build_hadrian",
|
| 390 | - ".gitlab/ci.sh test_hadrian"
|
|
| 390 | + ".gitlab/ci.sh smoke_test"
|
|
| 391 | 391 | ],
|
| 392 | 392 | "stage": "full-build",
|
| 393 | 393 | "tags": [
|
| ... | ... | @@ -403,9 +403,9 @@ |
| 403 | 403 | "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
|
| 404 | 404 | "CONF_CC_OPTS_STAGE2": "-fuse-ld=/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-ld --rtlib=compiler-rt",
|
| 405 | 405 | "CROSS_EMULATOR": "/opt/wine-arm64ec-msys2-deb12/bin/wine",
|
| 406 | - "CROSS_STAGE": "2",
|
|
| 407 | 406 | "CROSS_TARGET": "aarch64-unknown-mingw32",
|
| 408 | 407 | "CXX": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-clang++",
|
| 408 | + "FINAL_CROSS_STAGE": "2",
|
|
| 409 | 409 | "HADRIAN_ARGS": "--docs=none",
|
| 410 | 410 | "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
|
| 411 | 411 | "LD": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-ld",
|
| ... | ... | @@ -1111,7 +1111,7 @@ |
| 1111 | 1111 | ".gitlab/ci.sh setup",
|
| 1112 | 1112 | ".gitlab/ci.sh configure",
|
| 1113 | 1113 | ".gitlab/ci.sh build_hadrian",
|
| 1114 | - ".gitlab/ci.sh test_hadrian"
|
|
| 1114 | + ".gitlab/ci.sh smoke_test"
|
|
| 1115 | 1115 | ],
|
| 1116 | 1116 | "stage": "full-build",
|
| 1117 | 1117 | "tags": [
|
| ... | ... | @@ -1127,9 +1127,9 @@ |
| 1127 | 1127 | "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
|
| 1128 | 1128 | "CONF_CC_OPTS_STAGE2": "-fuse-ld=/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-ld --rtlib=compiler-rt",
|
| 1129 | 1129 | "CROSS_EMULATOR": "/opt/wine-arm64ec-msys2-deb12/bin/wine",
|
| 1130 | - "CROSS_STAGE": "2",
|
|
| 1131 | 1130 | "CROSS_TARGET": "aarch64-unknown-mingw32",
|
| 1132 | 1131 | "CXX": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-clang++",
|
| 1132 | + "FINAL_CROSS_STAGE": "2",
|
|
| 1133 | 1133 | "HADRIAN_ARGS": "--docs=none",
|
| 1134 | 1134 | "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
|
| 1135 | 1135 | "LD": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-ld",
|
| ... | ... | @@ -1196,7 +1196,7 @@ |
| 1196 | 1196 | ".gitlab/ci.sh setup",
|
| 1197 | 1197 | ".gitlab/ci.sh configure",
|
| 1198 | 1198 | ".gitlab/ci.sh build_hadrian",
|
| 1199 | - ".gitlab/ci.sh test_hadrian"
|
|
| 1199 | + ".gitlab/ci.sh smoke_test"
|
|
| 1200 | 1200 | ],
|
| 1201 | 1201 | "stage": "full-build",
|
| 1202 | 1202 | "tags": [
|
| ... | ... | @@ -1212,9 +1212,9 @@ |
| 1212 | 1212 | "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
|
| 1213 | 1213 | "CONF_CC_OPTS_STAGE2": "-fuse-ld=/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-ld --rtlib=compiler-rt",
|
| 1214 | 1214 | "CROSS_EMULATOR": "/opt/wine-arm64ec-msys2-deb12/bin/wine",
|
| 1215 | - "CROSS_STAGE": "2",
|
|
| 1216 | 1215 | "CROSS_TARGET": "aarch64-unknown-mingw32",
|
| 1217 | 1216 | "CXX": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-clang++",
|
| 1217 | + "FINAL_CROSS_STAGE": "2",
|
|
| 1218 | 1218 | "HADRIAN_ARGS": "--docs=none",
|
| 1219 | 1219 | "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
|
| 1220 | 1220 | "LD": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-ld",
|
| ... | ... | @@ -2010,8 +2010,8 @@ |
| 2010 | 2010 | "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_23-wasm-cross_wasm32-wasi-release+host_fully_static+text_simdutf",
|
| 2011 | 2011 | "BUILD_FLAVOUR": "release+host_fully_static+text_simdutf",
|
| 2012 | 2012 | "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check",
|
| 2013 | - "CROSS_STAGE": "2",
|
|
| 2014 | 2013 | "CROSS_TARGET": "wasm32-wasi",
|
| 2014 | + "FINAL_CROSS_STAGE": "2",
|
|
| 2015 | 2015 | "FIREFOX_LAUNCH_OPTS": "{\"browser\":\"firefox\",\"executablePath\":\"/usr/bin/firefox\"}",
|
| 2016 | 2016 | "HADRIAN_ARGS": "--docs=no-sphinx-pdfs --docs=no-sphinx-man",
|
| 2017 | 2017 | "RUNTEST_ARGS": "",
|
| ... | ... | @@ -2077,8 +2077,8 @@ |
| 2077 | 2077 | "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_23-wasm-int_native-cross_wasm32-wasi-release+host_fully_static+text_simdutf",
|
| 2078 | 2078 | "BUILD_FLAVOUR": "release+host_fully_static+text_simdutf",
|
| 2079 | 2079 | "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check",
|
| 2080 | - "CROSS_STAGE": "2",
|
|
| 2081 | 2080 | "CROSS_TARGET": "wasm32-wasi",
|
| 2081 | + "FINAL_CROSS_STAGE": "2",
|
|
| 2082 | 2082 | "FIREFOX_LAUNCH_OPTS": "{\"browser\":\"firefox\",\"executablePath\":\"/usr/bin/firefox\"}",
|
| 2083 | 2083 | "HADRIAN_ARGS": "--docs=no-sphinx-pdfs --docs=no-sphinx-man",
|
| 2084 | 2084 | "RUNTEST_ARGS": "",
|
| ... | ... | @@ -2144,8 +2144,8 @@ |
| 2144 | 2144 | "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_23-wasm-unreg-cross_wasm32-wasi-release+host_fully_static+text_simdutf",
|
| 2145 | 2145 | "BUILD_FLAVOUR": "release+host_fully_static+text_simdutf",
|
| 2146 | 2146 | "CONFIGURE_ARGS": "--enable-unregisterised --with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check",
|
| 2147 | - "CROSS_STAGE": "2",
|
|
| 2148 | 2147 | "CROSS_TARGET": "wasm32-wasi",
|
| 2148 | + "FINAL_CROSS_STAGE": "2",
|
|
| 2149 | 2149 | "FIREFOX_LAUNCH_OPTS": "{\"browser\":\"firefox\",\"executablePath\":\"/usr/bin/firefox\"}",
|
| 2150 | 2150 | "HADRIAN_ARGS": "--docs=no-sphinx-pdfs --docs=no-sphinx-man",
|
| 2151 | 2151 | "RUNTEST_ARGS": "",
|
| ... | ... | @@ -2212,8 +2212,8 @@ |
| 2212 | 2212 | "BUILD_FLAVOUR": "validate",
|
| 2213 | 2213 | "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
|
| 2214 | 2214 | "CONFIGURE_WRAPPER": "emconfigure",
|
| 2215 | - "CROSS_STAGE": "2",
|
|
| 2216 | 2215 | "CROSS_TARGET": "javascript-unknown-ghcjs",
|
| 2216 | + "FINAL_CROSS_STAGE": "2",
|
|
| 2217 | 2217 | "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
|
| 2218 | 2218 | "RUNTEST_ARGS": "-e config.timeout=900",
|
| 2219 | 2219 | "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate",
|
| ... | ... | @@ -2459,7 +2459,7 @@ |
| 2459 | 2459 | ".gitlab/ci.sh setup",
|
| 2460 | 2460 | ".gitlab/ci.sh configure",
|
| 2461 | 2461 | ".gitlab/ci.sh build_hadrian",
|
| 2462 | - ".gitlab/ci.sh test_hadrian"
|
|
| 2462 | + ".gitlab/ci.sh smoke_test"
|
|
| 2463 | 2463 | ],
|
| 2464 | 2464 | "stage": "full-build",
|
| 2465 | 2465 | "tags": [
|
| ... | ... | @@ -2471,8 +2471,8 @@ |
| 2471 | 2471 | "BUILD_FLAVOUR": "validate",
|
| 2472 | 2472 | "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
|
| 2473 | 2473 | "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu",
|
| 2474 | - "CROSS_STAGE": "2",
|
|
| 2475 | 2474 | "CROSS_TARGET": "aarch64-linux-gnu",
|
| 2475 | + "FINAL_CROSS_STAGE": "2",
|
|
| 2476 | 2476 | "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
|
| 2477 | 2477 | "RUNTEST_ARGS": "-e config.timeout=900",
|
| 2478 | 2478 | "TEST_ENV": "x86_64-linux-deb13-cross_aarch64-linux-gnu-validate",
|
| ... | ... | @@ -2750,7 +2750,8 @@ |
| 2750 | 2750 | "paths": [
|
| 2751 | 2751 | "ghc-x86_64-linux-deb13-riscv-cross_riscv64-linux-gnu-validate.tar.xz",
|
| 2752 | 2752 | "junit.xml",
|
| 2753 | - "unexpected-test-output.tar.gz"
|
|
| 2753 | + "unexpected-test-output.tar.gz",
|
|
| 2754 | + "ghc-riscv64-linux-deb13-validate.tar.xz"
|
|
| 2754 | 2755 | ],
|
| 2755 | 2756 | "reports": {
|
| 2756 | 2757 | "junit": "junit.xml"
|
| ... | ... | @@ -2783,7 +2784,7 @@ |
| 2783 | 2784 | ".gitlab/ci.sh setup",
|
| 2784 | 2785 | ".gitlab/ci.sh configure",
|
| 2785 | 2786 | ".gitlab/ci.sh build_hadrian",
|
| 2786 | - ".gitlab/ci.sh test_hadrian"
|
|
| 2787 | + ".gitlab/ci.sh smoke_test"
|
|
| 2787 | 2788 | ],
|
| 2788 | 2789 | "stage": "full-build",
|
| 2789 | 2790 | "tags": [
|
| ... | ... | @@ -2792,11 +2793,12 @@ |
| 2792 | 2793 | "variables": {
|
| 2793 | 2794 | "BIGNUM_BACKEND": "gmp",
|
| 2794 | 2795 | "BIN_DIST_NAME": "ghc-x86_64-linux-deb13-riscv-cross_riscv64-linux-gnu-validate",
|
| 2796 | + "BIN_DIST_NAME_STAGE3": "ghc-riscv64-linux-deb13-validate",
|
|
| 2795 | 2797 | "BUILD_FLAVOUR": "validate",
|
| 2796 | 2798 | "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
|
| 2797 | 2799 | "CROSS_EMULATOR": "qemu-riscv64 -L /usr/riscv64-linux-gnu",
|
| 2798 | - "CROSS_STAGE": "2",
|
|
| 2799 | 2800 | "CROSS_TARGET": "riscv64-linux-gnu",
|
| 2801 | + "FINAL_CROSS_STAGE": "3",
|
|
| 2800 | 2802 | "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
|
| 2801 | 2803 | "RUNTEST_ARGS": "-e config.timeout=900",
|
| 2802 | 2804 | "TEST_ENV": "x86_64-linux-deb13-riscv-cross_riscv64-linux-gnu-validate",
|
| ... | ... | @@ -3687,7 +3689,7 @@ |
| 3687 | 3689 | ".gitlab/ci.sh setup",
|
| 3688 | 3690 | ".gitlab/ci.sh configure",
|
| 3689 | 3691 | ".gitlab/ci.sh build_hadrian",
|
| 3690 | - ".gitlab/ci.sh test_hadrian"
|
|
| 3692 | + ".gitlab/ci.sh smoke_test"
|
|
| 3691 | 3693 | ],
|
| 3692 | 3694 | "stage": "full-build",
|
| 3693 | 3695 | "tags": [
|
| ... | ... | @@ -3699,8 +3701,8 @@ |
| 3699 | 3701 | "BUILD_FLAVOUR": "validate",
|
| 3700 | 3702 | "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
|
| 3701 | 3703 | "CROSS_EMULATOR": "qemu-loongarch64 -L /usr/loongarch64-linux-gnu",
|
| 3702 | - "CROSS_STAGE": "2",
|
|
| 3703 | 3704 | "CROSS_TARGET": "loongarch64-linux-gnu",
|
| 3705 | + "FINAL_CROSS_STAGE": "2",
|
|
| 3704 | 3706 | "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
|
| 3705 | 3707 | "RUNTEST_ARGS": "-e config.timeout=900",
|
| 3706 | 3708 | "TEST_ENV": "x86_64-linux-ubuntu24_04-loongarch-cross_loongarch64-linux-gnu-validate",
|
| ... | ... | @@ -5995,8 +5997,8 @@ |
| 5995 | 5997 | "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_23-wasm-cross_wasm32-wasi-release+host_fully_static+text_simdutf",
|
| 5996 | 5998 | "BUILD_FLAVOUR": "release+host_fully_static+text_simdutf",
|
| 5997 | 5999 | "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check",
|
| 5998 | - "CROSS_STAGE": "2",
|
|
| 5999 | 6000 | "CROSS_TARGET": "wasm32-wasi",
|
| 6001 | + "FINAL_CROSS_STAGE": "2",
|
|
| 6000 | 6002 | "FIREFOX_LAUNCH_OPTS": "{\"browser\":\"firefox\",\"executablePath\":\"/usr/bin/firefox\"}",
|
| 6001 | 6003 | "HADRIAN_ARGS": "--docs=no-sphinx-pdfs --docs=no-sphinx-man",
|
| 6002 | 6004 | "RUNTEST_ARGS": "",
|
| ... | ... | @@ -6062,8 +6064,8 @@ |
| 6062 | 6064 | "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_23-wasm-int_native-cross_wasm32-wasi-release+host_fully_static+text_simdutf",
|
| 6063 | 6065 | "BUILD_FLAVOUR": "release+host_fully_static+text_simdutf",
|
| 6064 | 6066 | "CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check",
|
| 6065 | - "CROSS_STAGE": "2",
|
|
| 6066 | 6067 | "CROSS_TARGET": "wasm32-wasi",
|
| 6068 | + "FINAL_CROSS_STAGE": "2",
|
|
| 6067 | 6069 | "FIREFOX_LAUNCH_OPTS": "{\"browser\":\"firefox\",\"executablePath\":\"/usr/bin/firefox\"}",
|
| 6068 | 6070 | "HADRIAN_ARGS": "--docs=no-sphinx-pdfs --docs=no-sphinx-man",
|
| 6069 | 6071 | "RUNTEST_ARGS": "",
|
| ... | ... | @@ -6129,8 +6131,8 @@ |
| 6129 | 6131 | "BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_23-wasm-unreg-cross_wasm32-wasi-release+host_fully_static+text_simdutf",
|
| 6130 | 6132 | "BUILD_FLAVOUR": "release+host_fully_static+text_simdutf",
|
| 6131 | 6133 | "CONFIGURE_ARGS": "--enable-unregisterised --with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check",
|
| 6132 | - "CROSS_STAGE": "2",
|
|
| 6133 | 6134 | "CROSS_TARGET": "wasm32-wasi",
|
| 6135 | + "FINAL_CROSS_STAGE": "2",
|
|
| 6134 | 6136 | "FIREFOX_LAUNCH_OPTS": "{\"browser\":\"firefox\",\"executablePath\":\"/usr/bin/firefox\"}",
|
| 6135 | 6137 | "HADRIAN_ARGS": "--docs=no-sphinx-pdfs --docs=no-sphinx-man",
|
| 6136 | 6138 | "RUNTEST_ARGS": "",
|
| ... | ... | @@ -6196,8 +6198,8 @@ |
| 6196 | 6198 | "BUILD_FLAVOUR": "validate",
|
| 6197 | 6199 | "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
|
| 6198 | 6200 | "CONFIGURE_WRAPPER": "emconfigure",
|
| 6199 | - "CROSS_STAGE": "2",
|
|
| 6200 | 6201 | "CROSS_TARGET": "javascript-unknown-ghcjs",
|
| 6202 | + "FINAL_CROSS_STAGE": "2",
|
|
| 6201 | 6203 | "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
|
| 6202 | 6204 | "RUNTEST_ARGS": "-e config.timeout=900",
|
| 6203 | 6205 | "TEST_ENV": "x86_64-linux-deb11-emsdk-closure-int_native-cross_javascript-unknown-ghcjs-validate",
|
| ... | ... | @@ -6439,7 +6441,7 @@ |
| 6439 | 6441 | ".gitlab/ci.sh setup",
|
| 6440 | 6442 | ".gitlab/ci.sh configure",
|
| 6441 | 6443 | ".gitlab/ci.sh build_hadrian",
|
| 6442 | - ".gitlab/ci.sh test_hadrian"
|
|
| 6444 | + ".gitlab/ci.sh smoke_test"
|
|
| 6443 | 6445 | ],
|
| 6444 | 6446 | "stage": "full-build",
|
| 6445 | 6447 | "tags": [
|
| ... | ... | @@ -6451,8 +6453,8 @@ |
| 6451 | 6453 | "BUILD_FLAVOUR": "validate",
|
| 6452 | 6454 | "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
|
| 6453 | 6455 | "CROSS_EMULATOR": "qemu-aarch64 -L /usr/aarch64-linux-gnu",
|
| 6454 | - "CROSS_STAGE": "2",
|
|
| 6455 | 6456 | "CROSS_TARGET": "aarch64-linux-gnu",
|
| 6457 | + "FINAL_CROSS_STAGE": "2",
|
|
| 6456 | 6458 | "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
|
| 6457 | 6459 | "RUNTEST_ARGS": "-e config.timeout=900",
|
| 6458 | 6460 | "TEST_ENV": "x86_64-linux-deb13-cross_aarch64-linux-gnu-validate",
|
| ... | ... | @@ -6726,7 +6728,8 @@ |
| 6726 | 6728 | "paths": [
|
| 6727 | 6729 | "ghc-x86_64-linux-deb13-riscv-cross_riscv64-linux-gnu-validate.tar.xz",
|
| 6728 | 6730 | "junit.xml",
|
| 6729 | - "unexpected-test-output.tar.gz"
|
|
| 6731 | + "unexpected-test-output.tar.gz",
|
|
| 6732 | + "ghc-riscv64-linux-deb13-validate.tar.xz"
|
|
| 6730 | 6733 | ],
|
| 6731 | 6734 | "reports": {
|
| 6732 | 6735 | "junit": "junit.xml"
|
| ... | ... | @@ -6759,7 +6762,7 @@ |
| 6759 | 6762 | ".gitlab/ci.sh setup",
|
| 6760 | 6763 | ".gitlab/ci.sh configure",
|
| 6761 | 6764 | ".gitlab/ci.sh build_hadrian",
|
| 6762 | - ".gitlab/ci.sh test_hadrian"
|
|
| 6765 | + ".gitlab/ci.sh smoke_test"
|
|
| 6763 | 6766 | ],
|
| 6764 | 6767 | "stage": "full-build",
|
| 6765 | 6768 | "tags": [
|
| ... | ... | @@ -6768,11 +6771,12 @@ |
| 6768 | 6771 | "variables": {
|
| 6769 | 6772 | "BIGNUM_BACKEND": "gmp",
|
| 6770 | 6773 | "BIN_DIST_NAME": "ghc-x86_64-linux-deb13-riscv-cross_riscv64-linux-gnu-validate",
|
| 6774 | + "BIN_DIST_NAME_STAGE3": "ghc-riscv64-linux-deb13-validate",
|
|
| 6771 | 6775 | "BUILD_FLAVOUR": "validate",
|
| 6772 | 6776 | "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
|
| 6773 | 6777 | "CROSS_EMULATOR": "qemu-riscv64 -L /usr/riscv64-linux-gnu",
|
| 6774 | - "CROSS_STAGE": "2",
|
|
| 6775 | 6778 | "CROSS_TARGET": "riscv64-linux-gnu",
|
| 6779 | + "FINAL_CROSS_STAGE": "3",
|
|
| 6776 | 6780 | "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
|
| 6777 | 6781 | "RUNTEST_ARGS": "-e config.timeout=900",
|
| 6778 | 6782 | "TEST_ENV": "x86_64-linux-deb13-riscv-cross_riscv64-linux-gnu-validate",
|
| ... | ... | @@ -7650,7 +7654,7 @@ |
| 7650 | 7654 | ".gitlab/ci.sh setup",
|
| 7651 | 7655 | ".gitlab/ci.sh configure",
|
| 7652 | 7656 | ".gitlab/ci.sh build_hadrian",
|
| 7653 | - ".gitlab/ci.sh test_hadrian"
|
|
| 7657 | + ".gitlab/ci.sh smoke_test"
|
|
| 7654 | 7658 | ],
|
| 7655 | 7659 | "stage": "full-build",
|
| 7656 | 7660 | "tags": [
|
| ... | ... | @@ -7662,8 +7666,8 @@ |
| 7662 | 7666 | "BUILD_FLAVOUR": "validate",
|
| 7663 | 7667 | "CONFIGURE_ARGS": "--with-intree-gmp --enable-strict-ghc-toolchain-check",
|
| 7664 | 7668 | "CROSS_EMULATOR": "qemu-loongarch64 -L /usr/loongarch64-linux-gnu",
|
| 7665 | - "CROSS_STAGE": "2",
|
|
| 7666 | 7669 | "CROSS_TARGET": "loongarch64-linux-gnu",
|
| 7670 | + "FINAL_CROSS_STAGE": "2",
|
|
| 7667 | 7671 | "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
|
| 7668 | 7672 | "RUNTEST_ARGS": "-e config.timeout=900",
|
| 7669 | 7673 | "TEST_ENV": "x86_64-linux-ubuntu24_04-loongarch-cross_loongarch64-linux-gnu-validate",
|
| ... | ... | @@ -70,6 +70,13 @@ These are the steps to build a bindist: |
| 70 | 70 | to
|
| 71 | 71 | <build root>/<bindist-dir>/ghc-<X>.<Y>.<Z>-<arch>-<os>/lib
|
| 72 | 72 | |
| 73 | +- for cross-compilers, overwrite the implicitly copied (previous step)
|
|
| 74 | + <build root>/<library-stage-dir>/lib/targets/default.target file with that of
|
|
| 75 | + the executable stage. I.e. copy:
|
|
| 76 | + <build root>/<executable-stage-dir>/lib/targets/default.target
|
|
| 77 | + to
|
|
| 78 | + <build root>/<bindist-dir>/ghc-<X>.<Y>.<Z>-<arch>-<os>/lib/targets/default.target
|
|
| 79 | + |
|
| 73 | 80 | - copy the generated docs (user guide, haddocks, etc):
|
| 74 | 81 | <build root>/doc/
|
| 75 | 82 | to
|
| ... | ... | @@ -248,6 +255,13 @@ buildBinDistDir root conf@BindistConfig{..} = do |
| 248 | 255 | |
| 249 | 256 | copyDirectory (ghcBuildDir -/- "lib") bindistFilesDir
|
| 250 | 257 | |
| 258 | + -- For cross-compilers we need to override the `targets/default.target`
|
|
| 259 | + -- file that was implicitly copied from the library stage, because this
|
|
| 260 | + -- describes a target native compiler (stage3) and not a cross-compiler.
|
|
| 261 | + when (library_stage /= executable_stage) $
|
|
| 262 | + copyFile (root -/- stageString executable_stage -/- "lib" -/- "targets" -/- "default.target")
|
|
| 263 | + (bindistFilesDir -/- "lib" -/- "targets" -/- "default.target")
|
|
| 264 | + |
|
| 251 | 265 | -- Regenerate settings file without LibDir. For bindists, LibDir should
|
| 252 | 266 | -- be derived from topdir at runtime such that the GHC binary is
|
| 253 | 267 | -- relocatable. The package DB is always at "package.conf.d" relative to
|
| ... | ... | @@ -255,11 +255,14 @@ generateRules = do |
| 255 | 255 | prefix = root -/- stageString compilerStage -/- "lib"
|
| 256 | 256 | go gen file = generate file (semiEmptyTarget compilerStage) gen
|
| 257 | 257 | (prefix -/- "settings") %> \out -> do
|
| 258 | - -- Stage0 has no library or package DB of its own (the
|
|
| 259 | - -- bootstrapping compiler uses Stage1's); for any other stage the
|
|
| 260 | - -- package DB lives where the LibDir redirect points (this stage's
|
|
| 261 | - -- own lib dir, or the successor's when @compilerStage@ is a cross
|
|
| 262 | - -- stage).
|
|
| 258 | + -- @compilerStage@ is the stage that builds the compiler, i.e. the
|
|
| 259 | + -- binary whose settings these are; @libraryStage@ is the stage
|
|
| 260 | + -- whose libraries and package DB that compiler uses. The two
|
|
| 261 | + -- differ in two cases: Stage0 has no library or package DB of its
|
|
| 262 | + -- own (the bootstrapping compiler uses Stage1's), and cross
|
|
| 263 | + -- stages use the successor stage's libraries (a cross compiler
|
|
| 264 | + -- requires libs from the successor stage, otherwise they are
|
|
| 265 | + -- compiled for the host and not the target).
|
|
| 263 | 266 | isCross <- crossStage compilerStage
|
| 264 | 267 | let libraryStage = case compilerStage of
|
| 265 | 268 | Stage0 {} -> Stage1
|
| ... | ... | @@ -273,11 +276,23 @@ generateRules = do |
| 273 | 276 | else root -/- stageString libraryStage -/- "lib"
|
| 274 | 277 | relPkgDb = makeRelativeNoSysLink libTopDir pkgDb
|
| 275 | 278 | go (generateSettings out True relPkgDb libraryStage) out
|
| 276 | - (prefix -/- "targets" -/- "default.target") %> \out -> go (show <$> expr (targetStage (succStage compilerStage))) out
|
|
| 279 | + (prefix -/- "targets" -/- "default.target") %> \out ->
|
|
| 280 | + go (generateTargetFile compilerStage) out
|
|
| 277 | 281 | |
| 278 | 282 | where
|
| 279 | 283 | file <~+ gen = file %> \out -> generate out emptyTarget gen >> makeExecutable out
|
| 280 | 284 | |
| 285 | + generateTargetFile :: Stage -> Expr String
|
|
| 286 | + generateTargetFile compilerStage = do
|
|
| 287 | + isCrossStage <- if compilerStage < Stage3
|
|
| 288 | + then expr (crossStage compilerStage)
|
|
| 289 | + else pure False
|
|
| 290 | + let libraryStage = case compilerStage of
|
|
| 291 | + Stage0 {} -> Stage1
|
|
| 292 | + _ -> if isCrossStage then succStage compilerStage else compilerStage
|
|
| 293 | + tgt <- expr (targetStage libraryStage)
|
|
| 294 | + pure $ show tgt { tgtLocallyExecutable = not isCrossStage }
|
|
| 295 | + |
|
| 281 | 296 | -- TODO: Use the Types, Luke! (drop partial function)
|
| 282 | 297 | -- We sometimes need to evaluate expressions that do not require knowing all
|
| 283 | 298 | -- information about the context. In this case, we don't want to know anything.
|
| ... | ... | @@ -421,8 +436,9 @@ bindistRules = do |
| 421 | 436 | |
| 422 | 437 | , interpolateVar "HostOS_CPP" $ fmap cppify $ interp $ queryHost queryOS
|
| 423 | 438 | |
| 424 | - -- Stage2 always targets the final architecture. Thus, we can use a
|
|
| 425 | - -- constant stage here.
|
|
| 439 | + -- Stage2 always targets the target (as in build, host, target)
|
|
| 440 | + -- architecture. Thus, we can use it constant stage here to find
|
|
| 441 | + -- information about the target architecture.
|
|
| 426 | 442 | , interpolateVar "TargetPlatform" $ getTarget Stage2 targetPlatformTriple
|
| 427 | 443 | , interpolateVar "TargetPlatform_CPP" $ cppify <$> getTarget Stage2 targetPlatformTriple
|
| 428 | 444 | , interpolateVar "TargetArch_CPP" $ cppify <$> getTarget Stage2 queryArch
|
| ... | ... | @@ -112,8 +112,11 @@ packageArgs = do |
| 112 | 112 | , compilerStageOption ghcDebugAssertions ? arg "-DDEBUG" ]
|
| 113 | 113 | |
| 114 | 114 | , builder (Cabal Flags) ? mconcat
|
| 115 | - [ andM [expr (ghcWithInterpreter stage), orM [expr (notM cross), stage1]] `cabalFlag` "interpreter"
|
|
| 116 | - , andM [expr (ghcWithInterpreter stage), notM (expr cross)] `cabalFlag` "internal-interpreter"
|
|
| 115 | + -- In the context of cross-compilation, stage2 runs on the target
|
|
| 116 | + -- and thus can - if the architecture supports it - provide the
|
|
| 117 | + -- interpreter natively.
|
|
| 118 | + [ andM [expr (ghcWithInterpreter stage), orM [expr (notM cross), stage1, stage2]] `cabalFlag` "interpreter"
|
|
| 119 | + , andM [expr (ghcWithInterpreter stage), orM [expr (notM cross), stage2]] `cabalFlag` "internal-interpreter"
|
|
| 117 | 120 | , ifM stage0
|
| 118 | 121 | -- We build a threaded stage 1 if the bootstrapping compiler
|
| 119 | 122 | -- supports it.
|