diff options
author | Alp Mestanogullari <alpmestan@gmail.com> | 2019-03-15 21:35:59 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-03-27 07:20:05 -0400 |
commit | fb12f53c2779f15ee24786e8c3beae3133506a01 (patch) | |
tree | 954591064a368662821b289a606a8a6706ca7d91 /hadrian/doc | |
parent | 646f2e79c5d6e79341693b1b9660da974102cec2 (diff) | |
download | haskell-fb12f53c2779f15ee24786e8c3beae3133506a01.tar.gz |
Hadrian: introduce an easy way for users to build with -split-sections
Any user can now trivially build any number of Haskell packages with
`-split-sections` by using `splitSections`/`splitSectionsIf` on any
existing or new flavour:
-- build all packages but the ghc library with -split-sections
splitSections :: Flavour -> Flavour
-- build all packages that satisfy the given predicate
-- with --split-sections
splitSectionsIf :: (Package -> Bool) -> Flavour -> Flavour
See the new section in `doc/user-settings.md`.
Diffstat (limited to 'hadrian/doc')
-rw-r--r-- | hadrian/doc/user-settings.md | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/hadrian/doc/user-settings.md b/hadrian/doc/user-settings.md index d0531a3f3d..b6b44521cc 100644 --- a/hadrian/doc/user-settings.md +++ b/hadrian/doc/user-settings.md @@ -271,6 +271,32 @@ all of the documentation targets: You can pass several `--docs=...` flags, Hadrian will combine their effects. +## Split sections + +You can build all or just a few packages with +[`-split-sections`][split-sections] by tweaking an existing +flavour (whichever matches your needs) using +`splitSections` or `splitSectionsIf`: + +``` haskell +splitSections :: Flavour -> Flavour +splitSectionsIf :: (Package -> Bool) -> Flavour -> Flavour +``` + +For example, you can easily start with the `quick` flavour and +additionally build all Haskell packages with `-split-sections` by defining a new +flavour as +`(splitSectionsIf (const True) quickFlavour) { name = "quick-split" }`. +You can then start a build with this flavour with `build --flavour=quick-split`. + +Changing `(const True)` to `(== base)` would only build `base` with +`-split-sections`, not all Haskell packages as with `quick-split` above. + +`splitSections` is simply `splitSectionsIf` applied to the predicate +`(/=ghc)`, i.e it builds all Haskell packages but the `ghc` +library with `-split-sections` (it is usually not worth using that +option with the `ghc` library). + ## Miscellaneous Hadrian prints various progress info during the build. You can change the colours @@ -295,3 +321,5 @@ Dull Blue Vivid Cyan Extended "203" ``` + +[split-sections]: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/phases.html#ghc-flag--split-sections |