-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LaTeX builder fails with Unknown node: substitution_definition #8936
LaTeX builder fails with Unknown node: substitution_definition #8936
Comments
@brechtm Could you check this if you have time? I'll also take a look later. |
I can't reproduce the error with the following document with v3.5.1:
@kovidgoyal Can you make a reproducible example? |
Sadly, no, it happens in a very large and complex project. However, I was able to "fix" it by simply adding the following to latex.py
Since substitution definition shouldnt be producing any output, this should be safe to do, I think. |
And this is the full log:
|
My concern is who inserted the substitution_definition nodes (mark-ups, extensions, and so on.). As you pointed, Sphinx & LaTeX builder removes them all. So nothing will be reached to the LaTeX writer. So I feel it's strange to handle it on the writer. |
Well, obviously its getting inserted by something somewhere, since |
I think the answer to that is #4827. |
I'd still prefer non-optimal footnote numbers to complete failure. |
No one is saying this shouldn't be fixed. Does the crash also occur with a Sphinx version that doesn't include PR #4827 (1.7.2, I think)? |
As I said before, I have no idea how to go about creating a minimal reproducer. This occurs in a very large and complex build. The best I can think of would be to remove parts of the build and try to narrow down where it occurs, but that is a pretty extended and painful exercise. And I dont follow your logic. Adding the do nothing methods to the latex writer will prevent the build failing, they wont change anything about generated footnote numbers. If for your project the numbers were correct before adding the dummy methods, then they will be correct after adding them. If the requirement for the dummy methods indicates that footnote numbers are going to be incorrect, then they would be incorrect in either case. As I'm afraid I dont have the time/ability to try to create a minimal reproducer, I have just fixed it in my codebase by subclassing the latex builder and adding the dummy methods. kovidgoyal/calibre@0be5604 |
Oh one thought does occur to me. In my build, some rst files are dynamically generated on the builder-inited event. They use substitutions. This is probably the source of the issue. I use it to make sure app.config.language is available. If there is a better event to do it on, do let me know. |
Changing it to config-inited seems to do the trick. |
Sadly I spoke too soon that did not work, was fooled by the caching. |
Could you let me know how to set up the build environment for calibre? I'd like to build the document.
I think it's not a reason. All substition_definition nodes are removed just before generating a LaTeX file. So your extension is not related to this error. |
Not a Ubuntu user so not sure if their distro package are up-to-date enough to build current calibre. However, on arch, you can simply run
to install all needed deps, and then run
the manual is built most easily with
|
Thank you for the info. I succeeded to build calibre. But I still failed to build document
The error I saw is here:
|
You can build that missing file with ./setup.py translations It got left out of the src tarball accidentally. |
Thanks, confirmed the error now:
And I found the reason of the error. It seems your project uses a custom LaTeX builder to build LaTeX document. But our substitution_definition remover is only available for the original LaTeX builder. So |
Cool, thanks. I dont currently need the custom builder anymore so I can remove it, however, I am guessing that this should be fixed in sphinx? My custom builder simply subclasses the builtin ones, so it is unexpected that doing so would break the build. |
… node error At present, post transform components for LaTeX builder does not work for the custom LaTeX builder that inherits the original LaTeX builder. This allows them working with the custom LaTeX builders.
Since we no longer need Cyrillic text, we dont need a custom builder. And apparently sphinx breaks with a custom latex builder. See sphinx-doc/sphinx#8936
Describe the bug
Exception occurred:
To Reproduce
Sadly I dont have a simple reproducer as this occurred while building the PDF documentation for calibre. However, it is almost certainly caused by #7953
The text was updated successfully, but these errors were encountered: