Bug 451238 - Project/Build-Plugin + .kateproject is buggy
Summary: Project/Build-Plugin + .kateproject is buggy
Status: RESOLVED NOT A BUG
Alias: None
Product: kate
Classification: Applications
Component: application (show other bugs)
Version: 21.12.3
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-07 13:14 UTC by Lothar
Modified: 2022-10-03 20:01 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lothar 2022-03-07 13:14:08 UTC
SUMMARY

Don't work as described
https://docs.kde.org/stable5/en/kate/kate/kate-application-plugin-projects.html

STEPS TO REPRODUCE
1.   Copy&Paste from link to root of one of you projects as .kateproject 
{
  "name": "Kate"
, "files": [ { "git": 1 } ]
, "build": {
    "directory": "build"
  , "build": "make all"
  , "clean": "make clean"
  , "install": "make install"
  }
}

2. Open your project with Kate 

OBSERVED RESULT
The install target is not shown in the build-plugin

EXPECTED RESULT
Well, "install target" to be shown
When adding more lines (targets) to  .kateproject like 
    , "config": "cmake .. -DCMAKE_BUILD_TYPE=Debug..."
to be shown as well

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:  Arch, Kate 21.12.3, Frameworks 5.91.0

ADDITIONAL INFORMATION
When you modify "name": "Kate" to "name": "FooBar" is the new name not shown in the Project Page after clicking the reload buton on Project Page (between close button und combo box) You need to close/open Kate
Comment 1 Lothar 2022-03-07 14:40:41 UTC
Just more 2 Cents: 
Why is .kateproject not used directly by the build plugin but indirectly via project? The project don't need the build part of the file. And it would also be nice you could configure the build plugin this way without the need of the project plugin.
Comment 2 Lothar 2022-03-07 15:06:47 UTC
Sorry, one more: How about to configure these all in .kateconfig (instead or at least) optionally?
Comment 3 Christoph Cullmann 2022-03-07 15:11:38 UTC
e.g. the CMake generator generates .kateproject files with the proper build info.
Therefore we can't just alter this without breaking compatibility.

I fail to see the issue with the build plugin using that info indirectly via the project plugin.
What is the issue with having that plugin active?
The overhead is minimal and the project plugin will e.g. signal changes of the file, too, without having to duplicate this functionality in the other plugin.

The .kateconfig format predates the .kateproject and provides only mode line level configuration for the editor component.
I don't see how mixing other configs into that file will help.
Comment 4 Lothar 2022-03-07 15:57:17 UTC
> CMake generator

What? :-)

> Therefore we can't just alter this without breaking compatibility.

Fine. Keep it.

> I fail to see the issue with the build plugin using that info indirectly via the project plugin. 

Looks to me like (in Denglish): from behind through the chest into the eye

> What is the issue with having that plugin active?

Oh, it's so far pretty nice. I question only the way the build config is read.

> the project plugin will e.g. signal changes of the file, too, without having to duplicate this functionality in the other plugin.

What duplicate functionality? When I will run "make" I click a button or Short-Cut and the build plugin do a nice job, when it is configured correctly.

What about the main issue? Could you reproduce it?
Comment 5 Kåre Särs 2022-03-07 18:26:01 UTC
This is install target not showing up is a problem in the build plugin...
Comment 6 Christoph Cullmann 2022-03-07 19:49:52 UTC
(In reply to Kåre Särs from comment #5)
> This is install target not showing up is a problem in the build plugin...

In the CMake generated files most targets are inside a targets

"targets":[
                         {"name":"all", "build_cmd":"/usr/bin/ninja -C \"/home/cullmann/projects/kde/build/kate\"  all"}

sub structure.

They all show up for me, if I am not mistaken.
Comment 7 Kåre Särs 2022-03-08 06:00:46 UTC
Yeah, I think I was too quick to draw conclusions. I saw the code path for old project files (< 4.12). in those times we only had build, clean, quick targets.... I do not use the handwritten project file nor the CMake generated so I am oblivious to any bugs there...
Comment 8 Lothar 2022-03-08 06:37:12 UTC
> The .kateconfig format predates the .kateproject and provides only mode line level configuration for the editor component.
> I don't see how mixing other configs into that file will help.

Yes, it's off topic, but one last note/try.
The build plugin is stand alone, and so it should be ok that in can be configured on its own.

This file which "provides only mode line level configuration" is called .kateconfig so why not put more stuff there? I don't like to suggest to use the same JASON format, that would be odd.

Based on https://docs.kde.org/stable5/en/kate/katepart/config-variables.html it could looks like this with the given example:

  kate-plugin-build-Kate-directory: build
  kate-plugin-build-Kate-build: make all
  kate-plugin-build-Kate-clean: make clean
  kate-plugin-build-Kate-install: make install

In general
  <PluginId>-<PluginCustomKeyAndOrData>

With 
  <PluginId>=kate-plugin-build
  Kate=TargetGroup
  directory=Directory
  build=TargetName(1)
  clean=TargetName(2)
  install=TargetName(3)
  :foo=Data

It would be nice, when in case of such a config is present, the plugin would suppress it's default target group. It's always irritating.
Comment 9 Christoph Cullmann 2022-03-13 20:45:13 UTC
(In reply to Lothar from comment #8)
> > The .kateconfig format predates the .kateproject and provides only mode line level configuration for the editor component.
> > I don't see how mixing other configs into that file will help.
> 
> Yes, it's off topic, but one last note/try.
> The build plugin is stand alone, and so it should be ok that in can be
> configured on its own.
> 
> This file which "provides only mode line level configuration" is called
> .kateconfig so why not put more stuff there? I don't like to suggest to use
> the same JASON format, that would be odd.
> 
> Based on https://docs.kde.org/stable5/en/kate/katepart/config-variables.html
> it could looks like this with the given example:
> 
>   kate-plugin-build-Kate-directory: build
>   kate-plugin-build-Kate-build: make all
>   kate-plugin-build-Kate-clean: make clean
>   kate-plugin-build-Kate-install: make install
> 
> In general
>   <PluginId>-<PluginCustomKeyAndOrData>
> 
> With 
>   <PluginId>=kate-plugin-build
>   Kate=TargetGroup
>   directory=Directory
>   build=TargetName(1)
>   clean=TargetName(2)
>   install=TargetName(3)
>   :foo=Data
> 
> It would be nice, when in case of such a config is present, the plugin would
> suppress it's default target group. It's always irritating.

I think this goes in the total wrong direction.

With the JSON .kateproject we have some proper (even standardized) format that we can extend.
CMake already generates the right content there for e.g. the build plugin.
I don't think we should now start to invent yet-another-not-standardized format for content in some pseudo plain text.

And I somehow don't see why it is a issue that build plugin relies on some stuff from the projects plugin.
It is actually very natural that way around.
The same for the search plugin, it relies on the project info naturally, too, to search in the project files.

If the project plugin would lead to some tremendous overhead I could understand the arguing but I think it is actually very light weight.
Comment 10 Lothar 2022-03-14 14:06:57 UTC
Sorry for the noise. I have done some new report in the hope that I am not completely wrong with my view of things
 
https://invent.kde.org/utilities/kate/-/issues/56

> The same for the search plugin, it relies on the project info naturally, too, to search in the project files.

Here, the additional option is very well understood and does not cause any trouble.
Comment 11 Waqar Ahmed 2022-10-03 20:01:18 UTC
Since this has moved to a gitlab discussion and I can't really tell what this bug is about, I am closing it