summaryrefslogtreecommitdiff
path: root/hadrian/doc
diff options
context:
space:
mode:
authorAlexis King <lexi.lambda@gmail.com>2023-03-08 06:15:54 -0600
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-03-08 15:03:10 -0500
commit7c813d0688f03c782d3c3a93a8369a48b7e74c8d (patch)
tree7d19bebfe690a170e8668efdb4d754904df3fd4a /hadrian/doc
parentba73a807edbb444c49e0cf21ab2ce89226a77f2e (diff)
downloadhaskell-7c813d0688f03c782d3c3a93a8369a48b7e74c8d.tar.gz
hadrian: Fix flavour compiler stage options off-by-one error
!9193 pointed out that ghcDebugAssertions was supposed to be a predicate on the stage of the built compiler, but in practice it was a predicate on the stage of the compiler used to build. Unfortunately, while it fixed that issue for ghcDebugAssertions, it documented every other similar option as behaving the same way when in fact they all used the old behavior. The new behavior of ghcDebugAssertions seems more intuitive, so this commit changes the interpretation of every other option to match. It also improves the enableProfiledGhc and debugGhc flavour transformers by making them more selective about which stages in which they build additional library/RTS ways.
Diffstat (limited to 'hadrian/doc')
-rw-r--r--hadrian/doc/user-settings.md8
1 files changed, 6 insertions, 2 deletions
diff --git a/hadrian/doc/user-settings.md b/hadrian/doc/user-settings.md
index 795f877557..5616d871be 100644
--- a/hadrian/doc/user-settings.md
+++ b/hadrian/doc/user-settings.md
@@ -227,17 +227,21 @@ prefixes, and `*` matches an entire path component, excluding any separators.
What was previously achieved by having `GhcDebugged=YES` in `mk/build.mk` can
be done by defining a custom flavour in the user settings file, one that
-sets the `ghcDebugged` field of `Flavour` to `True`, e.g:
+sets the `ghcDebugged` field of `Flavour` to `const True`, e.g:
``` haskell
quickDebug :: Flavour
-quickDebug = quickFlavour { name = "dbg", ghcDebugged = True }
+quickDebug = quickFlavour { name = "dbg", ghcDebugged = const True }
```
Running `build --flavour=dbg` will build a `quick`-flavoured GHC and link
GHC, iserv, iserv-proxy and remote-iserv against the debugged RTS, by passing
`-debug` to the commands that link those executables.
+More generally, a predicate on `Stage` can be provided to specify which stages should be built debugged. For example, setting `ghcDebugged = (>= Stage2)` will build a debugged compiler at stage 2 or higher, but not stage 1.
+
+Finally, the `debug_ghc` and `debug_stage1_ghc` [flavour transformers](#flavour-transformers) provide a convenient way to enable `ghcDebugged` on the command line without the need to define a separate custom flavour.
+
### Packages
Users can add and remove packages from particular build stages. As an example,