- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 file is not updated when using the option numfig = True #11474
Comments
We have noticed the same problem when upgrading from sphinx 3.2.1 (the problem was not present) to 7.0.0. Since the steps to reproduce are exact and there exists working/non-working pair of releases, it should be possible to use git bisect or something alike to narrow down to the change, where the problem was introduced. From there, it is usually easy to resolve it. |
I ran #!/bin/bash
# setup virtual environment and install sphinx
python -m venv .venv
source .venv/bin/activate
pip install -e .
mkdir .venv/test
cd .venv/test
# generate a default project
sphinx-quickstart --no-sep -p "myproject" -a test -r "" -l en
# add numfig = True option to conf.py
echo -e "\nnumfig=True" >> conf.py
# build latex & get latex file modification time
make latex
file_modification_time_1="$(stat _build/latex/myproject.tex --printf=%y)"
# add a change to index.rst
echo -e "\n*new change*" >> index.rst
# build latex & get main latex file modification time again
make latex
file_modification_time_2="$(stat _build/latex/myproject.tex --printf=%y)"
# clean virtual environment
deactivate
cd ../..
rm -rf .venv
# print result
if [ "$file_modification_time_1" == "$file_modification_time_2" ]; then
exit 1 # bad
else
exit 0 # good
fi The result was:
That commit introduced some changes related to the reading of the toctree from cache, but it is not clear to me where exactly is the bug. |
@AA-Turner, since commit a9b0f27, the Also suggesting to add/extend a testcase, to cover this scenario (make latex, change, make latex again... check by the timestamp if the output is updated). |
Hi, I dug into this and actually uncovered what's causing the issue (at least I think so): After all documents have been read, the This in turn emits the Then The real issue now is that all of this happens before the environment is pickled and written to disk for further incremental builds: So the environment gets written to a file while it contains the data of all doctrees in the An easy fix is to prevent it from being pickled in the On top of that, the issue is even harder to spot as it can be obscured by the @AA-Turner Can you verify this analysis? :) |
Oh, I indeed think that the |
Describe the bug
Latex file is not updated when using the option numfig = True.
How to Reproduce
The bug can be reproduced with the following bash code:
In the code above, after updating index.rst, when running
make latex && ls _build/latex/myproject.tex --full-time
the filemyproject.tex
is not updated.The output of
make latex
in the terminal seems normal (I see no difference with respect to running without setting numfig = True, just that the tex file is not updated),The workaround for this is running sphinx-build the -E option (don't use a saved environment):
sphinx-build -E -b latex . _build/latex/
Environment Information
Sphinx extensions
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: