install --builddir

Benjamin Scarlet roll10 at
Tue Apr 9 14:46:52 CEST 2013

I'm having trouble with install --builddir.

If I run

$ cabal install --builddir /some/absolute/path test-framework

I get an error after regex-posix is installed, during the build of test-framework:

   Could not find module `Text.Regex.Base.RegexLike'
   It is a member of the hidden package `regex-base-0.93.2'.
   Perhaps you need to add `regex-base' to the build-depends in your .cabal file.
   Use -v to see a list of the files searched for.

But if I run

$ cabal install --builddir /some/absolute/path regex-posix
$ rm -r /some/absolute/path
$ cabal install --builddir /some/absolute/path test-framework

I do not get the error. Between experiments I'm removing my ~/.cabal and ~/.ghc and running cabal update.

Naively, it looks to me like using an absolute builddir has changed things so successive packages share the same intermediate files, which in turn has caused a later package to erroneously recompile a previously generated file.

My ultimate aim is only to be able to use cabal-dev for my development builds, but without writing into my source tree. Is there any way to specify a build directory outside the source of a package without it winding up shared? Could/should cabal instead create a separate subdirectory within the specified builddir for each package to be built, so that specifying an external location didn't break things?

Ben Scarlet

More information about the cabal-devel mailing list