[Git][ghc/ghc][master] Adjust progress message for hadrian to include cwd.

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Mon Oct 7 23:27:05 UTC 2024



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


Commits:
ff09205c by Andreas Klebinger at 2024-10-07T19:25:35-04: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/ff09205cdb029f0416e3de26e269fa18926e5db3

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ff09205cdb029f0416e3de26e269fa18926e5db3
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/20241007/f6df272e/attachment-0001.html>


More information about the ghc-commits mailing list