13
votes

Let's suppose I have no the HsColour program installed and I install QuickCheck

$ cd /tmp/
$ cabal get QuickCheck
$ cd QuickCheck
$ cabal install
...
[ 1 of 15] Compiling Test.QuickCheck.Random 
...
[15 of 15] Compiling Test.QuickCheck
...
Installed QuickCheck-2.7.6

If I install QuickCheck again, it is not recompiled, that is, I don't see the lines

[ 1 of 15] Compiling Test.QuickCheck.Random 
...
[15 of 15] Compiling Test.QuickCheck

but if I install HsColour current version (1.20.3) and I install QuickCheck again, QuickCheck is recompiled.

QuickCheck is also recompiled if

  1. I install HsColour,
  2. I install QuickCheck,
  3. I removed the HsColour binary and
  4. I install QuickCheck.

I tested this behaviour with GHC 7.8.3, Cabal 1.20.0.2 and cabal-install 1.20.0.3, and the development versions of Cabal and cabal-install (using https://github.com/haskell/cabal/commit/5ef7d84bb25cc5d53ad124978922f2c96bedb7d4).

1
Strange. Do you have library-documentation turned on?Daniel Wagner
No, I have no this option turned on.asr
I can duplicate this behaviour with "cabal install --disable-documentation" within a sandbox. Furthermore, I can also duplicate this with plain old "runhaskell Setup.lhs configure --user && runhaskell Setup.lhs" (so enabling/disabling documentation doesn't really come into it); my best guess is that because the configuration changes, it wants to re-build everything.ivanm

1 Answers

2
votes

I'm not an expert, but I believe cabal configures all build tools he is aware of and is able to find. When building, cabal generates cabal_macros.h file with a macro to test build tool version. If CPP extension is enabled, then the file is included everywhere, and everything is rebuilt on any change in cabal_macros.h.