Sphinx builds "succeed" despite errors
See original GitHub issueI’m building my document with sphinx and rst2pdf 0.97.
When the package fontconfig
is not installed, the build output shows an error, but the build succeeds with exit code 0 and a zero-byte document is produced. Probably the error should be caught and the build made to fail.
writing domjudge-team-manual...
[ERROR] pdfbuilder.py:149 [Errno 2] No such file or directory: 'fc-match'
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/rst2pdf/pdfbuilder.py", line 146, in write
docwriter.write(doctree, destination)
File "/usr/lib/python3/dist-packages/docutils/writers/__init__.py", line 78, in write
self.translate()
File "/usr/lib/python3/dist-packages/rst2pdf/pdfbuilder.py", line 625, in translate
createpdf.RstToPdf(sphinx=True,
File "/usr/lib/python3/dist-packages/rst2pdf/createpdf.py", line 173, in __init__
self.loadStyles(stylesheets)
File "/usr/lib/python3/dist-packages/rst2pdf/createpdf.py", line 273, in loadStyles
self.styles = sty.StyleSheet(styleSheets,
File "/usr/lib/python3/dist-packages/rst2pdf/styles.py", line 358, in __init__
fontList = findfonts.autoEmbed(style[key])
File "/usr/lib/python3/dist-packages/rst2pdf/findfonts.py", line 322, in autoEmbed
variants = findTTFont(fname)
File "/usr/lib/python3/dist-packages/rst2pdf/findfonts.py", line 214, in findTTFont
family = get_family(fname)
File "/usr/lib/python3/dist-packages/rst2pdf/findfonts.py", line 178, in get_family
data = make_string(subprocess.check_output(["fc-match", query]))
File "/usr/lib/python3.8/subprocess.py", line 411, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/lib/python3.8/subprocess.py", line 489, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/lib/python3.8/subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'fc-match'
FAILED
build succeeded.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Sphinx inspects objects, can lead to needless build errors #7516
If I have an object in one of my modules that raises some kind of error in its __getattr__ , it will prevent...
Read more >See all warnings as errors when building Sphinx docs on ...
Turn warnings into errors ( -W and --keep-going options). This means the build fails if there is a warning and exits with exit...
Read more >Changelog - Sphinx documentation
#10356: Sphinx now uses declarative metadata with pyproject.toml to create packages, using PyPA's flit project as a build backend. Patch by Adam Turner....
Read more >Frequently Asked Questions - Read the Docs
For libraries that cannot be installed via apt in the builder there is another way to successfully build the documentation despite missing dependencies....
Read more >Build errors with docutils 0.18 - Read the Docs Blog
Recent changes in the underlying dependencies of Sphinx have caused errors in certain old projects. In this post we describe why this is ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have a hardish time reproducing the original issue. I am fine with closing this now that there’s a concrete improvement in the code base. I’ll be sure to let you know if I have (similar) issues in the future.
I’m able to reproduce this problem on a cloud Ubuntu 20.04 image, which comes with a pretty minimal amount of packages (I suspect the cloud Fedora images would have the same issues). I don’t think the real issue here is that running things without this package causes a failure or even that we don’t have this requirement documented (though that is certainly an issue). Rather, it’s that the build succeeds despite this failure. I recall seeing a similar issue about the return code for
rst2pdf
being 0 even when there’s an issue. That’s what we need to solve, IMO.