summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-09-24 11:58:56 -0400
committerBen Gamari <ben@well-typed.com>2020-10-13 09:54:06 -0400
commitc7c9448108a1f0001f298d1fc399996e09d761b6 (patch)
tree40666b0aa9b3f0d3a89de0a593374bad1a8c26ed
parent0a5f29185921cf2af908988ab3608602bcb40290 (diff)
downloadhaskell-wip/test-hadrian-stack-build.tar.gz
gitlab-ci: Verify that Hadrian builds with Stackwip/test-hadrian-stack-build
As noted in #18726, this regularly breaks. Let's test it. Note that we don't actually perform a build of GHC itself; we merely test that the Hadrian executable builds and works (by invoking `hadrian --version`).
-rw-r--r--.gitlab-ci.yml11
-rwxr-xr-xhadrian/build-stack6
-rw-r--r--hadrian/build-stack.bat6
3 files changed, 20 insertions, 3 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index daa8e8a5c8..38e984a7c3 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -233,6 +233,17 @@ lint-release-changelogs:
tags:
- x86_64-linux
+# Verify that Hadrian builds with stack. Note that we don't actually perform a
+# build of GHC itself; we merely test that the Hadrian executable builds and
+# works (by invoking `hadrian --version`).
+stack-hadrian-build:
+ extends: .validate-linux-hadrian
+ stage: build
+ script:
+ - .gitlab/ci.sh setup
+ - .gitlab/ci.sh configure
+ - hadrian/build-stack --version
+
validate-x86_64-linux-deb9-hadrian:
extends: .validate-linux-hadrian
needs: [hadrian-ghc-in-ghci]
diff --git a/hadrian/build-stack b/hadrian/build-stack
index 7a45042ebd..da069e3575 100755
--- a/hadrian/build-stack
+++ b/hadrian/build-stack
@@ -3,11 +3,13 @@
# Make sure that the script exits if Hadrian fails to build
set -euo pipefail
+STACK="${STACK:-stack}"
+
# Make sure Hadrian is up-to-date
cd hadrian
-stack build --no-library-profiling ${HADRIAN_NIX:+--nix}
+$STACK build --no-library-profiling ${HADRIAN_NIX:+--nix}
# Run Hadrian in the top-level GHC directory
-stack exec hadrian -- \
+$STACK exec hadrian -- \
--directory ".." \
"$@"
diff --git a/hadrian/build-stack.bat b/hadrian/build-stack.bat
index 09bfd9561e..4ed26a703a 100644
--- a/hadrian/build-stack.bat
+++ b/hadrian/build-stack.bat
@@ -3,5 +3,9 @@ setlocal
rem Change the current directory to the one containing this script
cd %~dp0
+if "%STACK%"=="" (
+ set STACK=stack
+)
+
rem Build and run Hadrian in GHC top directory forwarding additional user arguments
-stack run hadrian --cwd=.. -- %*
+%STACK% run hadrian --cwd=.. -- %*