Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why the presence/absence of the HsColour binary forces to recompile the QuickCheck library?

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).

like image 359
asr Avatar asked Nov 06 '14 16:11

asr


1 Answers

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.

like image 128
Yuras Avatar answered Nov 12 '22 01:11

Yuras