texstudio-org / texstudio

TeXstudio is a fully featured LaTeX editor. Our goal is to make writing LaTeX documents as easy and comfortable as possible.
http://www.texstudio.org/
GNU General Public License v3.0
2.74k stars 342 forks source link

Failed compilation due to inexisting output directory makes further compilations impossible (greyed out) until restart #3750

Closed e-dervieux closed 3 weeks ago

e-dervieux commented 1 month ago

Environment

This bug may be related to: https://github.com/texstudio-org/texstudio/issues/3371 https://github.com/texstudio-org/texstudio/issues/3254

Use case

Having a compilation command with an output directory, for instance:

lualatex -synctex=1 -output-directory out -interaction=nonstopmode TeXFileName.tex

if the directory out does not exist, a popup appears saying that the compilation is not possible.

image

Expected behavior

After this popup, we should be able to make further compilations, i.e. pressing F5 or F6, or clicking the "compile" or "compile and preview" buttons.

image

Actual behavior

After this popup, the "compile" and "compile and preview" buttons are greyed out, and the F5 and F6 shortcuts become ineffective. TeXStudio becomes completely stuck, and only quitting it and relaunching it makes the compilations options available again.

image

How to reproduce

Create a simple TeX file and try to compile it with the above-given compilation command.

octaeder commented 1 month ago

can't reproduce. Screenshots from message pane

image

and explorer

image

TeXstudio 4.8.2 (git 4.8.2alpha3-8-g54a467b95) Using Qt Version 6.7.2, compiled with Qt 6.7.2 R Win10

So I expect it to work in 4.8.1.

e-dervieux commented 1 month ago

Tested in 4.8.1 even with only a blank file -> BUG as reported.

I tried to grab the alpha3 here but neither the M1 ZIP version nor the DMG one did start: the app just crashes silently so I cannot test it.

sunderme commented 1 month ago

my guess is that the search path for pdf and log is not set. Both need to be set to "out" as well.

grafik
octaeder commented 1 month ago

I didn't set additional search paths. While my first test may be a little bit special in that it is an msys2/linux shell, I now made a second test with 4.8.0 which I have still installed on the same win10 system. Again, I found no issue. Folder out is created where the tex file is located.

e-dervieux commented 1 month ago

Just to be clear: the issue is arising when the folder "out" does NOT exist, and you try to compile anyway. If the folder "out" do exist where the .tex file is located, there is no issue.

@octaeder, you wrote "Folder out is created where the tex file is located", you mean that if the "out" folder does not exist in your system, compiling the .tex file creates it? In this case, I can assure you that TS does not behave this way in MacOS.

Note: @sunderme, I do have "out" in my additional Log and PDF search paths.

sunderme commented 1 month ago

the folder out needs to be generated by lualatex, txs has no input in this. Please debug the issue on command line on your system. Maybe OSX does not allow the folder generation ?

octaeder commented 1 month ago

Before first test there was no folder out, and before second test I deleted it.

e-dervieux commented 1 month ago

OK, so I ran lualatex -synctex=1 -output-directory out -interaction=nonstopmode test.tex from the terminal, wherein test.tex is an empty file. This yields the following output:

This is LuaHBTeX, Version 1.16.0 (TeX Live 2023) 
 restricted system commands enabled.
! I can't write on file `test.log'.
Please type another transcript file name
! Emergency stop
!  ==> Fatal error occurred, no output PDF file produced!%

But even though it comes from some MacOSesque oddity, there is still a bug in TS which should not be stuck until next restart, I think.

Note: if it may help from a debugging point of view, in TS, once the compilation is stuck for the above-mentioned reasons (error message + greyed out buttons), if I set another .tex file as explicit master file, the compilation options enable again. I can then unset this latter file's explicit master role and try again to compile my test.tex file (which unsurprisingly leads to the same error message and greying out of the compilation buttons).

sunderme commented 3 weeks ago

I have not been able to reproduce that "stuck" behavior on linux. No idea what OSX does to get into that state. But since the main issue was that lualatex was not working properly, I will close this.