Use in-tree cabal in build.cabal.sh (works for cabal < 1.24)
authorKai Harries <kai.harries@gmail.com>
Sun, 24 Jul 2016 09:37:08 +0000 (11:37 +0200)
committerKai Harries <kai.harries@gmail.com>
Sun, 24 Jul 2016 09:37:08 +0000 (11:37 +0200)
Partial fix of #274

This installs the in-tree Cabal into the cabal-sandbox before building
hadrian itself. This only works if the installed cabal version is < 1.24,
because I have not yet figured out how it can be done with the newly
introduced `new-build` command.

build.cabal.sh
hadrian.cabal

index 4a24dac..be2a117 100755 (executable)
@@ -61,6 +61,11 @@ else
     # Initialize sandbox if necessary
     if ! ( "$CABAL" sandbox hc-pkg list > /dev/null 2>&1); then
         "$CABAL" sandbox init
+        ( cd ../libraries/Cabal/Cabal
+          ln -s "$absoluteRoot/cabal.sandbox.config" cabal.sandbox.config
+          cabal install
+          rm cabal.sandbox.config
+        )
         "$CABAL" install                \
             --dependencies-only         \
             --disable-library-profiling \
index 63bd164..c07cef1 100644 (file)
@@ -120,7 +120,7 @@ executable hadrian
                        , ScopedTypeVariables
     build-depends:       base >= 4.8 && < 5
                        , ansi-terminal        == 0.6.*
-                       , Cabal                == 1.22.* || == 1.24.* || == 1.25.*
+                       , Cabal                >= 1.25
                        , containers           == 0.5.*
                        , directory            == 1.2.*
                        , extra                >= 1.4.7