question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sphinx builds "succeed" despite errors

See original GitHub issue

I’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:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
thijskhcommented, Mar 2, 2021

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.

1reaction
stephenfincommented, Aug 31, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found