Switch to the fixed Cabal branch in CI and add a fix for Natural (#640)
authorAlp Mestanogullari <alpmestan@gmail.com>
Wed, 27 Jun 2018 19:59:54 +0000 (21:59 +0200)
committerAndrey Mokhov <andrey.mokhov@gmail.com>
Wed, 27 Jun 2018 19:59:54 +0000 (20:59 +0100)
* use @quasicomputational's Cabal branch in CI for the time being

* workaround can't-use-Natural-in-base

.travis.yml
appveyor.yml
circle.yml
src/Settings/Packages.hs

index f80bca6..8416e00 100644 (file)
@@ -104,6 +104,13 @@ install:
     - mv .git ghc/hadrian
     - cd ghc/hadrian && git reset --hard HEAD && cd ..
 
     - mv .git ghc/hadrian
     - cd ghc/hadrian && git reset --hard HEAD && cd ..
 
+    # We checkout a patched Cabal.
+    # See: https://github.com/snowleopard/hadrian/issues/634
+    - cd libraries/Cabal/
+    - git remote add quasicomputational https://github.com/quasicomputational/cabal.git
+    - git fetch quasicomputational && git checkout cwd-independent-check
+    - cd ../../
+
 cache:
     directories:
         - $HOME/.cabal
 cache:
     directories:
         - $HOME/.cabal
index 1a18abe..a1ac6c4 100644 (file)
@@ -20,6 +20,13 @@ install:
     # Copy new Hadrian into ./ghc/hadrian
     - cp -r new-hadrian ghc\hadrian
 
     # Copy new Hadrian into ./ghc/hadrian
     - cp -r new-hadrian ghc\hadrian
 
+    # We checkout a patched Cabal.
+    # See: https://github.com/snowleopard/hadrian/issues/634
+    - cd ghc/libraries/Cabal/
+    - git remote add quasicomputational https://github.com/quasicomputational/cabal.git
+    - git fetch quasicomputational && git checkout cwd-independent-check
+    - cd ../../../
+
     # Install Alex and Happy
     - set PATH=C:\Users\appveyor\AppData\Roaming\local\bin;%PATH%
     - ghc\hadrian\stack install --install-ghc alex happy > nul
     # Install Alex and Happy
     - set PATH=C:\Users\appveyor\AppData\Roaming\local\bin;%PATH%
     - ghc\hadrian\stack install --install-ghc alex happy > nul
index 10b9094..998e46d 100644 (file)
@@ -31,6 +31,10 @@ compile:
     # in CircleCI is a separate process, thus you can't "cd" for the other lines
     - cd ghc/hadrian; git reset --hard HEAD
 
     # in CircleCI is a separate process, thus you can't "cd" for the other lines
     - cd ghc/hadrian; git reset --hard HEAD
 
+    # We checkout a patched Cabal.
+    # See: https://github.com/snowleopard/hadrian/issues/634
+    - cd ghc/libraries/Cabal/ && git remote add quasicomputational https://github.com/quasicomputational/cabal.git && git fetch quasicomputational && git checkout cwd-independent-check
+
     - cd ghc; ./boot && PATH=~/.cabal/bin:$PATH ./configure
 
     # XXX: export PATH doesn't work well either, so we use inline env
     - cd ghc; ./boot && PATH=~/.cabal/bin:$PATH ./configure
 
     # XXX: export PATH doesn't work well either, so we use inline env
index 6a23bb7..f1f0e61 100644 (file)
@@ -27,8 +27,15 @@ packageArgs = do
 
           -- This fixes the 'unknown symbol stat' issue.
           -- See: https://github.com/snowleopard/hadrian/issues/259.
 
           -- This fixes the 'unknown symbol stat' issue.
           -- See: https://github.com/snowleopard/hadrian/issues/259.
-          , builder (Ghc CompileCWithGhc) ? arg "-optc-O2" ]
+          , builder (Ghc CompileCWithGhc) ? arg "-optc-O2"
 
 
+          -- See https://ghc.haskell.org/trac/ghc/ticket/15286 and
+          -- https://phabricator.haskell.org/D4880
+          , builder (Ghc CompileHs) ? mconcat
+             [ input "//Natural.hs" ? pure ["-O0", "-fno-omit-interface-pragmas"]
+             , input "//Num.hs" ? pure ["-O0", "-fno-ignore-interface-pragmas"]
+             ]
+          ]
         ------------------------------ bytestring ------------------------------
         , package bytestring ?
           builder CabalFlags ? intLib == integerSimple ? arg "integer-simple"
         ------------------------------ bytestring ------------------------------
         , package bytestring ?
           builder CabalFlags ? intLib == integerSimple ? arg "integer-simple"