Skip to content

changed dependency generation

"ghc -M" for ghc-7.8.x changed in that an error occurs:

 You must specify at least one -dep-suffix 

By chance (#8746 (closed)) I found that

ghc -M -dep-suffix "" B.hs

works, but only for the new ghc-7.8.x. For module B importing module A the following dependencies are generated:

# DO NOT DELETE: Beginning of Haskell dependencies
A.o : A.hs
B.o : B.hs
B.o : A.hi
# DO NOT DELETE: End of Haskell dependencies

The same command used with ghc-7.6.x produces wrong dependencies:

# DO NOT DELETE: Beginning of Haskell dependencies
A.o A._o : A.hs
B.o B._o : B.hs
B.o : A.hi
B._o : A._hi
# DO NOT DELETE: End of Haskell dependencies

Obviously, only for dynamic linking a dep-suffix should be needed. However for ghc-7.6. this must be "dyn" and for ghc-7.8.x this must "dyn_" plus the empty suffix!

ghc-7.6.3 -M -dep-suffix dyn B.hs
ghc-7.8.2 -M -dep-suffix dyn_ -dep-suffix "" B.hs

Both calls produce:

# DO NOT DELETE: Beginning of Haskell dependencies
A.o A.dyn_o : A.hs
B.o B.dyn_o : B.hs
B.o : A.hi
B.dyn_o : A.dyn_hi
# DO NOT DELETE: End of Haskell dependencies

The changed behavior is not documented in http://www.haskell.org/ghc/docs/7.8.2/html/users_guide/separate-compilation.html#makefile-dependencies

The (accidental?) change should also be documented in the release notes!

Trac metadata
Trac field Value
Version 7.8.2
Type Task
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Documentation
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information