Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Base library build fails with detailed build reporting #880

Closed
bos opened this Issue · 4 comments

1 participant

@bos
Owner

(Imported from Trac #890, reported by @batterseapower on 2011-09-28)

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-1.10.2.0
The 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)

@bos
Owner

(Imported comment by @batterseapower on 2011-09-28)

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-1.10.2.0
@bos
Owner

(Imported comment by @batterseapower on 2011-09-28)

Or even more mininally, just remove the -i.:i.e. remove "-i" ++ workingDirfrom SetupWrapper?.hs:295. Is there a good reason for this to be here? You probably only want it when you are compiling the Cabal package itself.

@bos
Owner

(Imported comment by @batterseapower on 2011-09-28)

Never mind, we can't remove -i. without breaking packages that import other modules from their Setup.hs. And anyway compiling "base" with Cabal fails even if you fix this particular bug.

@bos
Owner

(Imported comment by @dcoutts on 2011-09-30)

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.

@bos bos closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.