[Git][ghc/ghc][wip/T18835] hadrian: Suppress xelatex output unless it fails

Ben Gamari gitlab at gitlab.haskell.org
Mon Oct 12 22:22:46 UTC 2020



Ben Gamari pushed to branch wip/T18835 at Glasgow Haskell Compiler / GHC


Commits:
37e1df61 by Ben Gamari at 2020-10-12T18:22:11-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,19 @@ 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/37e1df612540b2b26b7d2d5d810179f2218681ef

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/37e1df612540b2b26b7d2d5d810179f2218681ef
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/20201012/2c264f3a/attachment.html>


More information about the ghc-commits mailing list