[Git][ghc/ghc][master] ci: Pass -Werror when building hadrian in hadrian-ghc-in-ghci job

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Wed Aug 2 10:03:41 UTC 2023



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
28211215 by Matthew Pickering at 2023-08-02T06:03:19-04: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/28211215b76ea88d3969a9e308ce083dad389986

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/28211215b76ea88d3969a9e308ce083dad389986
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/20230802/1b3e01aa/attachment-0001.html>


More information about the ghc-commits mailing list