gitlab-ci: Implement support for i386/Windows bindists
authorBen Gamari <ben@smart-cactus.org>
Tue, 5 Mar 2019 21:41:55 +0000 (16:41 -0500)
committerMarge Bot <ben+marge-bot@smart-cactus.org>
Wed, 20 Mar 2019 03:04:18 +0000 (23:04 -0400)
.gitlab-ci.yml
.gitlab/win32-init.sh

index c135c45..5f741e1 100644 (file)
@@ -394,7 +394,7 @@ validate-x86_64-linux-fedora27:
 # Validation via Pipelines (Windows)
 ############################################################
 
-.validate-windows:
+.build-windows:
   before_script:
     - git clean -xdf
     - git submodule foreach git clean -xdf
@@ -420,29 +420,26 @@ validate-x86_64-linux-fedora27:
   dependencies: []
   variables:
     FORCE_SYMLINKS: 1
+    LANG: "en_US.UTF-8"
   cache:
     paths:
       - cabal-cache
       - ghc-8.6.2
       - ghc-tarballs
 
-validate-x86_64-windows-hadrian:
-  extends: .validate-windows
+.build-windows-hadrian:
+  extends: .build-windows
   stage: full-build
   variables:
     GHC_VERSION: "8.6.2"
-    LANG: "en_US.UTF-8"
   script:
     - |
-      set MSYSTEM=MINGW64
       python boot
       bash -c './configure --enable-tarballs-autodownload GHC=`pwd`/toolchain/bin/ghc HAPPY=`pwd`/toolchain/bin/happy ALEX=`pwd`/toolchain/bin/alex'
     - bash -c "PATH=`pwd`/toolchain/bin:$PATH hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` --flavour=Quick --docs=no-sphinx binary-dist"
     - mv _build/bindist/ghc*.tar.xz ghc.tar.xz
     # FIXME: Testsuite disabled due to #16156.
     # - bash -c 'make V=0 test THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../junit.xml'
-  cache:
-    key: x86_64-windows
   tags:
     - x86_64-windows
   artifacts:
@@ -450,36 +447,76 @@ validate-x86_64-windows-hadrian:
     paths:
       - ghc.tar.xz
 
-validate-x86_64-windows:
-  extends: .validate-windows
+validate-x86_64-windows-hadrian:
+  extends: .build-windows-hadrian
+  variables:
+    MSYSTEM: MINGW64
+  cache:
+    key: x86_64-windows-hadrian
+
+nightly-i386-windows-hadrian:
+  extends: .build-windows-hadrian
+  variables:
+    MSYSTEM: MINGW32
+  only:
+    variables:
+      - $NIGHTLY
+  cache:
+    key: i386-windows-hadrian
+
+.build-windows-make:
+  extends: .build-windows
   stage: full-build
   # due to #16084
   allow_failure: true
   variables:
     GHC_VERSION: "8.6.2"
-    LANG: "en_US.UTF-8"
     BIN_DIST_PREP_TAR_COMP: "bindistprep/ghc-x86_64-mingw32.tar.xz"
   script:
     - |
-      set MSYSTEM=MINGW64
       python boot
       bash -c './configure --enable-tarballs-autodownload GHC=`pwd`/toolchain/bin/ghc HAPPY=`pwd`/toolchain/bin/happy ALEX=`pwd`/toolchain/bin/alex'
     - bash -c "echo include mk/flavours/quick.mk > mk/build.mk"
     - bash -c "PATH=`pwd`/toolchain/bin:$PATH make -j`mk/detect-cpu-count.sh`"
     - bash -c "PATH=`pwd`/toolchain/bin:$PATH make binary-dist TAR_COMP_OPTS=-1"
     - bash -c 'make V=0 test THREADS=`mk/detect-cpu-count.sh` JUNIT_FILE=../../junit.xml'
-  cache:
-    key: x86_64-windows
   tags:
     - x86_64-windows
   artifacts:
     when: always
+    expire_in: 2 week
     reports:
       junit: junit.xml
     paths:
       - ghc-*.tar.xz
       - junit.xml
 
+validate-x86_64-windows:
+  extends: .build-windows-make
+  variables:
+    MSYSTEM: MINGW64
+  cache:
+    key: x86_64-windows
+
+release-i386-windows:
+  extends: .build-windows-make
+  only:
+    - tags
+  variables:
+    MSYSTEM: MINGW32
+  cache:
+    key: i386-windows
+
+nightly-i386-windows:
+  extends: .build-windows-make
+  only:
+    variables:
+      - $NIGHTLY
+  variables:
+    MSYSTEM: MINGW32
+  cache:
+    key: i386-windows
+
 ############################################################
 # Cleanup
 ############################################################
index dce9be8..aacb6d7 100644 (file)
@@ -10,7 +10,19 @@ if [ -d "`pwd`/cabal-cache" ]; then
 fi
 
 if [ ! -e $toolchain/bin/ghc ]; then
-    curl https://downloads.haskell.org/~ghc/$GHC_VERSION/ghc-$GHC_VERSION-x86_64-unknown-mingw32.tar.xz | tar -xJ
+    case $MSYSTEM in
+      MINGW32)
+        triple="i386-unknown-mingw32"
+        ;;
+      MINGW64)
+        triple="x86_64-unknown-mingw32"
+        ;;
+      *)
+        echo "win32-init: Unknown MSYSTEM $MSYSTEM"
+        exit 1
+        ;;
+    esac
+    curl https://downloads.haskell.org/~ghc/$GHC_VERSION/ghc-$GHC_VERSION-$triple.tar.xz | tar -xJ
     mv ghc-$GHC_VERSION toolchain
 fi