[Git][ghc/ghc][wip/js-staging] CI: add CI script for the JS backend

Sylvain Henry (@hsyl20) gitlab at gitlab.haskell.org
Thu Oct 20 15:03:46 UTC 2022



Sylvain Henry pushed to branch wip/js-staging at Glasgow Haskell Compiler / GHC


Commits:
97cbb78f by Sylvain Henry at 2022-10-20T17:03:03+02:00
CI: add CI script for the JS backend

- - - - -


4 changed files:

- .gitlab-ci.yml
- .gitlab/ci.sh
- .gitlab/gen_ci.hs
- .gitlab/jobs.yaml


Changes:

=====================================
.gitlab-ci.yml
=====================================
@@ -17,6 +17,9 @@ variables:
   # Overridden by individual jobs
   CONFIGURE_ARGS: ""
 
+  # Overridden by individual jobs
+  CONFIGURE_WRAPPER: ""
+
   GIT_SUBMODULE_STRATEGY: "normal"
 
   # Makes ci.sh isolate CABAL_DIR


=====================================
.gitlab/ci.sh
=====================================
@@ -65,6 +65,7 @@ Environment variables affecting both build systems:
                     "decreases", or "all")
   HERMETIC          Take measures to avoid looking at anything in \$HOME
   CONFIGURE_ARGS    Arguments passed to configure script.
+  CONFIGURE_WRAPPER Wrapper for the configure script (e.g. Emscripten's emconfigure).
   ENABLE_NUMA       Whether to enable numa support for the build (disabled by default)
   INSTALL_CONFIGURE_ARGS
                     Arguments passed to the binary distribution configure script
@@ -421,7 +422,7 @@ function configure() {
   start_section "configuring"
   # See https://stackoverflow.com/questions/7577052 for a rationale for the
   # args[@] symbol-soup below.
-  run ./configure \
+  run ${CONFIGURE_WRAPPER:-} ./configure \
     --enable-tarballs-autodownload \
     "${args[@]+"${args[@]}"}" \
     GHC="$GHC" \


=====================================
.gitlab/gen_ci.hs
=====================================
@@ -121,6 +121,7 @@ data BuildConfig
                 , withNuma       :: Bool
                 , crossTarget    :: Maybe String
                 , crossEmulator  :: Maybe String
+                , configureWrapper :: Maybe String
                 , fullyStatic    :: Bool
                 , tablesNextToCode :: Bool
                 , threadSanitiser :: Bool
@@ -146,7 +147,7 @@ data Flavour = Flavour BaseFlavour [FlavourTrans]
 
 data FlavourTrans = Llvm | Dwarf | FullyStatic | ThreadSanitiser
 
-data BaseFlavour = Release | Validate | SlowValidate
+data BaseFlavour = Release | Validate | SlowValidate | PerfJS
 
 -----------------------------------------------------------------------------
 -- Build Configs
@@ -164,6 +165,7 @@ vanilla = BuildConfig
   , withNuma = False
   , crossTarget = Nothing
   , crossEmulator = Nothing
+  , configureWrapper = Nothing
   , fullyStatic = False
   , tablesNextToCode = True
   , threadSanitiser = False
@@ -196,10 +198,12 @@ staticNativeInt = static { bignumBackend = Native }
 
 crossConfig :: String       -- ^ target triple
             -> Maybe String -- ^ emulator for testing
+            -> Maybe String -- ^ Configure wrapper
             -> BuildConfig
-crossConfig triple emulator =
+crossConfig triple emulator configure_wrapper =
     vanilla { crossTarget = Just triple
             , crossEmulator = emulator
+            , configureWrapper = configure_wrapper
             }
 
 llvm :: BuildConfig
@@ -278,6 +282,7 @@ flavourString (Flavour base trans) = baseString base ++ concatMap (("+" ++) . fl
     baseString Release = "release"
     baseString Validate = "validate"
     baseString SlowValidate = "slow-validate"
+    baseString PerfJS = "perf-js"
 
     flavourString Llvm = "llvm"
     flavourString Dwarf = "debug_info"
@@ -636,6 +641,7 @@ job arch opsys buildConfig = (jobName, Job {..})
       , "BUILD_FLAVOUR" =: flavourString jobFlavour
       , "BIGNUM_BACKEND" =: bignumString (bignumBackend buildConfig)
       , "CONFIGURE_ARGS" =: configureArgsStr buildConfig
+      , maybe mempty ("CONFIGURE_WRAPPER" =:) (configureWrapper buildConfig)
       , maybe mempty ("CROSS_TARGET" =:) (crossTarget buildConfig)
       , maybe mempty ("CROSS_EMULATOR" =:) (crossEmulator buildConfig)
       , if withNuma buildConfig then "ENABLE_NUMA" =: "1" else mempty
@@ -813,7 +819,12 @@ jobs = Map.fromList $ concatMap flattenJobGroup $
      , standardBuilds I386 (Linux Debian9)
      , allowFailureGroup (standardBuildsWithConfig Amd64 (Linux Alpine) static)
      , disableValidate (allowFailureGroup (standardBuildsWithConfig Amd64 (Linux Alpine) staticNativeInt))
-     , validateBuilds Amd64 (Linux Debian11) (crossConfig "aarch64-linux-gnu" (Just "qemu-aarch64 -L /usr/aarch64-linux-gnu"))
+     , validateBuilds Amd64 (Linux Debian11) (crossConfig "aarch64-linux-gnu" (Just "qemu-aarch64 -L /usr/aarch64-linux-gnu") Nothing)
+     , validateBuilds Amd64 (Linux Debian11) (crossConfig "js-unknown-ghcjs" Nothing (Just "emconfigure")
+        )
+        { bignumBackend = Native
+        , buildFlavour  = PerfJS
+        }
      ]
 
   where


=====================================
.gitlab/jobs.yaml
=====================================
@@ -1328,6 +1328,67 @@
       "XZ_OPT": "-9"
     }
   },
+  "nightly-x86_64-linux-deb11-int_native-cross_js-unknown-ghcjs-perf-js": {
+    "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_js-unknown-ghcjs-perf-js.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\")",
+        "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_js-unknown-ghcjs-perf-js",
+      "BUILD_FLAVOUR": "perf-js",
+      "CONFIGURE_ARGS": "--with-intree-gmp",
+      "CONFIGURE_WRAPPER": "emconfigure",
+      "CROSS_TARGET": "js-unknown-ghcjs",
+      "TEST_ENV": "x86_64-linux-deb11-int_native-cross_js-unknown-ghcjs-perf-js",
+      "XZ_OPT": "-9"
+    }
+  },
   "nightly-x86_64-linux-deb11-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",
@@ -3810,6 +3871,66 @@
       "TEST_ENV": "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate"
     }
   },
+  "x86_64-linux-deb11-int_native-cross_js-unknown-ghcjs-perf-js": {
+    "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_js-unknown-ghcjs-perf-js.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\")",
+        "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_js-unknown-ghcjs-perf-js",
+      "BUILD_FLAVOUR": "perf-js",
+      "CONFIGURE_ARGS": "--with-intree-gmp",
+      "CONFIGURE_WRAPPER": "emconfigure",
+      "CROSS_TARGET": "js-unknown-ghcjs",
+      "TEST_ENV": "x86_64-linux-deb11-int_native-cross_js-unknown-ghcjs-perf-js"
+    }
+  },
   "x86_64-linux-deb11-validate": {
     "after_script": [
       ".gitlab/ci.sh save_cache",



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/97cbb78fb70a760cb8fea6bb8bc85919533b684d

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/97cbb78fb70a760cb8fea6bb8bc85919533b684d
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20221020/a90c1b90/attachment-0001.html>


More information about the ghc-commits mailing list