[commit: ghc] wip/jenkins: Hopefully fix Windows (614e219)

git at git.haskell.org git at git.haskell.org
Tue May 30 02:34:04 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/jenkins
Link       : http://ghc.haskell.org/trac/ghc/changeset/614e219099fa941590314091ea8e39cb370f7bad/ghc

>---------------------------------------------------------------

commit 614e219099fa941590314091ea8e39cb370f7bad
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Mon May 29 22:33:46 2017 -0400

    Hopefully fix Windows


>---------------------------------------------------------------

614e219099fa941590314091ea8e39cb370f7bad
 Jenkinsfile | 38 ++++++++++++++++++++++++++------------
 1 file changed, 26 insertions(+), 12 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index e320c49..b23c422 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -35,23 +35,12 @@ parallel (
   // Make
   "windows 64"         : {
     node(label: 'windows && amd64') {
-      sh """
-         export MSYSTEM=MINGW32
-         # Profile tries to read PRINTER and fails due to lack of a newline, hence disabling e
-         set +e
-         source /etc/profile
-         set -e
-         """
-      buildGhc(runNoFib: false)
+      withMingw('MINGW64') buildGhc(runNoFib: false)
     }
   },
   /*
   "windows 32"         : {
     node(label: 'windows && amd64') {
-      environment {
-        MSYSTEM=MINGW64
-        PATH = 'C:\\msys64\\mingw32\\bin:C:\\msys64\\home\\ben\\ghc-8.0.2-i386\\bin:$PATH'
-      }
       buildGhc(runNoFib: false)
     }
   },
@@ -59,6 +48,31 @@ parallel (
   //"osx"                : {node(label: 'darwin') {buildGhc(runNoFib: params.runNoFib)}}
 )
 
+def withMingw(String msystem, Closure f) {
+  def msysRoot = 'C:\\msys64'
+  if (msystem == 'MINGW32') {
+    prefix = '${msysRoot}\\mingw32'
+    carch = 'i686'
+  } else if (msystem == 'MINGW64') {
+    prefix = '${msysRoot}\\mingw64'
+    carch = 'x86_64'
+  } else {
+    fail
+  }
+  chost = '${carch}-w64-mingw32'
+
+  withEnv(['MSYSTEM=${msystem}',
+           'PATH=C:\\msys64\\mingw32\\bin:C:\\msys64\\home\\ben\\ghc-8.0.2-i386\\bin:$PATH',
+           'MSYSTEM_PREFIX=${prefix}',
+           'MSYSTEM_CARCH=${carch}',
+           'MSYSTEM_CHOST=${chost}',
+           'MINGW_CHOST=${chost}',
+           'MINGW_PREFIX=${prefix}',
+           'MINGW_PACKAGE_PREFIX=mingw-w64-${MSYSTEM_CARCH}',
+           'CONFIG_SIET=${prefix}/etc/config.site'
+          ], f)
+}
+
 def installPackages(String[] pkgs) {
   sh "cabal install -j${env.THREADS} --with-compiler=`pwd`/inplace/bin/ghc-stage2 --package-db=`pwd`/inplace/lib/package.conf.d ${pkgs.join(' ')}"
 }



More information about the ghc-commits mailing list