[Git][ghc/ghc][wip/test-hadrian-stack-build] gitlab-ci: Verify that Hadrian builds with Stack

Ben Gamari gitlab at gitlab.haskell.org
Thu Sep 24 19:14:46 UTC 2020



Ben Gamari pushed to branch wip/test-hadrian-stack-build at Glasgow Haskell Compiler / GHC


Commits:
aaf18aaf by Ben Gamari at 2020-09-24T15:14:30-04:00
gitlab-ci: Verify that Hadrian builds with Stack

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`).

- - - - -


3 changed files:

- .gitlab-ci.yml
- hadrian/build-stack
- hadrian/build-stack.bat


Changes:

=====================================
.gitlab-ci.yml
=====================================
@@ -234,6 +234,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
   stage: build


=====================================
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 ".."  \
     "$@"


=====================================
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=.. -- %*



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/aaf18aaf8fc3fd1e21eaecbd8e32ca4a3c654222

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/aaf18aaf8fc3fd1e21eaecbd8e32ca4a3c654222
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200924/32916e21/attachment-0001.html>


More information about the ghc-commits mailing list