[Git][ghc/ghc][wip/mangoiv/ci-stages] fixup! ci: build and test stage
Magnus pushed to branch wip/mangoiv/ci-stages at Glasgow Haskell Compiler / GHC Commits: 1c58ba12 by mangoiv at 2026-08-07T16:12:44+02:00 fixup! ci: build and test stage - - - - - 2 changed files: - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml Changes: ===================================== .gitlab/generate-ci/gen_ci.hs ===================================== @@ -12,6 +12,7 @@ {-# HLINT ignore "Use camelCase" #-} {-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE TypeFamilies #-} import Data.Aeson as A import qualified Data.Map as Map @@ -174,6 +175,7 @@ data BuildConfig , textWithSIMDUTF :: Bool , testsuiteUsePerf :: Bool , testsuiteWays :: [String] + , extendName :: Maybe String } -- Extra arguments to pass to ./configure due to the BuildConfig @@ -244,6 +246,7 @@ vanilla = BuildConfig , textWithSIMDUTF = False , testsuiteUsePerf = False , testsuiteWays = [] + , extendName = Nothing } splitSectionsBroken :: BuildConfig -> BuildConfig @@ -842,13 +845,22 @@ job :: Arch -> Opsys -> BuildConfig -> BuildAndTestJob Job job arch opsys buildConfig = MkBuildAndTestJob { buildJob = NamedJob { name = jobName, jobInfo = Job { jobScript = jobBuildScript, jobStage = "full-build", jobNeeds = [("hadrian-ghc-in-ghci", False)], ..} } - , testJob = NamedJob { name = jobName <> "-test", jobInfo = Job {jobScript = jobTestScript, jobNeeds = [(jobName, True)], jobStage = "testing", ..}} } + , testJobs = + NamedJob { name = jobName <> "-test", jobInfo = testJobInfo } : + [ NamedJob + { name = jobName <> "-testperf" + , jobInfo = testJobInfo + { jobVariables = testJobInfo.jobVariables <> "RUNTEST_ARGS" =: "--config perf_path=perf" + , jobTags = [runnerPerfTag arch opsys] + } } + | testsuiteUsePerf buildConfig ] } where + testJobInfo = Job {jobScript = jobTestScript, jobNeeds = [(jobName, True)], jobStage = "testing", ..} jobPlatform = (arch, opsys) jobRules = emptyRules jobName - jobName = testEnv arch opsys buildConfig + jobName = testEnv arch opsys buildConfig <> maybe "" ("-" <>) (extendName buildConfig) jobTags = tags arch opsys buildConfig @@ -927,7 +939,6 @@ job arch opsys buildConfig = | validateNonmovingGc buildConfig ] in "RUNTEST_ARGS" =: (trim . unwords) runtestArgs - , if testsuiteUsePerf buildConfig then "RUNTEST_ARGS" =: "--config perf_path=perf" else mempty , "TEST_WAYS" =: unwords (testsuiteWays buildConfig) ] @@ -1021,26 +1032,26 @@ releaseRule = setJobRule ReleaseOnly -- | Make a normal nightly CI job nightly :: Arch -> Opsys -> BuildConfig -> BuildAndTestJob Job nightly arch opsys bc = - let MkBuildAndTestJob {buildJob, testJob} = job arch opsys bc + let MkBuildAndTestJob {buildJob, testJobs} = job arch opsys bc mkJob (NamedJob n j) = NamedJob { name = "nightly-" ++ n , jobInfo = nightlyRule . keepArtifacts "8 weeks" . highCompression $ j } - in MkBuildAndTestJob { buildJob = mkJob buildJob, testJob = mkJob testJob} + in MkBuildAndTestJob { buildJob = mkJob buildJob, testJobs = map mkJob testJobs} -- | Make a normal release CI job release :: Arch -> Opsys -> BuildConfig -> BuildAndTestJob Job release arch opsys bc = - let MkBuildAndTestJob {buildJob, testJob} = job arch opsys (bc { buildFlavour = Release }) + let MkBuildAndTestJob {buildJob, testJobs} = job arch opsys (bc { buildFlavour = Release }) mkJob (NamedJob n j) = NamedJob { name = "release-" ++ n , jobInfo = releaseRule . keepArtifacts "1 year" . ignorePerfFailures . highCompression $ j } - in MkBuildAndTestJob {buildJob = mkJob buildJob, testJob = mkJob testJob} + in MkBuildAndTestJob {buildJob = mkJob buildJob, testJobs = map mkJob testJobs} --------------------------------------------------------------------- -- Specific job modification functions --------------------------------------------------------------------- @@ -1066,11 +1077,6 @@ ignorePerfFailures = addVariable "IGNORE_PERF_FAILURES" "all" highCompression :: Job -> Job highCompression = addVariable "XZ_OPT" "-9" --- | Change the tag of the job to make sure the job is scheduled on a --- runner that has the necessary capabilties to run the job with 'perf' --- profiling counters. -perfProfilingJobTag :: Arch -> Opsys -> Job -> Job -perfProfilingJobTag arch opsys j = j { jobTags = [ runnerPerfTag arch opsys ] } -- | Mark the validate job to run in fast-ci mode -- This is default way, to enable all jobs you have to apply the `full-ci` label. @@ -1103,12 +1109,9 @@ disableValidate = modifyValidateJobs (removeValidateJobRule FastCI . removeValid data NamedJob a = NamedJob { name :: String, jobInfo :: a } deriving (Show, Functor) -data BuildAndTestJob a = MkBuildAndTestJob { buildJob :: NamedJob a, testJob :: NamedJob a} +data BuildAndTestJob a = MkBuildAndTestJob { buildJob :: NamedJob a, testJobs :: [NamedJob a]} deriving stock (Show, Functor) -renameJob :: (String -> String) -> BuildAndTestJob a -> BuildAndTestJob a -renameJob f MkBuildAndTestJob { buildJob = NamedJob n i, testJob = NamedJob n' i'} = MkBuildAndTestJob (NamedJob (f n) i) (NamedJob (f n') i') - instance ToJSON a => ToJSON (NamedJob a) where toJSON nj = object [ "name" A..= name nj @@ -1134,11 +1137,8 @@ instance ToJSON a => ToJSON (JobGroup a) where , "r" .= r ] instance ToJSON a => ToJSON (BuildAndTestJob a) where - toJSON MkBuildAndTestJob {buildJob, testJob} = - object [ "build" .= buildJob, "test" .= testJob ] - -rename :: (String -> String) -> JobGroup a -> JobGroup a -rename f (StandardTriple nv nn nr) = StandardTriple (renameJob f <$> nv) (renameJob f <$> nn) (renameJob f <$> nr) + toJSON MkBuildAndTestJob {buildJob, testJobs} = + object [ "build" .= buildJob, "test" .= testJobs ] -- | Construct a 'JobGroup' which consists of a validate, nightly and release build with -- a specific config. @@ -1164,7 +1164,7 @@ flattenJobGroup :: JobGroup a -> [(String, a)] flattenJobGroup (StandardTriple a b c) = concatMap flattenNamedJob (catMaybes [a,b,c]) flattenNamedJob :: BuildAndTestJob a -> [(String, a)] -flattenNamedJob MkBuildAndTestJob {buildJob, testJob} = [(buildJob.name, buildJob.jobInfo), (testJob.name, testJob.jobInfo)] +flattenNamedJob MkBuildAndTestJob {buildJob, testJobs} = (buildJob.name, buildJob.jobInfo) : map (\NamedJob {name, jobInfo} -> (name, jobInfo)) testJobs -- | Specification for all the jobs we want to build. jobs :: Map String Job @@ -1191,8 +1191,9 @@ debian_x86 = , modifyNightlyJobs allowFailure (modifyValidateJobs (allowFailure . manual) tsan_jobs) , -- Nightly allowed to fail: #22343 modifyNightlyJobs allowFailure (modifyValidateJobs manual (validateBuilds Amd64 (Linux validate_debian) noTntc)) + -- Run the 'perf' profiling nightly job in the release config. - , perfProfilingJob Amd64 (Linux Debian13) releaseConfig + , disableValidate (validateBuilds Amd64 (Linux validate_debian) (usePerfProfilingTestsuite releaseConfig)) , onlyRule LLVMBackend (validateBuilds Amd64 (Linux validate_debian) llvm) , addValidateRule TestPrimops (standardBuilds Amd64 (Linux validate_debian)) @@ -1203,12 +1204,6 @@ debian_x86 = where validate_debian = Debian13 - perfProfilingJob arch sys buildConfig = - -- Rename the job to avoid conflicts - rename (<> "-perf") - $ modifyJobs (perfProfilingJobTag arch sys) - $ disableValidate (validateBuilds arch sys $ usePerfProfilingTestsuite buildConfig) - tsan_jobs = modifyJobs ( addVariable "TSAN_OPTIONS" "suppressions=$CI_PROJECT_DIR/rts/.tsan-suppressions" @@ -1250,7 +1245,7 @@ fedora_x86 = -- validate pipeline which is built with perf. fastCI (standardBuildsWithConfig Amd64 (Linux Fedora43) releaseConfig) -- This job is only for generating head.hackage docs - , hackage_doc_job (disableValidate (standardBuildsWithConfig Amd64 (Linux Fedora43) releaseConfig)) + , hackage_doc_job (disableValidate (standardBuildsWithConfig Amd64 (Linux Fedora43) releaseConfig { extendName = Just "hackage"})) , disableValidate (standardBuildsWithConfig Amd64 (Linux Fedora43) dwarf) , disableValidate (standardBuilds Amd64 (Linux Fedora43)) -- For UBSan jobs, only enable for validate/nightly pipelines. @@ -1264,7 +1259,7 @@ fedora_x86 = $ validateBuilds Amd64 (Linux Fedora43) enableUBSan ] where - hackage_doc_job = rename (<> "-hackage") . modifyJobs (addVariable "HADRIAN_ARGS" "--haddock-for-hackage") + hackage_doc_job = modifyJobs (addVariable "HADRIAN_ARGS" "--haddock-for-hackage") windows_x86 :: [JobGroup Job] windows_x86 = ===================================== .gitlab/jobs.yaml ===================================== @@ -5107,7 +5107,7 @@ "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb13-release-perf": { + "nightly-x86_64-linux-deb13-release": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -5155,7 +5155,7 @@ ], "stage": "full-build", "tags": [ - "x86_64-linux-perf" + "x86_64-linux" ], "variables": { "BIGNUM_BACKEND": "gmp", @@ -5163,13 +5163,73 @@ "BUILD_FLAVOUR": "release", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "RUNTEST_ARGS": " --config perf_path=perf", + "RUNTEST_ARGS": "", "TEST_ENV": "x86_64-linux-deb13-release", "TEST_WAYS": "", "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-deb13-release-test-perf": { + "nightly-x86_64-linux-deb13-release-test": { + "after_script": [ + ".gitlab/ci.sh save_cache", + ".gitlab/ci.sh save_test_output", + ".gitlab/ci.sh clean", + "cat ci_timings.txt" + ], + "allow_failure": false, + "artifacts": { + "expire_in": "8 weeks", + "paths": [ + "ghc-x86_64-linux-deb13-release.tar.xz", + "junit.xml", + "unexpected-test-output.tar.gz" + ], + "reports": { + "junit": "junit.xml" + }, + "when": "always" + }, + "cache": { + "key": "x86_64-linux-deb13-$CACHE_REV", + "paths": [ + "cabal-cache", + "toolchain" + ] + }, + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb13:$DOCKER_REV", + "needs": [ + { + "artifacts": true, + "job": "x86_64-linux-deb13-release" + } + ], + "rules": [ + { + "if": "(\"true\" == \"true\") && ($RELEASE_JOB != \"yes\") && ($NIGHTLY)", + "when": "on_success" + } + ], + "script": [ + ".gitlab/ci.sh setup", + ".gitlab/ci.sh test_hadrian" + ], + "stage": "testing", + "tags": [ + "x86_64-linux" + ], + "variables": { + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb13-release", + "BUILD_FLAVOUR": "release", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "RUNTEST_ARGS": "", + "TEST_ENV": "x86_64-linux-deb13-release", + "TEST_WAYS": "", + "XZ_OPT": "-9" + } + }, + "nightly-x86_64-linux-deb13-release-testperf": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -6218,7 +6278,7 @@ "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-fedora43-release-test": { + "nightly-x86_64-linux-fedora43-release-hackage-test": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -6249,7 +6309,7 @@ "needs": [ { "artifacts": true, - "job": "x86_64-linux-fedora43-release" + "job": "x86_64-linux-fedora43-release-hackage" } ], "rules": [ @@ -6271,6 +6331,7 @@ "BIN_DIST_NAME": "ghc-x86_64-linux-fedora43-release", "BUILD_FLAVOUR": "release", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "HADRIAN_ARGS": "--haddock-for-hackage", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", "TEST_ENV": "x86_64-linux-fedora43-release", @@ -6278,7 +6339,7 @@ "XZ_OPT": "-9" } }, - "nightly-x86_64-linux-fedora43-release-test-hackage": { + "nightly-x86_64-linux-fedora43-release-test": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -6331,7 +6392,6 @@ "BIN_DIST_NAME": "ghc-x86_64-linux-fedora43-release", "BUILD_FLAVOUR": "release", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "HADRIAN_ARGS": "--haddock-for-hackage", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", "TEST_ENV": "x86_64-linux-fedora43-release", @@ -9971,7 +10031,7 @@ "XZ_OPT": "-9" } }, - "release-x86_64-linux-fedora43-release-test": { + "release-x86_64-linux-fedora43-release-hackage-test": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -10002,7 +10062,7 @@ "needs": [ { "artifacts": true, - "job": "x86_64-linux-fedora43-release" + "job": "x86_64-linux-fedora43-release-hackage" } ], "rules": [ @@ -10024,6 +10084,7 @@ "BIN_DIST_NAME": "ghc-x86_64-linux-fedora43-release", "BUILD_FLAVOUR": "release", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "HADRIAN_ARGS": "--haddock-for-hackage", "IGNORE_PERF_FAILURES": "all", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", @@ -10032,7 +10093,7 @@ "XZ_OPT": "-9" } }, - "release-x86_64-linux-fedora43-release-test-hackage": { + "release-x86_64-linux-fedora43-release-test": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -10085,7 +10146,6 @@ "BIN_DIST_NAME": "ghc-x86_64-linux-fedora43-release", "BUILD_FLAVOUR": "release", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "HADRIAN_ARGS": "--haddock-for-hackage", "IGNORE_PERF_FAILURES": "all", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", @@ -12701,7 +12761,7 @@ "TEST_WAYS": "" } }, - "x86_64-linux-deb13-release-perf": { + "x86_64-linux-deb13-release": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -12749,7 +12809,7 @@ ], "stage": "full-build", "tags": [ - "x86_64-linux-perf" + "x86_64-linux" ], "variables": { "BIGNUM_BACKEND": "gmp", @@ -12757,12 +12817,71 @@ "BUILD_FLAVOUR": "release", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "RUNTEST_ARGS": " --config perf_path=perf", + "RUNTEST_ARGS": "", "TEST_ENV": "x86_64-linux-deb13-release", "TEST_WAYS": "" } }, - "x86_64-linux-deb13-release-test-perf": { + "x86_64-linux-deb13-release-test": { + "after_script": [ + ".gitlab/ci.sh save_cache", + ".gitlab/ci.sh save_test_output", + ".gitlab/ci.sh clean", + "cat ci_timings.txt" + ], + "allow_failure": false, + "artifacts": { + "expire_in": "2 weeks", + "paths": [ + "ghc-x86_64-linux-deb13-release.tar.xz", + "junit.xml", + "unexpected-test-output.tar.gz" + ], + "reports": { + "junit": "junit.xml" + }, + "when": "always" + }, + "cache": { + "key": "x86_64-linux-deb13-$CACHE_REV", + "paths": [ + "cabal-cache", + "toolchain" + ] + }, + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb13:$DOCKER_REV", + "needs": [ + { + "artifacts": true, + "job": "x86_64-linux-deb13-release" + } + ], + "rules": [ + { + "if": "((($ONLY_JOBS) && ($ONLY_JOBS =~ /.*\\bx86_64-linux-deb13-release(\\s|$).*/)) || (($ONLY_JOBS == null) && (\"disabled\" != \"disabled\"))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "when": "on_success" + } + ], + "script": [ + ".gitlab/ci.sh setup", + ".gitlab/ci.sh test_hadrian" + ], + "stage": "testing", + "tags": [ + "x86_64-linux" + ], + "variables": { + "BIGNUM_BACKEND": "gmp", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb13-release", + "BUILD_FLAVOUR": "release", + "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "RUNTEST_ARGS": "", + "TEST_ENV": "x86_64-linux-deb13-release", + "TEST_WAYS": "" + } + }, + "x86_64-linux-deb13-release-testperf": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -13770,7 +13889,7 @@ ], "rules": [ { - "if": "((($ONLY_JOBS) && ($ONLY_JOBS =~ /.*\\bx86_64-linux-fedora43-release(\\s|$).*/)) || (($ONLY_JOBS == null) && (\"disabled\" != \"disabled\"))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "((($ONLY_JOBS) && ($ONLY_JOBS =~ /.*\\bx86_64-linux-fedora43-release-hackage(\\s|$).*/)) || (($ONLY_JOBS == null) && (\"disabled\" != \"disabled\"))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -13796,7 +13915,7 @@ "TEST_WAYS": "" } }, - "x86_64-linux-fedora43-release-test": { + "x86_64-linux-fedora43-release-hackage-test": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -13827,12 +13946,12 @@ "needs": [ { "artifacts": true, - "job": "x86_64-linux-fedora43-release" + "job": "x86_64-linux-fedora43-release-hackage" } ], "rules": [ { - "if": "((($ONLY_JOBS) && ($ONLY_JOBS =~ /.*\\bx86_64-linux-fedora43-release(\\s|$).*/)) || (($ONLY_JOBS == null) && ((\"true\" == \"true\")))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "((($ONLY_JOBS) && ($ONLY_JOBS =~ /.*\\bx86_64-linux-fedora43-release-hackage(\\s|$).*/)) || (($ONLY_JOBS == null) && (\"disabled\" != \"disabled\"))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -13849,13 +13968,14 @@ "BIN_DIST_NAME": "ghc-x86_64-linux-fedora43-release", "BUILD_FLAVOUR": "release", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", + "HADRIAN_ARGS": "--haddock-for-hackage", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", "TEST_ENV": "x86_64-linux-fedora43-release", "TEST_WAYS": "" } }, - "x86_64-linux-fedora43-release-test-hackage": { + "x86_64-linux-fedora43-release-test": { "after_script": [ ".gitlab/ci.sh save_cache", ".gitlab/ci.sh save_test_output", @@ -13891,7 +14011,7 @@ ], "rules": [ { - "if": "((($ONLY_JOBS) && ($ONLY_JOBS =~ /.*\\bx86_64-linux-fedora43-release(\\s|$).*/)) || (($ONLY_JOBS == null) && (\"disabled\" != \"disabled\"))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", + "if": "((($ONLY_JOBS) && ($ONLY_JOBS =~ /.*\\bx86_64-linux-fedora43-release(\\s|$).*/)) || (($ONLY_JOBS == null) && ((\"true\" == \"true\")))) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null)", "when": "on_success" } ], @@ -13908,7 +14028,6 @@ "BIN_DIST_NAME": "ghc-x86_64-linux-fedora43-release", "BUILD_FLAVOUR": "release", "CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", - "HADRIAN_ARGS": "--haddock-for-hackage", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", "TEST_ENV": "x86_64-linux-fedora43-release", View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1c58ba123e9a008f4c58efa3bbe769c4... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1c58ba123e9a008f4c58efa3bbe769c4... 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
participants (1)
-
Magnus (@MangoIV)