Use Cabal directly in place of ghc-cabal + make build root configurable (#531)
authorAlp Mestanogullari <alpmestan@gmail.com>
Fri, 30 Mar 2018 18:31:03 +0000 (20:31 +0200)
committerAndrey Mokhov <andrey.mokhov@gmail.com>
Fri, 30 Mar 2018 18:31:03 +0000 (19:31 +0100)
commit3a68f11c9d6ceebdb09f85804143dd2f1d49a502
tree52b31477ac8f7c9e82cc8ccda198cbd9e4ce923d
parent2fcfde2a455b2d0c5f6a0f6003dcc8af669aea80
Use Cabal directly in place of ghc-cabal + make build root configurable (#531)

* Use Cabal directly in place of ghc-cabal; make build root configurable.

This commit implements two significant changes (that were not easy to
separate):

- Don't use ghc-cabal anymore for getting information about Haskell packages.
  We now instead directly use Cabal-the-library.

- Make the build root configurable. This effectively gets rid of the inplace
  logic and allows us to place _all_ build artefacts in some directory of
  our choice, by passing '--build-root <some path>' to hadrian.

The code for this was mostly taken from #445.

* fix documentation rules

* remove some leftover unrelated, commented-out code

* more documentation fixes, address some feedback

* cleanup

* more cleanup

* boot and configure explicitly in travis CI scripts

* update cabal/ghc versions in .travis.yml (8.0.x not supported anymore)

* temporarily disable dynamic ways in Settings.Default

* update appveyor script

* travis: when booting with 8.2.2, build a complete stage2 compiler

* Fix CI?

Try to fix the CI by adding the `debug` rts way back in.

* Update Quickest.hs

Replicate the make build systems build flavours.

* Update .travis.yml

- Run selftest, and build in separate instances.
- try with python2
- and unify mac to stage2

* Update .travis.yml

upgrade python on mac

* [travis] os x: test the freshly built ghc

* Get rid of two unused GhcCabalMode constructors

* fix ghc-split rule, get rid of Install/Wrappers rules

* address more feedback

* ConfiguredCabal -> PackageData, more comments, more feedback addressed

* make the complete stage 2 build the default

* use a dummy package instead of base in Rules.hs

* update CI scripts

* attempt at fixing hadrian's -c option

* .travis.yml: use -c everywhere again

* travis: back to explicit './boot && ./configure'

* update README.md and doc/user-settings.md to reflect configurable build root

* some more feedback
63 files changed:
.travis.yml
README.md
appveyor.yml
doc/user-settings.md
hadrian.cabal
src/Base.hs
src/Builder.hs
src/Builder.hs-boot [new file with mode: 0644]
src/CommandLine.hs
src/Context.hs
src/Context/Paths.hs [new file with mode: 0644]
src/Expression.hs
src/Expression/Type.hs
src/GHC.hs
src/GHC/Packages.hs [new file with mode: 0644]
src/Hadrian/Builder.hs
src/Hadrian/Haskell/Cabal.hs
src/Hadrian/Haskell/Cabal/PackageData.hs [new file with mode: 0644]
src/Hadrian/Haskell/Cabal/Parse.hs
src/Hadrian/Haskell/Cabal/Parse.hs-boot [new file with mode: 0644]
src/Hadrian/Haskell/Cabal/Type.hs
src/Hadrian/Oracles/TextFile.hs
src/Hadrian/Package.hs
src/Hadrian/Utilities.hs
src/Main.hs
src/Oracles/ModuleFiles.hs
src/Oracles/PackageData.hs [deleted file]
src/Rules.hs
src/Rules/Clean.hs
src/Rules/Compile.hs
src/Rules/Configure.hs
src/Rules/Dependencies.hs
src/Rules/Documentation.hs
src/Rules/Generate.hs
src/Rules/Gmp.hs
src/Rules/Install.hs [deleted file]
src/Rules/Libffi.hs
src/Rules/Library.hs
src/Rules/PackageData.hs
src/Rules/Program.hs
src/Rules/Register.hs
src/Rules/SourceDist.hs
src/Rules/Test.hs
src/Rules/Wrappers.hs [deleted file]
src/Settings.hs [changed mode: 0644->0755]
src/Settings/Builders/Cc.hs
src/Settings/Builders/Common.hs
src/Settings/Builders/DeriveConstants.hs
src/Settings/Builders/Ghc.hs
src/Settings/Builders/GhcCabal.hs
src/Settings/Builders/GhcPkg.hs
src/Settings/Builders/Haddock.hs
src/Settings/Builders/HsCpp.hs
src/Settings/Builders/Hsc2Hs.hs
src/Settings/Builders/RunTest.hs
src/Settings/Default.hs
src/Settings/Flavours/Quickest.hs
src/Settings/Packages.hs [new file with mode: 0644]
src/Settings/Packages/Haskeline.hs [deleted file]
src/Settings/Packages/Rts.hs
src/Settings/Warnings.hs
src/UserSettings.hs
src/Utilities.hs