[Git][ghc/ghc][wip/hadrian-werror-ci] ci: Pass -Werror when building hadrian in hadrian-ghc-in-ghci job
sheaf (@sheaf)
gitlab at gitlab.haskell.org
Tue Aug 1 10:51:29 UTC 2023
sheaf pushed to branch wip/hadrian-werror-ci at Glasgow Haskell Compiler / GHC
Commits:
802b6d67 by Matthew Pickering at 2023-08-01T12:51:19+02:00
ci: Pass -Werror when building hadrian in hadrian-ghc-in-ghci job
Warnings when building Hadrian can end up cluttering the output of HLS,
and we've had bug reports in the past about these warnings when building
Hadrian. It would be nice to turn on -Werror on at least one build of
Hadrian in CI to avoid a patch introducing warnings when building
Hadrian.
Fixes #23638
- - - - -
4 changed files:
- .gitlab-ci.yml
- hadrian/ghci-cabal.in
- hadrian/src/Oracles/Setting.hs
- hadrian/src/Settings/Builders/Cabal.hs
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -369,6 +369,9 @@ hadrian-ghc-in-ghci:
- git clean -xdf && git submodule foreach git clean -xdf
- .gitlab/ci.sh setup
- .gitlab/ci.sh configure
+ # Enable -Werror when building hadrian
+ - "echo 'package hadrian' > hadrian/cabal.project.local"
+ - "echo ' ghc-options: -Werror' >> hadrian/cabal.project.local"
# Load ghc-in-ghci then immediately exit and check the modules loaded
- echo ":q" | hadrian/ghci -j`mk/detect-cpu-count.sh`| tail -n2 | grep "Ok,"
after_script:
=====================================
hadrian/ghci-cabal.in
=====================================
@@ -5,6 +5,6 @@
set -e
export TOOL_OUTPUT=.hadrian_ghci/ghci_args
# Replace newlines with spaces, as these otherwise break the ghci invocation on windows.
-CABFLAGS=-v0 "hadrian/build-cabal" tool:compiler/GHC.hs --build-root=.hadrian_ghci --flavour=ghc-in-ghci $HADRIAN_ARGS
+CABFLAGS="-v0 $CABFLAGS" "hadrian/build-cabal" tool:compiler/GHC.hs --build-root=.hadrian_ghci --flavour=ghc-in-ghci $HADRIAN_ARGS
GHC_FLAGS="$GHC_FLAGS $(cat $TOOL_OUTPUT | tr '\n\r' ' ')"
@WithGhc@ --interactive $GHC_FLAGS $@ -fno-code -fwrite-interface -hidir=.hadrian_ghci/interface -O0 +RTS -A128m
=====================================
hadrian/src/Oracles/Setting.hs
=====================================
@@ -147,10 +147,6 @@ getSetting = expr . setting
bashPath :: Action FilePath
bashPath = setting BourneShell
--- | Check whether the value of a 'Setting' matches one of the given strings.
-matchSetting :: Setting -> [String] -> Action Bool
-matchSetting key values = (`elem` values) <$> setting key
-
isWinTarget :: Action Bool
isWinTarget = anyTargetOs [OSMinGW32]
=====================================
hadrian/src/Settings/Builders/Cabal.hs
=====================================
@@ -59,8 +59,6 @@ commonReinstallCabalArgs :: Args
commonReinstallCabalArgs = do
top <- expr topDirectory
root <- getBuildRoot
- threads <- shakeThreads <$> expr getShakeOptions
- _pkg <- getPackage
compiler <- expr $ programPath =<< programContext Stage1 ghc
mconcat [ arg "--project-file"
, arg $ top -/- "cabal.project-reinstall"
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/802b6d677937c3dcdec5ca4f6f0cb00505627a3c
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/802b6d677937c3dcdec5ca4f6f0cb00505627a3c
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/20230801/95281880/attachment-0001.html>
More information about the ghc-commits
mailing list