[Git][ghc/ghc][wip/hadrian-werror-ci] 2 commits: ci: Pass -Werror when building hadrian in hadrian-ghc-in-ghci job

Matthew Pickering (@mpickering) gitlab at gitlab.haskell.org
Thu Jul 20 12:52:49 UTC 2023



Matthew Pickering pushed to branch wip/hadrian-werror-ci at Glasgow Haskell Compiler / GHC


Commits:
d1bebfa5 by Matthew Pickering at 2023-07-20T13:52:30+01: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

- - - - -
b4301905 by Matthew Pickering at 2023-07-20T13:52:36+01:00
test

- - - - -


7 changed files:

- .gitlab-ci.yml
- hadrian/ghci-cabal.in
- hadrian/src/Context.hs
- hadrian/src/Expression.hs
- hadrian/src/Flavour.hs
- hadrian/src/Hadrian/Haskell/Hash.hs
- hadrian/src/Settings/Builders/Cabal.hs


Changes:

=====================================
.gitlab-ci.yml
=====================================
@@ -371,6 +371,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/Context.hs
=====================================
@@ -95,7 +95,7 @@ pkgSetupConfigFile context = pkgSetupConfigDir context <&> (-/- "setup-config")
 -- | Path to the haddock file of a given 'Context', e.g.:
 -- @_build/stage1/libraries/array/doc/html/array/array.haddock at .
 pkgHaddockFile :: Context -> Action FilePath
-pkgHaddockFile context at Context {..} = do
+pkgHaddockFile Context {..} = do
     root <- buildRoot
     version <- pkgUnitId stage package
     return $ root -/- "doc/html/libraries" -/- version -/- pkgName package <.> "haddock"
@@ -136,7 +136,7 @@ pkgGhciLibraryFile context at Context {..} = do
 
 -- | Path to the configuration file of a given 'Context'.
 pkgConfFile :: Context -> Action FilePath
-pkgConfFile context at Context {..} = do
+pkgConfFile Context {..} = do
     pid  <- pkgUnitId stage package
     dbPath <- packageDbPath (PackageDbLoc stage iplace)
     return $ dbPath -/- pid <.> "conf"


=====================================
hadrian/src/Expression.hs
=====================================
@@ -35,6 +35,8 @@ import Hadrian.Expression hiding (Expr, Predicate, Args)
 import Hadrian.Haskell.Cabal.Type
 import Hadrian.Oracles.Cabal
 
+foo = ()
+
 -- | Get values from a configured cabal stage.
 getContextData :: (ContextData -> a) -> Expr a
 getContextData key = do


=====================================
hadrian/src/Flavour.hs
=====================================
@@ -37,7 +37,6 @@ import Text.Parsec.Combinator as P
 import Text.Parsec.Char as P
 import Control.Monad.Except
 import UserSettings
-import Oracles.Flag
 
 
 flavourTransformers :: Map String (Flavour -> Flavour)


=====================================
hadrian/src/Hadrian/Haskell/Hash.hs
=====================================
@@ -31,7 +31,6 @@ import Way
 import Packages
 import Development.Shake.Classes
 import Control.Monad
-import Utilities
 import Base
 import Context
 import System.Directory.Extra (listFilesRecursive)


=====================================
hadrian/src/Settings/Builders/Cabal.hs
=====================================
@@ -57,7 +57,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"



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/92951ab032a856c6d49d61b87a5ae592f773d408...b4301905c394d2cb77e804909c149722f2679616

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/92951ab032a856c6d49d61b87a5ae592f773d408...b4301905c394d2cb77e804909c149722f2679616
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/20230720/7ae872f7/attachment-0001.html>


More information about the ghc-commits mailing list