Skip to content

Build xhtml and haddock only when `HADDOCK_DOCS=YES`

In order to save contributor’s time, and in order to run the test suite faster, I suggest to not builds haddock and its dependencies (xhtml, anything else?) if HADDOCK_DOCS=YES is specified.

The change is rather simple:

diff --git a/ghc.mk b/ghc.mk
index dd91a82..b0f93a0 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -437,7 +437,9 @@ REGULAR_INSTALL_PACKAGES += compiler
 endif
 REGULAR_INSTALL_PACKAGES += $(addprefix libraries/,$(PACKAGES_STAGE2))
 
+ifeq "$(HADDOCK_DOCS)" "YES"
 PACKAGES_STAGE1 += xhtml
+endif
 ifeq "$(Windows_Target)" "NO"
 ifneq "$(TargetOS_CPP)" "ios"
 PACKAGES_STAGE1 += terminfo
@@ -652,8 +654,10 @@ BUILD_DIRS += libraries/integer-gmp/gmp
 BUILD_DIRS += libraries/integer-gmp/mkGmpDerivedConstants
 endif
 
+ifeq "$(HADDOCK_DOCS)" "YES"
 BUILD_DIRS += utils/haddock
 BUILD_DIRS += utils/haddock/doc
+endif
 BUILD_DIRS += compiler
 BUILD_DIRS += utils/hsc2hs
 BUILD_DIRS += utils/ghc-pkg

and it does not affect validate runs, as validate has HADDOCK_DOCS set to YES.

If this is introduced, I suggest to annotate these two with a tag in packages, so that one can run ./sync-all get --no-haddock, similar to --no-dph.

Trac metadata
Trac field Value
Version 7.6.3
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Build System
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