summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2018-12-30 16:36:21 -0500
committerBen Gamari <ben@smart-cactus.org>2018-12-30 16:36:21 -0500
commitc3a265a2d47305be412f62b93fe9d5ce9fb29693 (patch)
tree6736fb969d2c7ee61e7f1bf9b869ea38391405e1
parent88e7d935ffb22dbe5b962ab4aff399ce9f6e5bb6 (diff)
downloadhaskell-wip/pdf-docs-on-darwin.tar.gz
make: Silence some xelatex outputwip/pdf-docs-on-darwin
Currently build logs from GitLab CI around around 7 megabytes each. Of this, around 2 megabytes is latex output. This is quite silly as essentially all of this output is unresolved references in the early latex iterations. Here we silence this output. However, to make sure that we don't silence errors we allow each xelatex invocation besides the last to fail.
-rw-r--r--rules/sphinx.mk13
1 files changed, 9 insertions, 4 deletions
diff --git a/rules/sphinx.mk b/rules/sphinx.mk
index 4929f3c90e..32ef3e4fb5 100644
--- a/rules/sphinx.mk
+++ b/rules/sphinx.mk
@@ -56,13 +56,18 @@ pdf_$1 : $1/$2.pdf
pdf : pdf_$1
ifneq "$$(BINDIST)" "YES"
+# N.B. If we don't redirect latex output to /dev/null then we end up with literally
+# 30% of the build output being warnings, even in a successful build. However,
+# to make sure that we don't silence errors we allow each xelatex invocation
+# besides the last to fail.
+
$1/$2.pdf: $1/conf.py $$($1_RST_SOURCES)
$(SPHINXBUILD) -b latex -d $1/.doctrees-pdf $(SPHINXOPTS) $1 $1/build-pdf/$2
- cd $1/build-pdf/$2 ; xelatex -halt-on-error $2.tex
- cd $1/build-pdf/$2 ; xelatex -halt-on-error $2.tex
- cd $1/build-pdf/$2 ; xelatex -halt-on-error $2.tex
+ cd $1/build-pdf/$2 ; xelatex -halt-on-error $2.tex 2>/dev/null >/dev/null || true
+ cd $1/build-pdf/$2 ; xelatex -halt-on-error $2.tex 2>/dev/null >/dev/null || true
+ cd $1/build-pdf/$2 ; xelatex -halt-on-error $2.tex 2>/dev/null >/dev/null || true
cd $1/build-pdf/$2 ; makeindex $2.idx
- cd $1/build-pdf/$2 ; xelatex -halt-on-error $2.tex
+ cd $1/build-pdf/$2 ; xelatex -halt-on-error $2.tex 2>/dev/null >/dev/null || true
cd $1/build-pdf/$2 ; xelatex -halt-on-error $2.tex
cp $1/build-pdf/$2/$2.pdf $1/$2.pdf
endif