Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Base library build fails with detailed build reporting #880
If you turn on detailed build reports with --build-log=foo.log then cabal-install uses the external setup method for a package rather than the internal setup method.
If you try to use the external setup method with the "base" package then compiling the setup executable like this fails:
/usr/bin/ghc -v --make ./dist/setup/setup.hs -o ./dist/setup/setup -odir ./dist/setup -hidir ./dist/setup -i -i. -package-conf /Users/mbolingbroke/Programming/Checkouts/hackage-server/hackage-build/build-cache/local.conf.d -package Cabal-18.104.22.168The reason is that the base package exports a Prelude module which is erroneously picked up when compiling Setup.hs in preference to the Prelude exported by the installed base library. This manifests as:
**\* Chasing dependencies: Chasing modules from: *dist/setup/setup.hs Prelude.hs:38:2: lexical error at character 'i'(Because the Prelude in the base module uses CPP)
If you were to instead build the setup executable as follows it would work flawlessly:
cd dist/setup && /usr/bin/ghc -v --make setup.hs -o setup -package-conf /Users/mbolingbroke/Programming/Checkouts/hackage-server/hackage-build/build-cache/local.conf.d -package Cabal-22.214.171.124
It would be nice however to be able to specify external packages that custom Setup.hs depends on, and when adding that feature we could also add a way to stick setup src files in a subdir. That ought to fix the immediate problem. As you say, there's bigger issues for compiling base separately from the ghc build process. It would be nice though, e.g. for creating new sets of libs for cross-compilation.