Bug 428989 - When are build plugin settings saved, if at all?
Summary: When are build plugin settings saved, if at all?
Status: RESOLVED WORKSFORME
Alias: None
Product: kate
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-11 21:40 UTC by LinG
Modified: 2023-01-04 06:03 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
kate_build_plugin.mp4 (1.47 MB, video/mp4)
2020-11-12 12:33 UTC, LinG
Details
full debug log (11.95 KB, text/x-log)
2020-11-15 12:10 UTC, LinG
Details

Note You need to log in before you can comment on or make changes to this bug.
Description LinG 2020-11-11 21:40:26 UTC
SUMMARY
I'm trying to use the build plugin to compile my LaTeX documents. It works fine, but whenever I close Kate and start it up again I lose all my build targets that I configured

STEPS TO REPRODUCE
1. Enable build plugin
2. open build output section (bottom)
3. go to target settings tab
4. add a new target
5. change the build command from the default (make) to xelatex %f
6. close kate
7. open kate
8. open build output section (bottom)
9. go to target settings tab

OBSERVED RESULT
Build targets are all reset to default

EXPECTED RESULT
My custom build targets are saved when kate is closed

SOFTWARE/OS VERSIONS
Latest ArchLinux packages

ADDITIONAL INFORMATION
I tried to add the custom build targets in a kate session, but that didn't save and restore the custom build targets either when re-opening kate
Comment 1 Kåre Särs 2020-11-12 11:55:44 UTC
Thanks for the report.

I think the problem is that you have not created a session specific to this task, and when you close and restart you open up the default session that does not have your settings.

So save the session and reopen this session when you want to compile your LaTeX document.

(Sessions -> Save Session)

Does that help?
Comment 2 LinG 2020-11-12 12:30:41 UTC
I tried it with a session as well and it didn't work either. I attached a recording
Comment 3 LinG 2020-11-12 12:33:27 UTC
Created attachment 133259 [details]
kate_build_plugin.mp4
Comment 4 Kåre Särs 2020-11-12 18:01:34 UTC
That is strange... I tried the same thing and it worked. Can you run Kate from the terminal and see if you get any error messages?

Use kdebugdialog5 to ensure that you have debug output enabled for Kate (enable all just in case)

Thanks,
  Kåre
Comment 5 LinG 2020-11-15 12:10:04 UTC
Created attachment 133354 [details]
full debug log

I turned on all debugging in kdebugsettings and wrote the output to this log file.

I then did these steps:

1. open kate with a file from terminal `kate catering.tex`
2. open build plugin bottom window and add a debug with name XeLaTeX, then change the default build command from `make` to `xelatex %f`
3. build once
4. save session as `new test`
5. close kate
6. start kate again (not in this log file) and observe de default build configuration
Comment 6 Kåre Särs 2020-11-15 13:15:09 UTC
Thanks for the info!

Hmm, really odd... I can't find anything (except the missing sonnet plugins)

I do have a small suspicion that it could be your installation/setup that is broken somehow, but I do not know...

Have you tried to add more "target sets"?
Comment 7 LinG 2020-11-15 17:15:08 UTC
Yes, but they all disappear and return tot the default values, once I close Kate and start it up again.

Where does kate save this build plugin information (so I can check if it's in there while kate is still open)? Also, all the settings of the external plugins save/load fine between closing and restarting. So I put my build commands in the external tools for now... but I would like to use the build plugin to define multiple targets (C++, LaTeX, VueJS, etc...)
Comment 8 LinG 2020-11-15 17:15:49 UTC
(It's a new laptop, that I just received last week and just installed Arch Linux on, so it's a fresh install with barely any history in it (1 week of history max)
Comment 9 Kåre Särs 2020-11-15 18:09:17 UTC
The build plugin configuration should be in session files under ~/.local/share/kate/sessions/

in each session file there should be a section [Plugin:katebuildplugin:MainWindow:0]


Here is one example Ii have
[Plugin:katebuildplugin:MainWindow:0]
0 BuildCmd build=make -j10
0 BuildCmd config=cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr ../
0 BuildCmd upload=make upload
0 BuildPath=/home/sars/sketchbook/car
0 Target=Target Set
0 Target Default=
0 Target Names=build,upload,config
Active Target Command=1
Active Target Index=0
NumTargets=1
Show Marks=false
Comment 10 LinG 2020-11-15 18:13:56 UTC
Yeah I found it. I did this:

1. start kate
2. change the build plugin command to xelatex %f and name to test
3. close kate
4. open ~/.local/share/kate/sessions/*name*

[Plugin:katebuildplugin:MainWindow:0]
0 BuildCmd build=xelatex %f
0 BuildCmd clean=make clean
0 BuildCmd config=cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr/local ../
0 BuildPath=
0 Target=Test
0 Target Default=
0 Target Names=build,clean,config
Active Target Command=0
Active Target Index=0
NumTargets=1
Show Marks=false

5. start kate
6. build plugin information is reset again to default
7. close kate
8. open ~/.local/share/kate/sessions/*name*

[Plugin:katebuildplugin:MainWindow:0]
0 BuildCmd build=make
0 BuildCmd clean=make clean
0 BuildCmd config=cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr/local ../
0 BuildPath=
0 Target=Target Set
0 Target Default=
0 Target Names=build,clean,config
Active Target Command=0
Active Target Index=0
NumTargets=1
Show Marks=false

So it seems like the data from the session is not loaded correctly at startup and it loads the default, and then when I close kate, then those default setting are written back to the session file
Comment 11 Kåre Särs 2020-11-15 18:40:21 UTC
To fix this we would have to know what happens in kate/addons/katebuild-plugin/plugin_katebuild.cpp line 237

What does Kate read here?


The thing is, for me this works fine....
Comment 12 LinG 2020-11-16 17:46:05 UTC
It doesn't even enter this method. I tried to std::cout the numTargets int but it never printed to the terminal, then I put a std::cout before the cg.readEntry in this function but it never printed that either

I then grepped the method and I guessed the katepluginmanager.cpp to handle this in line 126 where it does interface->readSessionConfig(group)

I put a std::cout before the if (auto interface = qobject_cast ...blablabla...) and a std::cout after this if statement, and I see the one before the if statement printed 9 times whereas the one inside the if statement that's supposed to call the readSession called 0 times.
Comment 13 LinG 2020-11-16 17:49:01 UTC
(I just checked out the kate source code from github and compiled it and am testing by running the kate binary in the bin directory)
Comment 14 Bug Janitor Service 2020-12-01 04:33:44 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 15 LinG 2020-12-01 06:07:18 UTC
Added info in previous comment
Comment 16 Waqar Ahmed 2022-12-20 20:15:25 UTC
The build plugin was massively overhauled for 22.12. Can you check if the issue is still reproducible?
Comment 17 LinG 2022-12-20 20:40:45 UTC
I am currently not running Kate for my dev work, so I don't have it installed anymore. However, if I do in the future start using Kate again, then I can always file a new report if the problem still persists. Probably best to close this issue for now, unless someone else wants to test this.

Thank you for taking the time to reply to this old issue.
Comment 18 Bug Janitor Service 2023-01-04 05:27:03 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 19 Waqar Ahmed 2023-01-04 06:03:07 UTC
Thanks, if you notice any issues feel free to reopen.