[Git][ghc/ghc][wip/hadrian-haddock-opts] hadrian: Allow haddock options to be passed via key-value settings

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Fri Nov 15 18:42:24 UTC 2024



Ben Gamari pushed to branch wip/hadrian-haddock-opts at Glasgow Haskell Compiler / GHC


Commits:
9ada3ab7 by Ben Gamari at 2024-11-15T13:42:16-05:00
hadrian: Allow haddock options to be passed via key-value settings

- - - - -


2 changed files:

- hadrian/doc/user-settings.md
- hadrian/src/Flavour.hs


Changes:

=====================================
hadrian/doc/user-settings.md
=====================================
@@ -138,6 +138,9 @@ the right names for them:
   * `runtest.opts` defines extra arguments passed to `runtest.py` when
     invoked via the `hadrian test` target.
 
+  * `haddock.build-package.opts` defines arguments to be passed to Haddock
+    when building documentation.
+
 - using a wildcard (`*`) ranges over all possible values for a given "slot";
 - `=` entirely overrides the arguments for a given builder in a given context,
   with the value specified on the right hand side of `=`, while `+=` merely


=====================================
hadrian/src/Flavour.hs
=====================================
@@ -555,6 +555,7 @@ builderPredicate = builderSetting <&> (\(wstg, wpkg, builderMode) ->
        BM_CabalConfigure -> builder (Cabal Setup)
        BM_RunTest        -> builder Testsuite
        BM_Hsc2HsRun      -> builder Hsc2Hs
+       BM_Haddock        -> builder (Haddock BuildPackage)
     )
   )
 
@@ -566,6 +567,7 @@ data BuilderMode = BM_Ghc (Wildcard GhcMode)
                  | BM_CabalConfigure
                  | BM_Hsc2HsRun
                  | BM_RunTest
+                 | BM_Haddock
 
 -- | Interpretation-agnostic description of the builder settings
 --   supported by Hadrian.
@@ -606,6 +608,7 @@ builderSetting =
              , str "cc" *> fmap BM_Cc (wild ccBuilder) <* str "opts"
              , BM_CabalConfigure <$ str "cabal" <* str "configure" <* str "opts"
              , BM_Hsc2HsRun <$ str "hsc2hs" <* str "run" <* str "opts"
+             , BM_Haddock   <$ str "haddock" <* str "build-package" <* str "opts"
              ]
     , (Wildcard, Wildcard, BM_RunTest)
       <$ str "runtest" <* str "opts"



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9ada3ab71ce6ef793fa95549e55014f80e98f037

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9ada3ab71ce6ef793fa95549e55014f80e98f037
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20241115/81f682a5/attachment-0001.html>


More information about the ghc-commits mailing list