[Git][ghc/ghc][wip/andreask/hadrian_progress] Adjust progress message for hadrian to include cwd.

Andreas Klebinger (@AndreasK) gitlab at gitlab.haskell.org
Thu Oct 3 14:14:08 UTC 2024



Andreas Klebinger pushed to branch wip/andreask/hadrian_progress at Glasgow Haskell Compiler / GHC


Commits:
88c520c2 by Andreas Klebinger at 2024-10-03T15:54:59+02:00
Adjust progress message for hadrian to include cwd.

Fixes #25335

- - - - -


3 changed files:

- hadrian/hadrian.cabal
- hadrian/src/Main.hs
- + hadrian/src/Progress.hs


Changes:

=====================================
hadrian/hadrian.cabal
=====================================
@@ -74,6 +74,7 @@ executable hadrian
                        , Oracles.ModuleFiles
                        , Oracles.TestSettings
                        , Packages
+                       , Progress
                        , Rules
                        , Rules.BinaryDist
                        , Rules.CabalReinstall


=====================================
hadrian/src/Main.hs
=====================================
@@ -27,6 +27,7 @@ import qualified Rules.Selftest
 import qualified Rules.SourceDist
 import qualified Rules.Test
 import qualified UserSettings
+import qualified Progress
 
 main :: IO ()
 main = do
@@ -56,7 +57,7 @@ main = do
         options = shakeOptions
             { shakeChange   = ChangeModtimeAndDigest
             , shakeFiles    = buildRoot -/- Base.shakeFilesDir
-            , shakeProgress = progressSimple
+            , shakeProgress = Progress.hadrianProgress cwd
             , shakeRebuild  = rebuild
             , shakeTimings  = False
             , shakeColor    = shakeColor


=====================================
hadrian/src/Progress.hs
=====================================
@@ -0,0 +1,12 @@
+module Progress (hadrianProgress) where
+
+import Development.Shake
+
+-- | A simple method for displaying progress messages, suitable for using as 'Development.Shake.shakeProgress'.
+--   This is the shakeProgress function hadrian uses. It writes the current progress to the titlebar every five seconds
+--   using 'progressTitlebar', and calls any @shake-progress@ program on the @$PATH@ using 'progressProgram'.
+hadrianProgress :: String -> IO Progress -> IO ()
+hadrianProgress cwd p = do
+    program <- progressProgram
+    progressDisplay 5 (\status -> let s = status<> "(" <> cwd <> ")" in progressTitlebar s >> program s) p
+



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/88c520c2a2f0cf5450e02b1f21f8dc1776e5d063
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/20241003/386d0005/attachment-0001.html>


More information about the ghc-commits mailing list