Make :doc work for the ghc library
ClosedPublic

Authored by sjakobi on Jun 30 2018, 7:09 PM.

Details

Summary

We already include -haddock in the GhcLibHcOpts in order to include
the boot libraries' docs in their .hi-files.

By including -haddock in the GhcStage2HcOpts and GhcStage3HcOpts, we
make the docs for the ghc library also available to the GHCi :doc
command.

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
sjakobi created this revision.Jun 30 2018, 7:09 PM

I've realized that I've forked this branch off master although I want this change to go onto the ghc-8.6 branch. Do I need to change something?

So you only want this applied to ghc-8.6?

Sorry, I wasn't clear. This change should be useful on both master and ghc-8.6.

bgamari accepted this revision.Jul 12 2018, 5:21 PM

It would be interesting to know how much of an effect this has on interface file sizes. I doubt it's much , but it would be a good measurement to do. I'll try to characterise this as I merge.

This revision is now accepted and ready to land.Jul 12 2018, 5:21 PM

It would be interesting to know how much of an effect this has on interface file sizes. I doubt it's much , but it would be a good measurement to do. I'll try to characterise this as I merge.

I've measured the total size of the .hi-files in compiler/stage2/ and libraries/**/dist-install/ with a quick build:

  • Without -haddock, I get 65026279 bytes or 62 MB
  • With -haddock, I get 67786824 bytes or 64 MB

That's an increase of 4.2%

With Hi Haddock .hi-files are going to get even larger, although I currently don't know by how much.

This revision was automatically updated to reflect the committed changes.

@bgamari: Can we get this into ghc-8.6 too?