summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-05-29 12:23:16 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-06-02 16:23:53 -0400
commit437a6ccd68f3ecda5b6a6caeac6b8c39b51815db (patch)
treee4912a138ecb815979977c51ef7185d5d805f9d3
parent7d8e1549b908ebb67bfa47d782914fe364e7015d (diff)
downloadhaskell-437a6ccd68f3ecda5b6a6caeac6b8c39b51815db.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 a5cfd8161d..e9bdd7e6aa 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -372,7 +372,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 c48ac51106..218dff8047 100644
--- a/hadrian/src/Rules/Lint.hs
+++ b/hadrian/src/Rules/Lint.hs
@@ -51,12 +51,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"