diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2022-02-21 17:20:30 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-02-24 20:25:06 -0500 |
commit | b99646ed23ba75506005025e625edbc9a5cad41b (patch) | |
tree | 413d02d68db2bdeb9c6437fde73e73f5d768c98c | |
parent | 6555b68ca0678827b89c5624db071f5a485d18b7 (diff) | |
download | haskell-b99646ed23ba75506005025e625edbc9a5cad41b.tar.gz |
Add rule for generating HsBaseConfig.h
If you are running the `lint:{base/compiler}` command locally then this
improves the responsiveness because we don't re-run configure everytime
if the header file already exists.
-rw-r--r-- | hadrian/src/Rules/Lint.hs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/hadrian/src/Rules/Lint.hs b/hadrian/src/Rules/Lint.hs index 58f9715f21..6ca4e12674 100644 --- a/hadrian/src/Rules/Lint.hs +++ b/hadrian/src/Rules/Lint.hs @@ -9,8 +9,16 @@ import System.Exit (exitFailure) lintRules :: Rules () lintRules = do + root <- buildRootRules "lint:base" ~> lint base "lint:compiler" ~> lint compiler + root -/- "libraries" -/- "base" -/- "include" -/- "HsBaseConfig.h" %> \_ -> + -- ./configure is called here manually because we need to generate + -- HsBaseConfig.h, which is created from HsBaseConfig.h.in. ./configure + -- is usually run by Cabal which generates this file but if we do that + -- then hadrian thinks it needs to build the stage0 compiler before + -- attempting to configure. Therefore we just run it directly here. + cmd_ (Cwd "libraries/base") "./configure" lint :: Action () -> Action () lint lintAction = do @@ -53,14 +61,7 @@ base = do let machDeps = "rts/include/MachDeps.h" let ghcautoconf = stage1RtsInc </> "ghcautoconf.h" let ghcplatform = stage1RtsInc </> "ghcplatform.h" - -- ./configure is called here manually because we need to generate - -- HsBaseConfig.h, which is created from HsBaseConfig.h.in. ./configure - -- is usually run by Cabal which generates this file but if we do that - -- then hadrian thinks it needs to build the stage0 compiler before - -- attempting to configure. Therefore we just run it directly everytime, - -- which is slower but still faster than building the whole of stage0. - cmd_ (Cwd "libraries/base") "./configure" - need [ghcautoconf, ghcplatform, machDeps] + need [ghcautoconf, ghcplatform, machDeps, "libraries/base/include/HsBaseConfig.h"] let includeDirs = [ "rts/include" , "libraries/base/include" |