Describe the bug
In Version 6.5.0 saving an imported subfile (\input{path/to/file}) does not trogger the build process anymore. Worked in Version 6.4.0.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Up to version 6.4.0 saving the subfile.tex started the build process as changing and saving the root.tex file still does.
Logs
There are no logs created.
Desktop (please complete the following information):
I have the same behavior with version 6.5.0. The auto-build process worked fine in version 6.4.0 when saving included files (using input{...}).
Looking at the LaTeX Workshop output log, it seems that the included .tex files are not being watched.
However, when I modify a bibtex bibliography (.bib) file (using \bibliography{file.bib}), the auto-build process is triggered as expected.
Downgrading the extension to version 6.4.0 works as expected.
Desktop:
OS: macOS 10.13.6
Extension version: 6.5.0
I cannot reproduce the issue. Can you please post the complete LW logs?
I created a new test project. The main document is test.tex, which includes subdoc.tex.
test.tex
\documentclass{article}
\begin{document}
Test
\input{subdoc.tex}
\end{document}
subdoc.tex
Sub document.
LW log:
[22:14:30] Initializing LaTeX Workshop.
[22:14:30] Creating LaTeX Workshop http and websocket server.
[22:14:30] LaTeX Workshop initialized.
[22:14:31] Server created on 127.0.0.1:53598
[22:14:31] Snippet data loaded.
[22:14:31] Try root file in root directory: /Users/luigi/Downloads/test/test.tex
[22:14:31] Parsing /Users/luigi/Downloads/test/test.tex
[22:14:31] Parsing /Users/luigi/Downloads/test/subdoc.tex
[22:14:31] Cannot find file /Users/luigi/Downloads/test/test.fls
[22:14:31] Found root file in root directory: /Users/luigi/Downloads/test/test.tex
[22:14:31] Root file changed from: undefined. Find all dependencies.
[22:14:31] Instantiating a new file watcher for /Users/luigi/Downloads/test/test.tex
[22:14:31] Parsing /Users/luigi/Downloads/test/test.tex
[22:14:31] Cannot find file /Users/luigi/Downloads/test/test.fls
[22:14:31] LaTeX Workshop version: 6.5.0
[22:15:52] Found root file from active editor: /Users/luigi/Downloads/test/test.tex
[22:15:52] Root file remains unchanged from: /Users/luigi/Downloads/test/test.tex.
[22:16:02] Parsing /Users/luigi/Downloads/test/test.tex
[22:16:02] Cannot find file /Users/luigi/Downloads/test/test.fls
[22:16:02] File watcher: responding to change in /Users/luigi/Downloads/test/test.tex
[22:16:02] /Users/luigi/Downloads/test/test.tex changed. Auto build project.
[22:16:02] BUILD command invoked.
[22:16:02] Found root file from active editor: /Users/luigi/Downloads/test/test.tex
[22:16:02] Root file remains unchanged from: /Users/luigi/Downloads/test/test.tex.
[22:16:02] Building root file: /Users/luigi/Downloads/test/test.tex
[22:16:02] Build root file /Users/luigi/Downloads/test/test.tex
[22:16:02] Recipe step 1: latexmk, -synctex=1,-interaction=nonstopmode,-file-line-error,-pdf,-outdir=/Users/luigi/Downloads/test,/Users/luigi/Downloads/test/test
[22:16:02] LaTeX build process spawned. PID: 17608.
[22:16:03] LaTeX log parsed with 0 messages.
[22:16:03] Recipe of length 1 finished. PID: 17608.
[22:16:03] Successfully built /Users/luigi/Downloads/test/test.tex.
[22:16:03] No PDF viewer connected for /Users/luigi/Downloads/test/test.pdf
[22:16:03] Parsing /Users/luigi/Downloads/test/test.fls to compute dependencies
[22:16:03] Parsing /Users/luigi/Downloads/test/test.tex
test.fls (in case it is needed)
PWD /Users/luigi/Downloads/test
INPUT /usr/local/texlive/2017/texmf.cnf
INPUT /usr/local/texlive/2017/texmf-dist/web2c/texmf.cnf
INPUT /usr/local/texlive/2017/texmf-var/web2c/pdftex/pdflatex.fmt
INPUT /Users/luigi/Downloads/test/test.tex
OUTPUT /Users/luigi/Downloads/test/test.log
INPUT /usr/local/texlive/2017/texmf-dist/tex/latex/base/article.cls
INPUT /usr/local/texlive/2017/texmf-dist/tex/latex/base/article.cls
INPUT /usr/local/texlive/2017/texmf-dist/tex/latex/base/size10.clo
INPUT /usr/local/texlive/2017/texmf-dist/tex/latex/base/size10.clo
INPUT /Users/luigi/Downloads/test/test.aux
INPUT /Users/luigi/Downloads/test/test.aux
OUTPUT /Users/luigi/Downloads/test/test.aux
INPUT /Users/luigi/Downloads/test/subdoc.tex
INPUT /Users/luigi/Downloads/test/subdoc.tex
OUTPUT /Users/luigi/Downloads/test/test.pdf
INPUT /usr/local/texlive/2017/texmf-var/fonts/map/pdftex/updmap/pdftex.map
INPUT /Users/luigi/Downloads/test/test.aux
INPUT /usr/local/texlive/2017/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb
I am experiencing this issue on Windows 10 too. No issues on 6.4.0, but the same project doesn't autobuild in 6.5.0.
I was experiencing a similar problem (MacOS 10.14.4). I created a minimal working example with the intention of posting and then found this thread.
I checked and downgrading to 6.4.0 solved the problem; but, curiously, that solve seems to have persisted with the autoupdate back to 6.5.0? In any case, I'm back on 6.5.0 and I can no longer reproduce the issue... I've got no clue how to explain that given that I could faithfully reproduce the issue across three projects, cleaned aux files, and both application and system restarts during the preceding four hours.
During my testing earlier, my logs consistently included the line Cannot find file build/minimal.fls even though the file did in fact exist at the specified location (verified via the terminal). On saves, the logs simply stated:
[16:46:21] Found root file by magic comment: /Users/samquinan/Thesis/minimal/minimal.tex
[16:46:21] Root file remains unchanged from: /Users/samquinan/Thesis/minimal/minimal.tex.
(n.b., /Users/samquinan/Thesis/minimal is the project folder containing the root minimal.tex, a separate build folder for the aux files and a chapter folder containing the included .tex files that I was updating)
Given what I've read about the role the .fls file essentially containing the project's dependency graph in the Multi-File Project documentation, I figured the fact that the .fls file wasn't being found was likely related to the watcher not seeing the saves (I could manually run the build command from the subfile and everything built properly).
It looks like @acuarica's posted log contains a number of similar messages, though I don't have my full logs to compare... I figured it was worth posting what I had anyway, just in case, though.
Same here on Windows 10 too.
OK, I have managed to reproduce the issue, which is due to imported files not being watched anymore. I am trying to figure out how it has been broken.
Thank you ! (Btw, same here on W10)
It still needs some serious testing, in particular related to #1298. I hope to have properly and completely fixed the dependency manager.
@jlelong I'm testing it now and there seems to be some regression from 6.5.0.
I've made some tests in a repository here. All of them work except the "Complicated Include" folder which has file A includes file B includes file B and some self-reference of B includes A and A includes B (through verbatim).
There's no issue with this with 6.5.0 however with the development version I get the following stack trace when I try the autobuild (and it doesn't build)
rejected promise not handled within 1 second: RangeError: Maximum call stack size exceeded
stack trace: RangeError: Maximum call stack size exceeded
at Manager.clearTexFileTree (c:\Users\Trevor\Documents\GitHub\LaTeX-Workshop\out\src\components\manager.js:476:21)
at Manager.clearTexFileTree (c:\Users\Trevor\Documents\GitHub\LaTeX-Workshop\out\src\components\manager.js:482:22)
at Manager.clearTexFileTree (c:\Users\Trevor\Documents\GitHub\LaTeX-Workshop\out\src\components\manager.js:482:22)
<duplicate lines omitted>
rejected promise not handled within 1 second: SyntaxError: Invalid regular expression: /(?:((?:\\(?:input|InputIfFileExists|include|subfile|(?:(?:sub)?import\*?{([^}]*)}))(?:\[[^\[\]\{\}]*\])?){([^}]*)})|((?:\\(part|chapter|section|subsection|subsubsection)(?:\*)?(?:\[[^\[\]\{\}]*\])?){(.*)}))/: Stack overflow
stack trace: SyntaxError: Invalid regular expression: /(?:((?:\\(?:input|InputIfFileExists|include|subfile|(?:(?:sub)?import\*?{([^}]*)}))(?:\[[^\[\]\{\}]*\])?){([^}]*)})|((?:\\(part|chapter|section|subsection|subsubsection)(?:\*)?(?:\[[^\[\]\{\}]*\])?){(.*)}))/: Stack overflow
at RegExp.exec (<anonymous>)
at SectionNodeProvider.buildModel (c:\Users\Trevor\Documents\GitHub\LaTeX-Workshop\out\src\providers\structure.js:100:31)
at SectionNodeProvider.buildModel (c:\Users\Trevor\Documents\GitHub\LaTeX-Workshop\out\src\providers\structure.js:175:22)
at SectionNodeProvider.buildModel (c:\Users\Trevor\Documents\GitHub\LaTeX-Workshop\out\src\providers\structure.js:175:22)
<duplicate lines omitted>
Hum, I already have the issue in 6.5.0 and this is related to the structure analyser this time not the autobuild feature.
@jlelong Yes, I can duplicate the issue with the structure analyser in 6.5.0 and the new version. However there is still an issue with clearTexFileTree which I have hopefully described well enough in #1341.
I hope everything is fixed now. @trevorgunn thanks for your tests!
@James-Yu I think everything has been fixed and we are ready for a new release.
Most helpful comment
OK, I have managed to reproduce the issue, which is due to imported files not being watched anymore. I am trying to figure out how it has been broken.