Opened 10 years ago

Closed 4 years ago

Last modified 4 years ago

#3032 closed feature request (fixed)

would be nice if -fno-code and --make worked together

Reported by: duncan Owned by:
Priority: lowest Milestone: 7.6.2
Component: Compiler Version: 6.8.2
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


We had a Cabal feature request to omit linking to make it quicker in the use case that we just want to check that a package typechecks ok.

Omitting liking is good but we could save more time by omitting code generation too. The -fno-code would seem to be what we want in this case but it looks like it only works with batch mode and not --make mode. What happens at the moment when one uses -fno-code --make is that ghc cannot find the dependent modules, though it is not clear that it is actually looking for .hi files in any particular location. This is with 6.8.2, I've not checked with 6.10 but I assume it is the same.

So if it looks like it would not be too hard to do, then letting -fno-code work with --make would be occasionally useful. The expected result would be to write out the .hi files for all the modules but not the corresponding .o files. When combined with -O0 we might hope it to be a bit quicker than normal builds.

Of course it would not work in the case of template Haskell, but Cabal would just avoid using -fno-code if the package uses TH.

Change History (10)

comment:1 Changed 10 years ago by igloo

difficulty: Unknown
Milestone: 6.12 branch

comment:2 Changed 8 years ago by igloo

Milestone: 6.12 branch6.12.3

comment:3 Changed 8 years ago by igloo

Priority: normallow

comment:4 Changed 8 years ago by igloo


comment:5 Changed 8 years ago by igloo


comment:6 Changed 7 years ago by igloo


comment:7 Changed 7 years ago by igloo

Priority: lowlowest

comment:8 Changed 6 years ago by igloo


comment:9 Changed 4 years ago by ezyang

Resolution: fixed
Status: newclosed
Type of failure: None/Unknown

I think this works now, modulo Cabal support:

ezyang@sabre:~/Dev/labs$ cabal unpack parsec
cd Unpacking to parsec-3.1.5/
ezyang@sabre:~/Dev/labs$ cd parsec-3.1.5/
ezyang@sabre:~/Dev/labs/parsec-3.1.5$ cabal configure --ghc-option=-fno-code
Resolving dependencies...
Configuring parsec-3.1.5...
ezyang@sabre:~/Dev/labs/parsec-3.1.5$ time cabal build
Building parsec-3.1.5...
Preprocessing library parsec-3.1.5...
[ 1 of 25] Compiling Text.Parsec.Pos  ( Text/Parsec/Pos.hs, nothing )
[ 2 of 25] Compiling Text.Parsec.Error ( Text/Parsec/Error.hs, nothing )
[ 3 of 25] Compiling Text.ParserCombinators.Parsec.Error ( Text/ParserCombinators/Parsec/Error.hs, nothing )
[ 4 of 25] Compiling Text.ParserCombinators.Parsec.Pos ( Text/ParserCombinators/Parsec/Pos.hs, nothing )
[ 5 of 25] Compiling Text.Parsec.Prim ( Text/Parsec/Prim.hs, nothing )
[ 6 of 25] Compiling Text.Parsec.Char ( Text/Parsec/Char.hs, nothing )
[ 7 of 25] Compiling Text.Parsec.Combinator ( Text/Parsec/Combinator.hs, nothing )
[ 8 of 25] Compiling Text.ParserCombinators.Parsec.Combinator ( Text/ParserCombinators/Parsec/Combinator.hs, nothing )
[ 9 of 25] Compiling Text.Parsec.String ( Text/Parsec/String.hs, nothing )
[10 of 25] Compiling Text.ParserCombinators.Parsec.Char ( Text/ParserCombinators/Parsec/Char.hs, nothing )
[11 of 25] Compiling Text.Parsec.ByteString ( Text/Parsec/ByteString.hs, nothing )
[12 of 25] Compiling Text.Parsec.ByteString.Lazy ( Text/Parsec/ByteString/Lazy.hs, nothing )
[13 of 25] Compiling Text.Parsec.Text ( Text/Parsec/Text.hs, nothing )
[14 of 25] Compiling Text.Parsec.Text.Lazy ( Text/Parsec/Text/Lazy.hs, nothing )
[15 of 25] Compiling Text.Parsec.Token ( Text/Parsec/Token.hs, nothing )
[16 of 25] Compiling Text.ParserCombinators.Parsec.Token ( Text/ParserCombinators/Parsec/Token.hs, nothing )
[17 of 25] Compiling Text.Parsec.Expr ( Text/Parsec/Expr.hs, nothing )
[18 of 25] Compiling Text.ParserCombinators.Parsec.Prim ( Text/ParserCombinators/Parsec/Prim.hs, nothing )
[19 of 25] Compiling Text.ParserCombinators.Parsec ( Text/ParserCombinators/Parsec.hs, nothing )
[20 of 25] Compiling Text.ParserCombinators.Parsec.Expr ( Text/ParserCombinators/Parsec/Expr.hs, nothing )
[21 of 25] Compiling Text.Parsec      ( Text/Parsec.hs, nothing )
[22 of 25] Compiling Text.Parsec.Language ( Text/Parsec/Language.hs, nothing )
[23 of 25] Compiling Text.ParserCombinators.Parsec.Language ( Text/ParserCombinators/Parsec/Language.hs, nothing )
[24 of 25] Compiling Text.Parsec.Perm ( Text/Parsec/Perm.hs, nothing )
[25 of 25] Compiling Text.ParserCombinators.Parsec.Perm ( Text/ParserCombinators/Parsec/Perm.hs, nothing )
/usr/bin/ar: dist/build/Text/Parsec.o: No such file or directory

real	0m2.110s
user	0m1.682s
sys	0m0.281s

comment:10 Changed 4 years ago by tibbe

To make it work with Cabal we need to make -no-code a Cabal flag (that gets converted to a GHC flag). Right now it's opaque to Cabal what's going on.

Note: See TracTickets for help on using tickets.