4

在构建包时,我注意到重复的“正在编译...”消息集,例如:

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

我在 cabal 沙箱中构建时注意到了这一点。

我只是好奇发生了什么事。真的是两次编译源码吗?这会一直发生吗?它与在沙箱中构建有关吗?

4

1 回答 1

3

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.

于 2013-10-27T18:16:38.050 回答