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

git at git.haskell.org git at git.haskell.org
Tue May 30 02:39:12 UTC 2017


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

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

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

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

    Hopefully fix Windows


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

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

diff --git a/Jenkinsfile b/Jenkinsfile
index e320c49..1d2af80 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+mingw=C:\\msys64\\mingw32\\bin:C:\\msys64\\home\\ben\\ghc-8.0.2-i386\\bin',
+           '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