summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-05-29 12:23:16 +0100
committerMatthew Pickering <matthewtpickering@gmail.com>2022-04-06 15:18:31 +0100
commit4bec271aee1e36b4ccb195aaaea5341980acf1e5 (patch)
tree7d863f47abd7b44a3b6e6f055a1192b674b7e8ba
parentd249282e0b305e32ace4480840ab25efebfca7f6 (diff)
downloadhaskell-4bec271aee1e36b4ccb195aaaea5341980acf1e5.tar.gz
hadrian: Speed up lint:base rule
The rule before decided to build the whole stage1 compiler, but this was unecessary as we were just missing one header file which can be generated directly by calling configure. Before: 18 minutes After: 54s
-rw-r--r--.gitlab-ci.yml1
-rw-r--r--hadrian/src/Rules/Lint.hs10
2 files changed, 8 insertions, 3 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4e4462410f..1ded8592f0 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -374,7 +374,6 @@ lint-base:
script:
- .gitlab/ci.sh setup
- .gitlab/ci.sh configure
- - .gitlab/ci.sh run_hadrian stage1:lib:base
- .gitlab/ci.sh run_hadrian lint:base
lint-compiler:
diff --git a/hadrian/src/Rules/Lint.hs b/hadrian/src/Rules/Lint.hs
index f02a63b6b0..a05f223ddc 100644
--- a/hadrian/src/Rules/Lint.hs
+++ b/hadrian/src/Rules/Lint.hs
@@ -50,12 +50,18 @@ base = do
let machDeps = "includes/MachDeps.h"
let ghcautoconf = stage1Lib </> "ghcautoconf.h"
let ghcplatform = stage1Lib </> "ghcplatform.h"
- need ["stage1:lib:base", ghcautoconf, ghcplatform, machDeps]
+ -- ./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]
let includeDirs =
[ "includes"
, "libraries/base/include"
, stage1Lib
- , buildDir </> "stage1/libraries/base/build/include"
]
runHLint includeDirs [] "libraries/base"