d2l-ai / d2l-book

Books with Jupyter notebooks
https://book.d2l.ai/
Apache License 2.0
230 stars 99 forks source link

[Feat] Imrove error verbosity during d2lbook build pdf #49

Open AnirudhDagar opened 2 years ago

AnirudhDagar commented 2 years ago

Currently, CI errors out with exit code 255 in case of Latex syntax errors and doesn't show the exact errors on the CI log.

Latexmk: Summary of warnings:
  Latex failed to resolve 92 reference(s)
  Latex failed to resolve 38 citation(s)
Collected error summary (may duplicate other messages):
  pdflatex: Command for 'pdflatex' gave return code 256
Latexmk: Use the -f option to force complete processing,
 unless error was exceeding maximum runs of latex/pdflatex.
Latexmk: Errors, so I did not complete making targets
Makefile:29: recipe for target 'd2l-pt.pdf' failed
make: *** [d2l-pt.pdf] Error 12
script returned exit code 255

One example where this could have been useful is attached here.

This is then handled only by running d2lbook build pdf locally to reproduce the issue and fix the latex errors, which is frustrating and quite inconvenient.

The proposed feature request is for improved logging of these latex errors to facilitate easier and transparent debugging using CI Logs.

cc @astonzhang

astonzhang commented 2 years ago

Indeed, a nice feature to have -- so no need to debug latex locally.