Hadrian: fix OSX build failure and add an OSX/Hadrian CI job
authorAlp Mestanogullari <alpmestan@gmail.com>
Fri, 31 May 2019 09:20:30 +0000 (11:20 +0200)
committerMarge Bot <ben+marge-bot@smart-cactus.org>
Tue, 4 Jun 2019 05:10:20 +0000 (01:10 -0400)
The OSX build failure introduced in 3aa71a22 was due to a change in the
glob we use to collect libffi shared libraries in hadrian/src/Rules/Libffi.hs.
This commit fixes the problem and adds an OSX CI job that builds GHC with
Hadrian, to make sure we don't break it again.

.gitlab-ci.yml
hadrian/src/Rules/Libffi.hs

index f42ce61..72aafc9 100644 (file)
@@ -278,6 +278,46 @@ validate-x86_64-darwin:
       - cabal-cache
       - toolchain
 
+validate-x86_64-darwin-hadrian:
+  <<: *only-default
+  stage: full-build
+  tags:
+    - x86_64-darwin
+  variables:
+    GHC_VERSION: 8.6.3
+    MACOSX_DEPLOYMENT_TARGET: "10.7"
+    ac_cv_func_clock_gettime: "no"
+    LANG: "en_US.UTF-8"
+    CONFIGURE_ARGS: --with-intree-gmp
+    TEST_ENV: "x86_64-darwin"
+  before_script:
+    - git clean -xdf && git submodule foreach git clean -xdf
+    - python3 .gitlab/fix-submodules.py
+    - git submodule sync --recursive
+    - git submodule update --init --recursive
+    - git checkout .gitmodules
+    - "git fetch https://gitlab.haskell.org/ghc/ghc-performance-notes.git refs/notes/perf:refs/notes/perf || true"
+
+    - bash .gitlab/darwin-init.sh
+    - PATH="`pwd`/toolchain/bin:$PATH"
+  script:
+    - cabal update
+    - ./boot
+    - ./configure $CONFIGURE_ARGS
+    - hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` --docs=no-sphinx binary-dist
+    - hadrian/build.cabal.sh -j`mk/detect-cpu-count.sh` --docs=no-sphinx test --summary-junit=./junit.xml
+    - mv _build/bindist/ghc*.tar.xz ghc.tar.xz
+  after_script:
+    - cp -Rf $HOME/.cabal cabal-cache
+  artifacts:
+    when: always
+    expire_in: 2 week
+    reports:
+      junit: junit.xml
+    paths:
+      - ghc.tar.xz
+      - junit.xml
+
 .validate-linux:
   extends: .validate
   tags:
index a1a5374..e3f080d 100644 (file)
@@ -178,7 +178,7 @@ libffiRules = do
                     | windows   = "dll"
                     | osx       = "dylib"
                     | otherwise = "so"
-                filepat = "lib" ++ libffiName'' ++ "*." ++ dynlibext ++ "*"
+                filepat = "lib" ++ libffiName'' ++ "." ++ dynlibext ++ "*"
             liftIO $ getDirectoryFilesIO "." [libfilesDir -/- filepat]
 
         writeFileLines dynLibMan dynLibFiles