tectonic-typesetting / tectonic

A modernized, complete, self-contained TeX/LaTeX engine, powered by XeTeX and TeXLive.
https://tectonic-typesetting.github.io/
Other
3.99k stars 162 forks source link

Tectonic 0.15 (regression vs 0.14.1) reruns TeX indefinitely believing the .bbl file to be changed (intermediates ignored?) #1146

Closed rmgk closed 9 months ago

rmgk commented 9 months ago

As the title says. With tectonic 0.15 it seems to go into an infinite (but capped at 6) loop of rerunning TeX, even though none of the files ever changes on disk (keep same sha1sum at least). This does not happen with tectonic 0.14.1. See logs below for details.

Additionally, the rerun reasons are weirdly nondeterministic, in the run below it first claimed that .out changed, and then loops on bbl. but sometimes it's also .aux, or only .bbl.

I did look for related issues, and there is a related discussion here (even though the topic is about biblatex, the discussion then goes in other directions) https://github.com/tectonic-typesetting/tectonic/issues/195#issuecomment-546290732

Same thing on the gnu version instead of musl. Same problem happens with and without --keep-intermediates (generally, the intermediates seem to be completely ignored)

Thanks for tectonic, btw 😄

❯ tectonic15-musl --keep-intermediates paper.tex 2>| rg rerun
Running TeX ...
Running BibTeX on paper.aux ...
note: warnings were issued by BibTeX; use --print and/or --keep-logs for details.
Rerunning TeX because bibtex was run ...
Rerunning TeX because "paper.bbl" changed ...
Rerunning TeX because "paper.bbl" changed ...
Rerunning TeX because "paper.bbl" changed ...
Rerunning TeX because "paper.bbl" changed ...
Rerunning TeX because "paper.bbl" changed ...
Running xdvipdfmx ...
warning: TeX rerun seems needed, but stopping at 6 passes
Writing `paper.bbl` (14.04 KiB)
Writing `paper.out` (2.13 KiB)
Writing `paper.aux` (7.46 KiB)
Writing `paper.pdf` (152.59 KiB)

❯ tectonic14-musl --keep-intermediates paper.tex 2>| rg rerun
Running TeX ...
Running BibTeX on paper.aux ...
note: warnings were issued by BibTeX; use --print and/or --keep-logs for details.
Rerunning TeX because bibtex was run ...
Running xdvipdfmx ...
Writing `paper.out` (2.13 KiB)
Writing `paper.pdf` (152.59 KiB)
Writing `paper.bbl` (14.04 KiB)
Writing `paper.aux` (7.46 KiB)
CraftSpider commented 9 months ago

Tectonic .15 included porting the BibTeX C code to Rust - it's possible that caused something in the retry logic to break, for example if opening files from Rust instead of C changes the last-write time even if no writes are made or something. I'll try to take a look at some point, alternatively, I'd be willing to assist anyone in understanding the relevant parts of the code base if someone else wants to pick this up.

CraftSpider commented 9 months ago

Should be fixed by #1155, please re-open if that doesn't fix this once released.