diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2021-09-22 14:13:09 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-09-28 01:53:36 -0400 |
commit | 219f7f5060e64f5f88e65019daa1811342e8b8af (patch) | |
tree | 49e06af76425dc2547f6e94b275a29d295b0b42a /hadrian/src | |
parent | 1935c42ffb2db800c03ed6b3876eee27a96e9b69 (diff) | |
download | haskell-219f7f5060e64f5f88e65019daa1811342e8b8af.tar.gz |
hadrian: Remove deprecated tracing functions
Diffstat (limited to 'hadrian/src')
-rw-r--r-- | hadrian/src/Builder.hs | 4 | ||||
-rw-r--r-- | hadrian/src/Hadrian/Builder.hs | 2 | ||||
-rw-r--r-- | hadrian/src/Hadrian/Haskell/Cabal/Parse.hs | 8 | ||||
-rw-r--r-- | hadrian/src/Hadrian/Oracles/Cabal/Rules.hs | 6 | ||||
-rw-r--r-- | hadrian/src/Hadrian/Oracles/Path.hs | 4 | ||||
-rw-r--r-- | hadrian/src/Hadrian/Oracles/TextFile.hs | 4 | ||||
-rw-r--r-- | hadrian/src/Hadrian/Utilities.hs | 6 | ||||
-rw-r--r-- | hadrian/src/Rules.hs | 4 | ||||
-rw-r--r-- | hadrian/src/Rules/Nofib.hs | 2 | ||||
-rw-r--r-- | hadrian/src/Rules/Test.hs | 2 | ||||
-rw-r--r-- | hadrian/src/Settings/Builders/Cabal.hs | 2 | ||||
-rw-r--r-- | hadrian/src/Settings/Builders/GhcPkg.hs | 6 | ||||
-rw-r--r-- | hadrian/src/UserSettings.hs | 2 |
13 files changed, 26 insertions, 26 deletions
diff --git a/hadrian/src/Builder.hs b/hadrian/src/Builder.hs index 58a8dbc350..e4b9628ffb 100644 --- a/hadrian/src/Builder.hs +++ b/hadrian/src/Builder.hs @@ -253,7 +253,7 @@ instance H.Builder Builder where output = fromSingleton msgOut buildOutputs msgOut = "[runBuilderWith] Exactly one output file expected." -- Suppress stdout depending on the Shake's verbosity setting. - echo = EchoStdout (verbosity >= Loud) + echo = EchoStdout (verbosity >= Verbose) -- Capture stdout and write it to the output file. captureStdout = do Stdout stdout <- cmd' [path] buildArgs @@ -308,7 +308,7 @@ instance H.Builder Builder where -- xelatex produces an incredible amount of output, almost -- all of which is useless. Suppress it unless user -- requests a loud build. - if verbosity >= Loud + if verbosity >= Verbose then cmd' [Cwd output] [path] buildArgs else do (Stdouterr out, Exit code) <- cmd' [Cwd output] [path] buildArgs when (code /= ExitSuccess) $ do diff --git a/hadrian/src/Hadrian/Builder.hs b/hadrian/src/Hadrian/Builder.hs index 56c0333125..4a3b63b88e 100644 --- a/hadrian/src/Hadrian/Builder.hs +++ b/hadrian/src/Hadrian/Builder.hs @@ -122,7 +122,7 @@ doWith f info rs opts target args = do trackArgsHash target -- Rerun the rule if the hash of argList has changed. info target verbose <- interpret target verboseCommand - let quietlyUnlessVerbose = if verbose then withVerbosity Loud else quietly + let quietlyUnlessVerbose = if verbose then withVerbosity Verbose else quietly quietlyUnlessVerbose $ f (builder target) $ BuildInfo { buildArgs = argList , buildInputs = inputs target diff --git a/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs b/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs index 49352c6823..49f5aa8802 100644 --- a/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs +++ b/hadrian/src/Hadrian/Haskell/Cabal/Parse.hs @@ -152,9 +152,9 @@ configurePackage context@Context {..} = do trackArgsHash (target context (Cabal Flags stage) [] []) trackArgsHash (target context (Cabal Setup stage) [] []) verbosity <- getVerbosity - when (verbosity >= Loud) $ + when (verbosity >= Verbose) $ putProgressInfo $ "| Package " ++ quote (pkgName package) ++ " configuration flags: " ++ unwords argList - let v = if verbosity >= Loud then "-v3" else "-v0" + let v = if verbosity >= Verbose then "-v3" else "-v0" traced "cabal-configure" $ C.defaultMainWithHooksNoReadArgs hooks gpd (argList ++ ["--flags=" ++ unwords flagList, v]) @@ -175,7 +175,7 @@ copyPackage context@Context {..} = do ctxPath <- Context.contextPath context pkgDbPath <- packageDbPath stage verbosity <- getVerbosity - let v = if verbosity >= Loud then "-v3" else "-v0" + let v = if verbosity >= Verbose then "-v3" else "-v0" traced "cabal-copy" $ C.defaultMainWithHooksNoReadArgs C.autoconfUserHooks gpd [ "copy", "--builddir", ctxPath, "--target-package-db", pkgDbPath, v ] @@ -187,7 +187,7 @@ registerPackage context@Context {..} = do ctxPath <- Context.contextPath context gpd <- pkgGenericDescription package verbosity <- getVerbosity - let v = if verbosity >= Loud then "-v3" else "-v0" + let v = if verbosity >= Verbose then "-v3" else "-v0" traced "cabal-register" $ C.defaultMainWithHooksNoReadArgs C.autoconfUserHooks gpd [ "register", "--builddir", ctxPath, v ] diff --git a/hadrian/src/Hadrian/Oracles/Cabal/Rules.hs b/hadrian/src/Hadrian/Oracles/Cabal/Rules.hs index f1a4b0b5b6..2a17a6ad69 100644 --- a/hadrian/src/Hadrian/Oracles/Cabal/Rules.hs +++ b/hadrian/src/Hadrian/Oracles/Cabal/Rules.hs @@ -40,11 +40,11 @@ cabalOracle = do void $ addOracleCache $ \(PackageDataKey package) -> do let file = pkgCabalFile package need [file] - putLoud $ "| PackageData oracle: parsing " ++ quote file ++ "..." + putVerbose $ "| PackageData oracle: parsing " ++ quote file ++ "..." parsePackageData package void $ addOracleCache $ \(ContextDataKey context@Context {..}) -> do - putLoud $ "| ContextData oracle: resolving data for " + putVerbose $ "| ContextData oracle: resolving data for " ++ quote (pkgName package) ++ " (" ++ show stage ++ ", " ++ show way ++ ")..." -- Calling 'need' on @setup-config@ triggers 'configurePackage'. Why @@ -55,7 +55,7 @@ cabalOracle = do resolveContextData context void $ addOracleCache $ \(PackageConfigurationKey (pkg, stage)) -> do - putLoud $ "| PackageConfiguration oracle: configuring " + putVerbose $ "| PackageConfiguration oracle: configuring " ++ quote (pkgName pkg) ++ " (" ++ show stage ++ ")..." -- Configure the package with the GHC corresponding to the given stage hcPath <- builderPath (Ghc CompileHs stage) diff --git a/hadrian/src/Hadrian/Oracles/Path.hs b/hadrian/src/Hadrian/Oracles/Path.hs index ba226f1313..833e1cd9f9 100644 --- a/hadrian/src/Hadrian/Oracles/Path.hs +++ b/hadrian/src/Hadrian/Oracles/Path.hs @@ -47,7 +47,7 @@ pathOracle = do void $ addOracleCache $ \(WindowsPath path) -> do Stdout out <- quietly $ cmd ["cygpath", "-m", path] let windowsPath = unifyPath $ dropWhileEnd isSpace out - putLoud $ "| Windows path mapping: " ++ path ++ " => " ++ windowsPath + putVerbose $ "| Windows path mapping: " ++ path ++ " => " ++ windowsPath return windowsPath void $ addOracleCache $ \(LookupInPath name) -> do @@ -56,5 +56,5 @@ pathOracle = do exe <- case exes of [] -> error $ "Cannot find executable " ++ quote name (exe:_) -> pure $ unifyPath exe - putLoud $ "| Executable found: " ++ name ++ " => " ++ exe + putVerbose $ "| Executable found: " ++ name ++ " => " ++ exe return exe diff --git a/hadrian/src/Hadrian/Oracles/TextFile.hs b/hadrian/src/Hadrian/Oracles/TextFile.hs index ae8182e0dd..c36b3977bc 100644 --- a/hadrian/src/Hadrian/Oracles/TextFile.hs +++ b/hadrian/src/Hadrian/Oracles/TextFile.hs @@ -96,13 +96,13 @@ textFileOracle :: Rules () textFileOracle = do kv <- newCache $ \file -> do need [file] - putLoud $ "| KeyValue oracle: reading " ++ quote file ++ "..." + putVerbose $ "| KeyValue oracle: reading " ++ quote file ++ "..." liftIO $ readConfigFile file void $ addOracleCache $ \(KeyValue (file, key)) -> Map.lookup key <$> kv file kvs <- newCache $ \file -> do need [file] - putLoud $ "| KeyValues oracle: reading " ++ quote file ++ "..." + putVerbose $ "| KeyValues oracle: reading " ++ quote file ++ "..." contents <- map words <$> readFileLines file return $ Map.fromList [ (key, values) | (key:values) <- contents ] void $ addOracleCache $ \(KeyValues (file, key)) -> Map.lookup key <$> kvs file diff --git a/hadrian/src/Hadrian/Utilities.hs b/hadrian/src/Hadrian/Utilities.hs index 3777b9ea05..bbb61f68f1 100644 --- a/hadrian/src/Hadrian/Utilities.hs +++ b/hadrian/src/Hadrian/Utilities.hs @@ -419,13 +419,13 @@ mkColour (Dull c) = colourCode c mkColour (Vivid c) = colourCode c ++ ";1" mkColour (Extended code) = "38;5;" ++ code --- | A more colourful version of Shake's 'putNormal'. +-- | A more colourful version of Shake's 'putInfo'. putColoured :: String -> String -> Action () putColoured code msg = do useColour <- shakeColor <$> getShakeOptions if useColour - then putNormal $ "\ESC[" ++ code ++ "m" ++ msg ++ "\ESC[0m" - else putNormal msg + then putInfo $ "\ESC[" ++ code ++ "m" ++ msg ++ "\ESC[0m" + else putInfo msg newtype BuildProgressColour = BuildProgressColour String deriving Typeable diff --git a/hadrian/src/Rules.hs b/hadrian/src/Rules.hs index 99cf293c99..67646a8689 100644 --- a/hadrian/src/Rules.hs +++ b/hadrian/src/Rules.hs @@ -39,14 +39,14 @@ topLevelTargets :: Rules () topLevelTargets = action $ do verbosity <- getVerbosity forM_ [ Stage1 ..] $ \stage -> do - when (verbosity >= Loud) $ do + when (verbosity >= Verbose) $ do (libraries, programs) <- partition isLibrary <$> stagePackages stage libNames <- mapM (name stage) libraries pgmNames <- mapM (name stage) programs let stageHeader t ps = "| Building " ++ show stage ++ " " ++ t ++ ": " ++ intercalate ", " ps - putNormal . unlines $ + putInfo . unlines $ [ stageHeader "libraries" libNames , stageHeader "programs" pgmNames ] let buildStages = [ s | s <- [Stage0 ..], s < finalStage ] diff --git a/hadrian/src/Rules/Nofib.hs b/hadrian/src/Rules/Nofib.hs index 016f7e76c2..1e7550b480 100644 --- a/hadrian/src/Rules/Nofib.hs +++ b/hadrian/src/Rules/Nofib.hs @@ -44,7 +44,7 @@ nofibRules = do (Exit e, Stdouterr log) <- cmd (Cwd "nofib") [makePath] nofibArgs writeFile' fp log if e == ExitSuccess - then putLoud $ "nofib log available at " ++ fp + then putVerbose $ "nofib log available at " ++ fp else error $ "nofib failed, full log available at " ++ fp -- | Build the dependencies required by @nofib@. diff --git a/hadrian/src/Rules/Test.hs b/hadrian/src/Rules/Test.hs index c14d68e971..a9511ad0d4 100644 --- a/hadrian/src/Rules/Test.hs +++ b/hadrian/src/Rules/Test.hs @@ -173,7 +173,7 @@ testRules = do -- Execute the test target. -- We override the verbosity setting to make sure the user can see -- the test output: https://gitlab.haskell.org/ghc/ghc/issues/15951. - withVerbosity Loud $ buildWithCmdOptions env $ + withVerbosity Verbose $ buildWithCmdOptions env $ target (vanillaContext Stage2 compiler) RunTest [] [] -- | Build the timeout program. diff --git a/hadrian/src/Settings/Builders/Cabal.hs b/hadrian/src/Settings/Builders/Cabal.hs index 468757adca..e3361d3fe9 100644 --- a/hadrian/src/Settings/Builders/Cabal.hs +++ b/hadrian/src/Settings/Builders/Cabal.hs @@ -63,7 +63,7 @@ cabalBuilderArgs = builder (Cabal Setup) ? do , with Alex , with Happy -- Update Target.trackArgument if changing these: - , verbosity < Chatty ? + , verbosity < Verbose ? pure [ "-v0", "--configure-option=--quiet" , "--configure-option=--disable-option-checking" ] ] diff --git a/hadrian/src/Settings/Builders/GhcPkg.hs b/hadrian/src/Settings/Builders/GhcPkg.hs index 8b9d28f6b5..b94fbca815 100644 --- a/hadrian/src/Settings/Builders/GhcPkg.hs +++ b/hadrian/src/Settings/Builders/GhcPkg.hs @@ -10,7 +10,7 @@ ghcPkgBuilderArgs = mconcat pkgDb <- expr $ packageDbPath stage mconcat [ use_db pkgDb , arg "register" - , verbosity < Chatty ? arg "-v0" + , verbosity < Verbose ? arg "-v0" ] , builder (GhcPkg Unregister) ? do verbosity <- expr getVerbosity @@ -19,7 +19,7 @@ ghcPkgBuilderArgs = mconcat mconcat [ use_db pkgDb , arg "unregister" , arg "--force" - , verbosity < Chatty ? arg "-v0" + , verbosity < Verbose ? arg "-v0" ] , builder (GhcPkg Update) ? do verbosity <- expr getVerbosity @@ -30,7 +30,7 @@ ghcPkgBuilderArgs = mconcat mconcat [ notStage0 ? use_db pkgDb , arg "update" , arg "--force" - , verbosity < Chatty ? arg "-v0" + , verbosity < Verbose ? arg "-v0" , bootPackageDatabaseArgs , arg config ] ] where diff --git a/hadrian/src/UserSettings.hs b/hadrian/src/UserSettings.hs index 7c28faaaf9..5920b57f24 100644 --- a/hadrian/src/UserSettings.hs +++ b/hadrian/src/UserSettings.hs @@ -47,7 +47,7 @@ userPackages = [] verboseCommand :: Predicate verboseCommand = do verbosity <- expr getVerbosity - return $ verbosity >= Loud + return $ verbosity >= Verbose -- | Set colour for build progress messages (e.g. executing a build command). buildProgressColour :: BuildProgressColour |