ErikR
ErikR

Reputation: 52019

ghc - duplicate sets of Compiling... messages

I've noticed duplicate sets of "Compiling..." messages when building packages, e.g.:

Preprocessing library syb-0.3.7...
[ 1 of 16] Compiling Data.Generics.Basics ( ... )
[ 2 of 16] Compiling Generics.SYB.Basics ( ... )
[ 3 of 16] Compiling Data.Generics.Instances ( ... )
...
[16 of 16] Compiling Generics.SYB     ( ... )
[ 1 of 16] Compiling Data.Generics.Basics ( ... )
[ 2 of 16] Compiling Generics.SYB.Basics ( ... )
[ 3 of 16] Compiling Data.Generics.Instances ( ... )
...
[16 of 16] Compiling Generics.SYB     ( ... )
In-place registering syb-0.3.7...
Running Haddock for syb-0.3.7...
Preprocessing library syb-0.3.7...

I've noticed this when building in a cabal sandbox.

I'm just curious what's going on. Is it really compiling the source twice? Will this always happen? Is it related to building in a sandbox?

Upvotes: 4

Views: 57

Answers (1)

Daniel Wagner
Daniel Wagner

Reputation: 152682

It is really compiling the source twice. It is not related to building in a sandbox. It does not always have to happen -- you can ask cabal not to do this in its config file by toggling the library-profiling flag. However, it's strongly recommended that you do not do this: at the moment, cabal does not have good support for taking a dependency tree with no profiling libraries and rebuilding them all with profiling.

Upvotes: 3

Related Questions