From 59c5fe1d4b624423b1c37891710f2757bb58d6af Mon Sep 17 00:00:00 2001 From: doyougnu <jeffrey.young@iohk.io> Date: Wed, 14 Jun 2023 08:20:29 -0400 Subject: [PATCH] CI: add JS release and debug builds, regen CI jobs --- .gitlab/generate-ci/gen_ci.hs | 19 +++- .gitlab/jobs.yaml | 187 ++++++++++++++++++++++++++++++++++ testsuite/config/ghc | 8 +- testsuite/driver/testlib.py | 5 + 4 files changed, 213 insertions(+), 6 deletions(-) diff --git a/.gitlab/generate-ci/gen_ci.hs b/.gitlab/generate-ci/gen_ci.hs index 08a4f9e73f4e..5576dd2a418a 100644 --- a/.gitlab/generate-ci/gen_ci.hs +++ b/.gitlab/generate-ci/gen_ci.hs @@ -228,6 +228,16 @@ debug = vanilla { buildFlavour = SlowValidate , withNuma = True } +jsDebug :: BuildConfig -> BuildConfig +jsDebug c = c { bignumBackend = Native + -- make the job a debug job + , buildFlavour = SlowValidate + , withAssertions = True + } + +jsPerf :: BuildConfig -> BuildConfig +jsPerf c = c { bignumBackend = Native } + zstdIpe :: BuildConfig zstdIpe = vanilla { withZstd = True } @@ -920,10 +930,8 @@ job_groups = , disableValidate (standardBuildsWithConfig Amd64 (Linux Alpine) (splitSectionsBroken vanilla)) , fullyStaticBrokenTests (disableValidate (allowFailureGroup (standardBuildsWithConfig Amd64 (Linux Alpine) staticNativeInt))) , validateBuilds Amd64 (Linux Debian11) (crossConfig "aarch64-linux-gnu" (Emulator "qemu-aarch64 -L /usr/aarch64-linux-gnu") Nothing) - , validateBuilds Amd64 (Linux Debian11) (crossConfig "javascript-unknown-ghcjs" (Emulator "js-emulator") (Just "emconfigure") - ) - { bignumBackend = Native - } + , standardBuildsWithConfig Amd64 (Linux Debian11) (jsPerf $ crossConfig "javascript-unknown-ghcjs" (Emulator "js-emulator") (Just "emconfigure")) + , validateBuilds Amd64 (Linux Debian11) (jsDebug $ crossConfig "javascript-unknown-ghcjs" (Emulator "js-emulator") (Just "emconfigure")) , make_wasm_jobs wasm_build_config , modifyValidateJobs manual $ make_wasm_jobs wasm_build_config {bignumBackend = Native} @@ -998,7 +1006,7 @@ platform_mapping = Map.map go $ hasReleaseBuild (StandardTriple{}) = True hasReleaseBuild (ValidateOnly{}) = False -data BindistInfo = BindistInfo { bindistName :: String } +data BindistInfo = BindistInfo { _bindistName :: String } instance ToJSON BindistInfo where toJSON (BindistInfo n) = object [ "bindistName" A..= n ] @@ -1013,6 +1021,7 @@ main = do ("metadata":as) -> write_result as platform_mapping _ -> error "gen_ci.hs <gitlab|metadata> [file.json]" +write_result :: ToJSON a => [FilePath] -> a -> IO () write_result as obj = (case as of [] -> B.putStrLn diff --git a/.gitlab/jobs.yaml b/.gitlab/jobs.yaml index 04e48134ece7..eeab09797802 100644 --- a/.gitlab/jobs.yaml +++ b/.gitlab/jobs.yaml @@ -1510,6 +1510,68 @@ "XZ_OPT": "-9" } }, + "nightly-x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-slow-validate": { + "after_script": [ + ".gitlab/ci.sh save_cache", + ".gitlab/ci.sh clean", + "cat ci_timings" + ], + "allow_failure": false, + "artifacts": { + "expire_in": "8 weeks", + "paths": [ + "ghc-x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-slow-validate.tar.xz", + "junit.xml" + ], + "reports": { + "junit": "junit.xml" + }, + "when": "always" + }, + "cache": { + "key": "x86_64-linux-deb11-$CACHE_REV", + "paths": [ + "cabal-cache", + "toolchain" + ] + }, + "dependencies": [], + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "needs": [ + { + "artifacts": false, + "job": "hadrian-ghc-in-ghci" + } + ], + "rules": [ + { + "if": "($CI_MERGE_REQUEST_LABELS !~ /.*fast-ci.*/) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY) && (\"true\" == \"true\") && (\"true\" == \"true\") && (\"true\" == \"true\") && (\"true\" == \"true\") && (\"true\" == \"true\")", + "when": "on_success" + } + ], + "script": [ + "sudo chown ghc:ghc -R .", + ".gitlab/ci.sh setup", + ".gitlab/ci.sh configure", + ".gitlab/ci.sh build_hadrian", + ".gitlab/ci.sh test_hadrian" + ], + "stage": "full-build", + "tags": [ + "x86_64-linux" + ], + "variables": { + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-slow-validate", + "BUILD_FLAVOUR": "slow-validate", + "CONFIGURE_ARGS": "--with-intree-gmp", + "CONFIGURE_WRAPPER": "emconfigure", + "CROSS_EMULATOR": "js-emulator", + "CROSS_TARGET": "javascript-unknown-ghcjs", + "TEST_ENV": "x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-slow-validate", + "XZ_OPT": "-9" + } + }, "nightly-x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-validate": { "after_script": [ ".gitlab/ci.sh save_cache", @@ -2855,6 +2917,70 @@ "XZ_OPT": "-9" } }, + "release-x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-release": { + "after_script": [ + ".gitlab/ci.sh save_cache", + ".gitlab/ci.sh clean", + "cat ci_timings" + ], + "allow_failure": false, + "artifacts": { + "expire_in": "1 year", + "paths": [ + "ghc-x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-release.tar.xz", + "junit.xml" + ], + "reports": { + "junit": "junit.xml" + }, + "when": "always" + }, + "cache": { + "key": "x86_64-linux-deb11-$CACHE_REV", + "paths": [ + "cabal-cache", + "toolchain" + ] + }, + "dependencies": [], + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "needs": [ + { + "artifacts": false, + "job": "hadrian-ghc-in-ghci" + } + ], + "rules": [ + { + "if": "($CI_MERGE_REQUEST_LABELS !~ /.*fast-ci.*/) && ($RELEASE_JOB == \"yes\") && ($NIGHTLY == null) && (\"true\" == \"true\") && (\"true\" == \"true\") && (\"true\" == \"true\") && (\"true\" == \"true\") && (\"true\" == \"true\")", + "when": "on_success" + } + ], + "script": [ + "sudo chown ghc:ghc -R .", + ".gitlab/ci.sh setup", + ".gitlab/ci.sh configure", + ".gitlab/ci.sh build_hadrian", + ".gitlab/ci.sh test_hadrian" + ], + "stage": "full-build", + "tags": [ + "x86_64-linux" + ], + "variables": { + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-release", + "BUILD_FLAVOUR": "release", + "CONFIGURE_ARGS": "--with-intree-gmp", + "CONFIGURE_WRAPPER": "emconfigure", + "CROSS_EMULATOR": "js-emulator", + "CROSS_TARGET": "javascript-unknown-ghcjs", + "HADRIAN_ARGS": "--hash-unit-ids", + "IGNORE_PERF_FAILURES": "all", + "TEST_ENV": "x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-release", + "XZ_OPT": "-9" + } + }, "release-x86_64-linux-deb11-release": { "after_script": [ ".gitlab/ci.sh save_cache", @@ -4428,6 +4554,67 @@ "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate" } }, + "x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-slow-validate": { + "after_script": [ + ".gitlab/ci.sh save_cache", + ".gitlab/ci.sh clean", + "cat ci_timings" + ], + "allow_failure": false, + "artifacts": { + "expire_in": "2 weeks", + "paths": [ + "ghc-x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-slow-validate.tar.xz", + "junit.xml" + ], + "reports": { + "junit": "junit.xml" + }, + "when": "always" + }, + "cache": { + "key": "x86_64-linux-deb11-$CACHE_REV", + "paths": [ + "cabal-cache", + "toolchain" + ] + }, + "dependencies": [], + "image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb11:$DOCKER_REV", + "needs": [ + { + "artifacts": false, + "job": "hadrian-ghc-in-ghci" + } + ], + "rules": [ + { + "if": "($CI_MERGE_REQUEST_LABELS !~ /.*fast-ci.*/) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY == null) && (\"true\" == \"true\") && (\"true\" == \"true\") && (\"true\" == \"true\") && (\"true\" == \"true\") && (\"true\" == \"true\")", + "when": "on_success" + } + ], + "script": [ + "sudo chown ghc:ghc -R .", + ".gitlab/ci.sh setup", + ".gitlab/ci.sh configure", + ".gitlab/ci.sh build_hadrian", + ".gitlab/ci.sh test_hadrian" + ], + "stage": "full-build", + "tags": [ + "x86_64-linux" + ], + "variables": { + "BIGNUM_BACKEND": "native", + "BIN_DIST_NAME": "ghc-x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-slow-validate", + "BUILD_FLAVOUR": "slow-validate", + "CONFIGURE_ARGS": "--with-intree-gmp", + "CONFIGURE_WRAPPER": "emconfigure", + "CROSS_EMULATOR": "js-emulator", + "CROSS_TARGET": "javascript-unknown-ghcjs", + "TEST_ENV": "x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-slow-validate" + } + }, "x86_64-linux-deb11-int_native-cross_javascript-unknown-ghcjs-validate": { "after_script": [ ".gitlab/ci.sh save_cache", diff --git a/testsuite/config/ghc b/testsuite/config/ghc index f22fb392e9f9..657daa9d7aeb 100644 --- a/testsuite/config/ghc +++ b/testsuite/config/ghc @@ -80,6 +80,7 @@ if not config.arch == "javascript": config.compile_ways.append('hpc') config.run_ways.append('hpc') +# WASM if config.arch == "wasm32": config.have_process = False config.supports_dynamic_libs = False @@ -269,7 +270,12 @@ def get_compiler_info(): config.have_vanilla = compiler_supports_way([]) config.have_dynamic = compiler_supports_way(['-dynamic']) - config.have_profiling = compiler_supports_way(['-prof']) + + # JavaScript doesn't support profiling yet. See #22261 + if config.arch == "javascript": + config.have_profiling = False + else: + config.have_profiling = compiler_supports_way(['-prof']) if config.have_profiling: config.compile_ways.append('profasm') diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index 955461dcdb24..df3601fde7a2 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -236,6 +236,11 @@ def req_profiling( name, opts ): '''Require the profiling libraries (add 'GhcLibWays += p' to mk/build.mk)''' if not config.have_profiling: opts.expect = 'fail' + # many profiling tests must be skipped for the JS backend. That is + # because they unexpectedly pass even though the JS backend does not + # support profiling yet. See #22251 + if js_arch(): + js_skip(name, opts) # JS backend doesn't support profiling yet if arch("js"): -- GitLab