[Git][ghc/ghc][wip/T18835] hadrian: Suppress xelatex output unless it fails
Ben Gamari
gitlab at gitlab.haskell.org
Tue Oct 13 14:11:48 UTC 2020
Ben Gamari pushed to branch wip/T18835 at Glasgow Haskell Compiler / GHC
Commits:
ecba68a9 by Ben Gamari at 2020-10-13T10:11:42-04:00
hadrian: Suppress xelatex output unless it fails
As noted in #18835, xelatex produces an absurd amount of output, nearly
all of which is meaningless. Silence this.
Fixes #18835.
- - - - -
1 changed file:
- hadrian/src/Builder.hs
Changes:
=====================================
hadrian/src/Builder.hs
=====================================
@@ -286,7 +286,18 @@ instance H.Builder Builder where
Makeinfo -> do
cmd' echo [path] "--no-split" [ "-o", output] [input]
- Xelatex -> unit $ cmd' [Cwd output] [path] buildArgs
+ Xelatex ->
+ -- xelatex produces an incredible amount of output, almost
+ -- all of which is useless. Suppress it unless user
+ -- requests a loud build.
+ if verbosity >= Loud
+ then cmd' [Cwd output] [path] buildArgs
+ else do (Stdouterr out, Exit code) <- cmd' [Cwd output] [path] buildArgs
+ when (code /= ExitSuccess) $
+ BSL.hPutStrLn stderr out
+ putFailure "xelatex failed!"
+ fail "xelatex failed"
+
Makeindex -> unit $ cmd' [Cwd output] [path] (buildArgs ++ [input])
Tar _ -> cmd' buildOptions echo [path] buildArgs
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ecba68a997090529222d9c0ff547305dba648776
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ecba68a997090529222d9c0ff547305dba648776
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/20201013/acd7b701/attachment.html>
More information about the ghc-commits
mailing list