James-Yu / LaTeX-Workshop

Boost LaTeX typesetting efficiency with preview, compile, autocomplete, colorize, and more.
MIT License
10.54k stars 522 forks source link

Cleaner seems to ignore Docker settings #4320

Closed micturkey closed 1 month ago

micturkey commented 1 month ago

Please fill the following fields with a star (*) and provide as much related information as possible.

Pre-checks*

Please change the following [ ] to [x] for confirmation.

  • [x] The issue has not been reported in this repository.
  • [x] The issue remains after disabling all other extensions and restarting Visual Studio Code.
  • [x] The FAQ cannot address the issue.
  • [x] The issue is not related to compiling a document, or the document can be successfully compiled in the OS terminal but not in Visual Studio Code with this extension.

Environment*

Please write exact version numbers instead of descriptors such as latest.

  • Operating System: [e.g. Windows 10] Windows 11
  • Visual Studio Code Version: [e.g. 1.41.0] 1.91.1
  • LaTeX Workshop Version: [e.g. 8.5.0] v10.1.0
  • TeX Distribution Version: [e.g. TeX Live 2019 / MiKTeX 2.9.7250] Tex Live 2024 from texlive/texlive:latest

The Issue*

Please briefly describe the issue you come across.

  • When I tried to use clean command or autoclean function, nothing was removed.
  • The "�����ڲ����ⲿ���Ҳ���ǿ����еij��� ���������ļ���" below in logs is Chinese where Windows tells that there is no command called latexmk.
  • It seems that the Cleaner does not follow the routine like Build to use latexmk in Docker.
  • I checked cleaner.ts and build.ts and found nothing about Docker in cleaner.ts.
  • I am not familiar with Node.js or TypeScript, but I think this is why the issue happens.

Reproduction Steps

Please list out the steps to reproduce your bug. Include relevant environmental variables or any other configuration.

  1. set latex-workshop.docker.enabled to true and latex-workshop.docker.image.latex to texlive/texlive
  2. Build PDF smoothly.
  3. Try Cleaner.

Expected Behavior

What were you expecting to see? Include any relevant examples or documentation links.

  • I expect the file like *.aux to be deleted.

Logs

LaTeX Workshop Output*

Please paste the whole log messages below, not parts of ones. The log should start with New log placeholder %WS1% registered.

[22:21:39.827][Extension] Initializing LaTeX Workshop.
[22:21:40.385][Build][Recipe] Set $LATEXWORKSHOP_DOCKER_LATEX: "texlive/texlive"
[22:21:40.386][Build][Recipe] Set $LATEXWORKSHOP_DOCKER_PATH: "docker"
[22:21:40.529][Server] Creating LaTeX Workshop http and websocket server.
[22:21:40.667][Format][Bib] Bibtex format config: {"tab":"  ","case":"lowercase","left":"{","right":"}","trailingComma":false,"sort":["key"],"alignOnEqual":true,"sortFields":false,"fieldsOrder":[],"firstEntries":["string","xdata"]}
[22:21:40.784][Server] Server successfully started: {"address":"127.0.0.1","family":"IPv4","port":15959} .
[22:21:40.786][Extension] Extension root: c:\Users\zhaidoudou123\.vscode\extensions\james-yu.latex-workshop-10.1.0
[22:21:40.786][Extension] $PATH: C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\VMware\VMware Workstation\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\mingw64\bin;C:\Spin;C:\Program Files\dotnet\;D:\adb-tools;C:\Program Files\nodejs\;C:\Program Files\Calibre2\;C:\Program Files\Graphviz\bin;C:\Program Files\Docker\Docker\resources\bin;C:\Program Files\Java\jdk-22\bin;C:\Program Files\Java\jdk-22\jre\bin;C:\Program Files\PowerShell\7\;C:\Users\zhaidoudou123\AppData\Local\Microsoft\WindowsApps;C:\Users\zhaidoudou123\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\zhaidoudou123\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts;C:\Users\zhaidoudou123\AppData\Roaming\npm;C:\Program Files (x86)\Nmap;C:\Users\zhaidoudou123\anaconda3\;C:\Users\zhaidoudou123\anaconda3\Library\bin\;C:\Users\zhaidoudou123\anaconda3\Scripts\;C:\Users\zhaidoudou123\anaconda3\condabin\
[22:21:40.786][Extension] $SHELL: undefined
[22:21:40.786][Extension] $LANG: undefined
[22:21:40.787][Extension] $LC_ALL: undefined
[22:21:40.787][Extension] process.platform: win32
[22:21:40.788][Extension] process.arch: x64
[22:21:40.788][Extension] vscode.env.appName: Visual Studio Code
[22:21:40.788][Extension] vscode.env.remoteName: undefined
[22:21:40.788][Extension] vscode.env.uiKind: 1
[22:21:40.798][Config] latex-workshop.latex.autoClean.run: "onBuilt" .
[22:21:40.799][Config] latex-workshop.latex.clean.fileTypes: ["%DOCFILE%.aux","%DOCFILE%.bbl","%DOCFILE%.blg","%DOCFILE%.idx","%DOCFILE%.ind","%DOCFILE%.lof","%DOCFILE%.lot","%DOCFILE%.out","%DOCFILE%.toc","%DOCFILE%.acn","%DOCFILE%.acr","%DOCFILE%.alg","%DOCFILE%.glg","%DOCFILE%.glo","%DOCFILE%.gls","%DOCFILE%.fls","%DOCFILE%.log","%DOCFILE%.fdb_latexmk","%DOCFILE%.snm","%DOCFILE%.nav","%DOCFILE%.vrb"] .
[22:21:40.817][Config] latex-workshop.docker.enabled: true .
[22:21:40.817][Config] latex-workshop.docker.image.latex: "texlive/texlive" .
[22:21:40.829][Extension] Trigger characters for intellisense of LaTeX documents: ["\\",",","{","}"]
[22:21:40.831][Root] Current workspace folders: undefined
[22:21:40.832][Extension] LaTeX Workshop initialized.
[22:21:40.833][Root] Found root file from active editor: c:\Users\zhaidoudou123\Desktop\test.tex
[22:21:40.833][Root] Root file changed: from c:\Users\zhaidoudou123\Desktop\test.tex to c:\Users\zhaidoudou123\Desktop\test.tex, langID latex . Refresh dependencies
[22:21:40.833][Event] ROOT_FILE_CHANGED: "c:\\Users\\zhaidoudou123\\Desktop\\test.tex"
[22:21:40.834][Cacher][Watcher] Reset.
[22:21:40.835][Cacher][Watcher] Reset.
[22:21:40.840][Cacher] Adding c:\Users\zhaidoudou123\Desktop\test.tex .
[22:21:40.841][Cacher][Watcher] Watched c:\Users\zhaidoudou123\Desktop\test.tex with a new .* watcher on c:\Users\zhaidoudou123\Desktop .
[22:21:40.841][Event] FILE_WATCHED: "c:\\Users\\zhaidoudou123\\Desktop\\test.tex"
[22:21:40.843][Cacher] Caching c:\Users\zhaidoudou123\Desktop\test.tex .
[22:21:40.843][Event] ROOT_FILE_SEARCHED
[22:21:40.851][Server] valdOrigin is http://127.0.0.1:15959
[22:21:40.873][Cacher] Updated inputs of c:\Users\zhaidoudou123\Desktop\test.tex .
[22:21:40.874][Cacher] Parse LaTeX AST: c:\Users\zhaidoudou123\Desktop\test.tex .
[22:21:40.893][Cacher] Parsed LaTeX AST in 19.00 ms: c:\Users\zhaidoudou123\Desktop\test.tex .
[22:21:40.894][File] Calling kpsewhich to resolve article.cls .
[22:21:40.963][File] kpsewhich returned with non-zero code 1.
[22:21:40.965][Cacher] Updated elements in 71.70 ms: c:\Users\zhaidoudou123\Desktop\test.tex .
[22:21:40.966][Event] FILE_PARSED: "c:\\Users\\zhaidoudou123\\Desktop\\test.tex"
[22:21:40.968][Structure] Structure force updated with 0 root sections for c:\Users\zhaidoudou123\Desktop\test.tex .
[22:21:40.968][Event] STRUCTURE_UPDATED
[22:21:41.004][Cacher] Parsing .fls c:\Users\zhaidoudou123\Desktop\test.fls .
[22:21:41.034][Cacher] Found .aux c:\Users\zhaidoudou123\Desktop\test.aux from .fls c:\Users\zhaidoudou123\Desktop\test.fls , parsing.
[22:21:41.035][Cacher] Parsed .aux c:\Users\zhaidoudou123\Desktop\test.aux .
[22:21:41.035][Cacher] Parsed .fls c:\Users\zhaidoudou123\Desktop\test.fls .
[22:21:43.677][Commander] SHOWLOG command invoked: default
[22:21:46.058][Event] STRUCTURE_UPDATED
[22:21:48.059][Extension] onDidSaveTextDocument triggered: file:///c:/Users/zhaidoudou123/Desktop/test.tex
[22:21:48.123][Cacher][Watcher] "change" emitted on c:\Users\zhaidoudou123\Desktop\test.tex.
[22:21:48.124][Cacher] Caching c:\Users\zhaidoudou123\Desktop\test.tex .
[22:21:48.124][Build] Auto build started detecting the change of a file: c:\Users\zhaidoudou123\Desktop\test.tex .
[22:21:48.124][Event] AUTO_BUILD_INITIATED: {"type":"onFileChange","file":"c:\\Users\\zhaidoudou123\\Desktop\\test.tex"}
[22:21:48.125][Build] The document of the active editor: file:///c:/Users/zhaidoudou123/Desktop/test.tex
[22:21:48.125][Build] The languageId of the document: latex
[22:21:48.125][Build] Building root file: c:\Users\zhaidoudou123\Desktop\test.tex
[22:21:48.125][Build][Recipe] Build root file c:\Users\zhaidoudou123\Desktop\test.tex
[22:21:48.125][Event] FILE_CHANGED: "c:\\Users\\zhaidoudou123\\Desktop\\test.tex"
[22:21:48.126][Cacher][Watcher] "change" emitted on c:\Users\zhaidoudou123\Desktop\test.tex.
[22:21:48.127][Cacher] Caching c:\Users\zhaidoudou123\Desktop\test.tex .
[22:21:48.128][Build] Auto build started detecting the change of a file: c:\Users\zhaidoudou123\Desktop\test.tex .
[22:21:48.128][Event] AUTO_BUILD_INITIATED: {"type":"onFileChange","file":"c:\\Users\\zhaidoudou123\\Desktop\\test.tex"}
[22:21:48.128][Build] Autobuild temporarily disabled.
[22:21:48.128][Event] FILE_CHANGED: "c:\\Users\\zhaidoudou123\\Desktop\\test.tex"
[22:21:48.131][Build][Recipe] Preparing to run recipe: latexmk.
[22:21:48.132][Build][Recipe] Prepared 1 tools.
[22:21:48.132][Build][Recipe] Use Docker to invoke the command.
[22:21:48.171][Build][Recipe] Cannot run `pdflatex` to determine if we are using MiKTeX.
[22:21:48.171][Build][Recipe] outDir: c:\Users\zhaidoudou123\Desktop .
[22:21:48.173][Build] Recipe step 1 The command is c:\Users\zhaidoudou123\.vscode\extensions\james-yu.latex-workshop-10.1.0\scripts\latexmk.bat:["-synctex=1","-interaction=nonstopmode","-file-line-error","-pdf","-outdir=./","test"].
[22:21:48.174][Build] env: {}
[22:21:48.174][Build] root: c:\Users\zhaidoudou123\Desktop\test.tex
[22:21:48.174][Build] cwd: c:\Users\zhaidoudou123\Desktop
[22:21:48.183][Build] LaTeX build process spawned with PID 744.
[22:21:48.189][Cacher] Updated inputs of c:\Users\zhaidoudou123\Desktop\test.tex .
[22:21:48.189][Cacher] Parse LaTeX AST: c:\Users\zhaidoudou123\Desktop\test.tex .
[22:21:48.190][Cacher] Updated inputs of c:\Users\zhaidoudou123\Desktop\test.tex .
[22:21:48.191][Cacher] Parse LaTeX AST: c:\Users\zhaidoudou123\Desktop\test.tex .
[22:21:48.192][Cacher] Parsed LaTeX AST in 2.32 ms: c:\Users\zhaidoudou123\Desktop\test.tex .
[22:21:48.192][File] Calling kpsewhich to resolve article.cls .
[22:21:48.247][File] kpsewhich returned with non-zero code 1.
[22:21:48.247][Cacher] Updated elements in 55.07 ms: c:\Users\zhaidoudou123\Desktop\test.tex .
[22:21:48.248][Event] FILE_PARSED: "c:\\Users\\zhaidoudou123\\Desktop\\test.tex"
[22:21:48.248][Cacher] Parsed LaTeX AST in 57.29 ms: c:\Users\zhaidoudou123\Desktop\test.tex .
[22:21:48.249][File] Calling kpsewhich to resolve article.cls .
[22:21:48.301][File] kpsewhich returned with non-zero code 1.
[22:21:48.301][Cacher] Updated elements in 52.79 ms: c:\Users\zhaidoudou123\Desktop\test.tex .
[22:21:48.302][Event] FILE_PARSED: "c:\\Users\\zhaidoudou123\\Desktop\\test.tex"
[22:21:48.303][Structure] Structure force updated with 0 root sections for c:\Users\zhaidoudou123\Desktop\test.tex .
[22:21:48.304][Event] STRUCTURE_UPDATED
[22:21:49.225][Build] Finished a step in recipe with PID 744.
[22:21:49.225][Build] Successfully built c:\Users\zhaidoudou123\Desktop\test.tex .
[22:21:49.226][Event] BUILD_DONE
[22:22:00.907][Commander] CLEAN command invoked.
[22:22:00.908][Root] Current workspace folders: undefined
[22:22:00.908][Root] Found root file from active editor: c:\Users\zhaidoudou123\Desktop\test.tex
[22:22:00.909][Root] Keep using the same root file: c:\Users\zhaidoudou123\Desktop\test.tex
[22:22:00.909][Event] ROOT_FILE_SEARCHED
[22:22:00.909][Event] STRUCTURE_UPDATED
[22:22:00.910][Cleaner] Clean temporary files command The command is latexmk:["-outdir=./","-c","c:\\Users\\zhaidoudou123\\Desktop\\test.tex"].
[22:22:00.970][Cleaner] Failed running cleaning command latexmk . Error: spawn latexmk ENOENT
[22:22:00.971]Error: spawn latexmk ENOENT
at notFoundError (c:\Users\zhaidoudou123\.vscode\extensions\james-yu.latex-workshop-10.1.0\node_modules\cross-spawn\lib\enoent.js:6:26)
at verifyENOENT (c:\Users\zhaidoudou123\.vscode\extensions\james-yu.latex-workshop-10.1.0\node_modules\cross-spawn\lib\enoent.js:40:16)
at ChildProcess.cp.emit (c:\Users\zhaidoudou123\.vscode\extensions\james-yu.latex-workshop-10.1.0\node_modules\cross-spawn\lib\enoent.js:27:25)
at Process.ChildProcess._handle.onexit (node:internal/child_process:294:12)
[22:22:00.972][STDERR] 'latexmk' �����ڲ����ⲿ���Ҳ���ǿ����еij���
���������ļ���

Developer Tools Console

Please paste the whole log messages below, not parts of ones. This console logs can sometimes be very important in many cases. To access the log, click Help -> Toggle Developer Tools -> Console.

[Paste the log here. Do not remove the surrounding backquotes (`).]

Anything Else?

Add any other context about the problem below.

James-Yu commented 1 month ago

You can use the globing option for cleaning method to not rely on latexmk.

micturkey commented 1 month ago

You can use the globing option for cleaning method to not rely on latexmk.

Thank you for your reply! It's working now. I'm a bit confused, though, why the default value is set to glob accoring to https://github.com/James-Yu/LaTeX-Workshop/wiki/Compile#cleaning-generated-files, but in my VSCode, it's set to command. 😂

jlelong commented 1 month ago

You can use the globing option for cleaning method to not rely on latexmk.

Thank you for your reply! It's working now. I'm a bit confused, though, why the default value is set to glob according to https://github.com/James-Yu/LaTeX-Workshop/wiki/Compile#cleaning-generated-files, but in my VSCode, it's set to command. 😂

That was an error. Now, it is fixed. Thanks.