Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plasma System Monitor's appstream id and component type get changed at build-time from what was specified in metainfo file #431

Closed
Pointedstick opened this issue Sep 7, 2022 · 8 comments

Comments

@Pointedstick
Copy link

Plasma's System Monitor app uses the desktop-application component type and id org.kde.plasma-systemmonitor, and this is reflected in the name of its metainfo and desktop files:

nate@Liberator:~/kde/src/plasma-systemmonitor$  (master) grep -ri "org\.kde\.plasma-systemmonitor"
CMakeLists.txt:61:install(PROGRAMS org.kde.plasma-systemmonitor.desktop  DESTINATION  ${KDE_INSTALL_APPDIR})
src/main.cpp:112:    aboutData.setDesktopFileName(QStringLiteral("org.kde.plasma-systemmonitor"));
org.kde.plasma-systemmonitor.metainfo.xml:7:  <id>org.kde.plasma-systemmonitor</id>
org.kde.plasma-systemmonitor.metainfo.xml:130:  <launchable type="desktop-id">org.kde.plasma-systemmonitor.desktop</launchable>
grep: .git/index: binary file matches

nate@Liberator:~/kde/src/plasma-systemmonitor$  (master) find . | grep -i "org\.kde\.plasma-systemmonitor"
114:./org.kde.plasma-systemmonitor.metainfo.xml
4936:./org.kde.plasma-systemmonitor.desktop

Nonetheless, at build-time, the metainfo file is renamed to org.kde.plasma.systemmonitor.appdata.xml and the content is split into multiple files:

nate@Liberator:~/kde/src/plasma-systemmonitor$  (master) ls ~/kde/usr/share/metainfo/ | grep -i monitor
125:org.kde.plasma.systemmonitor.appdata.xml
126:org.kde.plasma.systemmonitor.cpu.appdata.xml
127:org.kde.plasma.systemmonitor.cpucore.appdata.xml
128:org.kde.plasma.systemmonitor.diskactivity.appdata.xml
129:org.kde.plasma.systemmonitor.diskusage.appdata.xml
130:org.kde.plasma.systemmonitor.memory.appdata.xml
131:org.kde.plasma.systemmonitor.net.appdata.xml

Furthermore, its ID has been changed to org.kde.plasma.systemmonitor and its component type has been changed to addon!

nate@Liberator:~/kde/src/plasma-systemmonitor$  (master) head -n 4 /home/nate/kde/usr/share/metainfo/org.kde.plasma.systemmonitor.appdata.xml
<?xml version="1.0" encoding="UTF-8"?>
<component type="addon">
    <id>org.kde.plasma.systemmonitor</id>
    <extends>org.kde.plasmashell</extends>

This seems wrong and breaks detection in KDE's Kickoff; see extended discussion in https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2086#note_518577

@ximion
Copy link
Owner

ximion commented Sep 7, 2022

I've read this multiple times to try to figure out what the issue has to do with AppStream itself. Projects can generate anything they like, as long as the result:

  • Does not duplicate component IDs (one piece of software == one ID, non sharing allowed!)
  • The generated files ideally have the name %{cid}.metainfo.xml (although I think nothing relies on that, it's a nice convention
  • The resulting files validate with appstreamcli validate

Or do you mean that the system monitor app is not recognized as a launchable target because it makes itself an addon? In that case, the app needs to decide what it is: A think that can be individually launched, or an addon. Addons have different rules and are represented differently in software centers, see for example GNOME Software:
grafik

Addons are just checkboxes below the main app there.

So, to me this really looks like something upstream needs to sort out, unless I am missing some point here?

@Pointedstick
Copy link
Author

because it makes itself an addon.

...but as far as I can tell, it doesn't make itself an addon. I don't see where it would be setting that. As far as I can tell, in the metainfo file it marks itself as a desktop app: https://invent.kde.org/plasma/plasma-systemmonitor/-/blob/master/org.kde.plasma-systemmonitor.metainfo.xml#L6

So my perhaps incorrect conclusion was that there's an issue in AppStream itself that's inappropriately marking it as an addon, because we're not doing it in KDE--at least, not as far as I can tell.

@nicolasfella
Copy link
Contributor

nicolasfella commented Sep 7, 2022

nate@Liberator:~/kde/src/plasma-systemmonitor$ (master) ls ~/kde/usr/share/metainfo/ | grep -i monitor
125:org.kde.plasma.systemmonitor.appdata.xml
126:org.kde.plasma.systemmonitor.cpu.appdata.xml
127:org.kde.plasma.systemmonitor.cpucore.appdata.xml
128:org.kde.plasma.systemmonitor.diskactivity.appdata.xml
129:org.kde.plasma.systemmonitor.diskusage.appdata.xml
130:org.kde.plasma.systemmonitor.memory.appdata.xml
131:org.kde.plasma.systemmonitor.net.appdata.xml

I think those do not come from plasma-systemmonitor, those come from the systemmonitor applet in plasma-workspace

@Pointedstick
Copy link
Author

That would explain some things, as well as being confusing because they have the same user-facing name. So maybe the app's metainfo file isn't getting installed at all or something...?

@nicolasfella
Copy link
Contributor

Yes, plasma-systemmonitor doesn't actually install its metadata file

@Pointedstick
Copy link
Author

Oh. Well that's the problem then.

@Pointedstick
Copy link
Author

@ximion
Copy link
Owner

ximion commented Sep 7, 2022

Ah, so that explains the duplicate-component error on https://appstream.debian.org/sid/main/issues/plasma-sdk.html as well!
Very good to have this solved :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants