[Haskell-cafe] cabal build command and package versions

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Wed Aug 20 19:42:05 EDT 2008

On Wed, 2008-08-20 at 13:53 -0500, Nicolas Frisby wrote:
> I have a question about cabal's behavior for the build command. When
> using the build command on a cabalized project, any version changes
> for installed packages go unnoticed - the necessary modules in the
> project are not re-compiled.

Yes. That's a ghc bug.

> If however, you run the configure command (though the .cabal file for
> the project has not changed) and then the build command, the
> appropriate modules (and only the appropriate modules) are
> re-compiled.

Really? I didn't think that made any difference. I've no idea what
configure would be doing that would get ghc to notice when it simply
lacks the ability to do so in general.

> Not knowing that the configure command is necessary to detect changes
> in package that the current project depends on and proceeding only
> with the build command has led to BusErrors and GHC incurring the
> impossible in my exploration.

Yes, it's a pretty annoying ghc bug. You'll be glad to know that it is
fixed in ghc-6.10:


You'll notice a lot of people have commented on this one. It's tripped
up a lot of people.

> Is there a reason that the build command does not check the packages
> for version changes? It seems fair to expect package-sensitivity of
> the process that determines if modules need to be re-compiled. This
> process, I think, is part of the build command and not the configure
> command.

There's really not much we can do in Cabal itself. It has to be fixed in
ghc and fortunately it now is fixed. That's because Cabal just uses ghc
--make for builds and rebuilds, so if it doesn't realise that it has to
rebuild after dependent packages change then we can't do much.

As I say, I've no idea why configure should make any difference. If it
does it's only by fluke and not design.


More information about the Haskell-Cafe mailing list