[Git][ghc/ghc][wip/T18234] gitlab-ci: Introduce a nightly cross-compilation job

Ben Gamari gitlab at gitlab.haskell.org
Thu May 28 20:32:39 UTC 2020



Ben Gamari pushed to branch wip/T18234 at Glasgow Haskell Compiler / GHC


Commits:
6d2b964c by Ben Gamari at 2020-05-28T16:32:30-04:00
gitlab-ci: Introduce a nightly cross-compilation job

This adds a job to test cross-compilation from x86-64 to AArch64 with
Hadrian.

Fixes #18234.

- - - - -


2 changed files:

- .gitlab-ci.yml
- .gitlab/ci.sh


Changes:

=====================================
.gitlab-ci.yml
=====================================
@@ -2,7 +2,7 @@ variables:
   GIT_SSL_NO_VERIFY: "1"
 
   # Commit of ghc/ci-images repository from which to pull Docker images
-  DOCKER_REV: 6223fe0b5942f4fa35bdec92c74566cf195bfb42
+  DOCKER_REV: ba119705df5222fe74208a85019cb980e2c4318f
 
   # Sequential version number capturing the versions of all tools fetched by
   # .gitlab/ci.sh.
@@ -244,6 +244,14 @@ validate-x86_64-linux-deb9-unreg-hadrian:
   tags:
     - x86_64-linux
 
+nightly-x86_64-linux-deb10-hadrian-cross-aarch64:
+  #<<: *nightly
+  stage: build
+  extends: .build-x86_64-linux-deb10-hadrian
+  variables:
+    CONFIGURE_ARGS: --with-intree-gmp
+    CROSS_TARGET: "aarch64-linux-gnu"
+
 
 ############################################################
 # GHC-in-GHCi (Hadrian)


=====================================
.gitlab/ci.sh
=====================================
@@ -80,6 +80,7 @@ Modes:
 
 Environment variables:
 
+  CROSS_TARGET      Triple of cross-compilation target.
   MSYSTEM           (Windows-only) Which platform to build form (MINGW64 or MINGW32).
 
 Environment variables determining build configuration of Make system:
@@ -114,11 +115,11 @@ EOF
 function mingw_init() {
   case "$MSYSTEM" in
     MINGW32)
-      triple="i386-unknown-mingw32"
+      target_triple="i386-unknown-mingw32"
       boot_triple="i386-unknown-mingw32" # triple of bootstrap GHC
       ;;
     MINGW64)
-      triple="x86_64-unknown-mingw32"
+      target_triple="x86_64-unknown-mingw32"
       boot_triple="x86_64-unknown-mingw32" # triple of bootstrap GHC
       ;;
     *)
@@ -375,8 +376,8 @@ function configure() {
   end_section "booting"
 
   local target_args=""
-  if [[ -n "$triple" ]]; then
-    target_args="--target=$triple"
+  if [[ -n "$target_triple" ]]; then
+    target_args="--target=$target_triple"
   fi
 
   start_section "configuring"
@@ -415,6 +416,11 @@ function push_perf_notes() {
 }
 
 function test_make() {
+  if [ -n "$CROSS_TARGET" ]; then
+    info "Can't test cross-compiled build."
+    return
+  fi
+
   run "$MAKE" test_bindist TEST_PREP=YES
   run "$MAKE" V=0 test \
     THREADS="$cores" \
@@ -432,6 +438,11 @@ function build_hadrian() {
 }
 
 function test_hadrian() {
+  if [ -n "$CROSS_TARGET" ]; then
+    info "Can't test cross-compiled build."
+    return
+  fi
+
   cd _build/bindist/ghc-*/
   run ./configure --prefix="$TOP"/_build/install
   run "$MAKE" install
@@ -486,6 +497,11 @@ case "$(uname)" in
   *) fail "uname $(uname) is not supported" ;;
 esac
 
+if [ -n "$CROSS_TARGET" ]; then
+  info "Cross-compiling for $CROSS_TARGET..."
+  target_triple="$CROSS_TARGET"
+fi
+
 set_toolchain_paths
 
 case $1 in



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6d2b964c01912b39d352b0e4421981ae449629a5

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6d2b964c01912b39d352b0e4421981ae449629a5
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/20200528/185e6efb/attachment-0001.html>


More information about the ghc-commits mailing list