Opened 12 months ago

Last modified 8 months ago

#9287 new bug

changed dependency generation

Reported by: maeder Owned by: simonmar
Priority: normal Milestone:
Component: Driver Version: 7.8.2
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Documentation bug Test Case:
Blocked By: Blocking:
Related Tickets: #9749, #7381 Differential Revisions:

Description

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

 You must specify at least one -dep-suffix 

By chance (#8746) 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!

Change History (4)

comment:1 Changed 12 months ago by simonmar

Indeed, when bootstrapping with 7.6.3, the dependency files in a GHC build have unnecessary entries due to -dep-suffix "":

# DO NOT DELETE: Beginning of Haskell dependencies
utils/hsc2hs/dist/build/HSCParser.o utils/hsc2hs/dist/build/HSCParser._o : utils/hsc2hs/HSCParser.hs
$(eval $(call hi-rule,utils/hsc2hs/dist/build/HSCParser.hi utils/hsc2hs/dist/build/HSCParser._hi  : %hi: %o  utils/hsc2hs/HSCParser.hs))
utils/hsc2hs/dist/build/HSCParser.o : /home/smarlow/local/lib/ghc-7.6.3/base-4.6.0.1/Prelude.hi
utils/hsc2hs/dist/build/HSCParser._o : /home/smarlow/local/lib/ghc-7.6.3/base-4.6.0.1/Prelude._hi
utils/hsc2hs/dist/build/HSCParser.o : /home/smarlow/local/lib/ghc-7.6.3/base-4.6.0.1/Data/Char.hi
utils/hsc2hs/dist/build/HSCParser._o : /home/smarlow/local/lib/ghc-7.6.3/base-4.6.0.1/Data/Char._hi
utils/hsc2hs/dist/build/HSCParser.o : /home/smarlow/local/lib/ghc-7.6.3/base-4.6.0.1/Control/Monad.hi
utils/hsc2hs/dist/build/HSCParser._o : /home/smarlow/local/lib/ghc-7.6.3/base-4.6.0.1/Control/Monad._hi
utils/hsc2hs/dist/build/HSCParser.o : /home/smarlow/local/lib/ghc-7.6.3/base-4.6.0.1/Control/Applicative.hi
utils/hsc2hs/dist/build/HSCParser._o : /home/smarlow/local/lib/ghc-7.6.3/base-4.6.0.1/Control/Applicative._hi

comment:2 Changed 12 months ago by simonmar

Change that broke this: #7381

comment:3 Changed 10 months ago by simonmar

  • Owner set to simonmar

comment:4 Changed 8 months ago by thomie

  • Component changed from Documentation to Driver
  • Type changed from task to bug
Note: See TracTickets for help on using tickets.