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

Is this still necessary for modern Gtk4/Libadwaita programs? #60

Open
Korne127 opened this issue Nov 13, 2024 · 10 comments
Open

Is this still necessary for modern Gtk4/Libadwaita programs? #60

Korne127 opened this issue Nov 13, 2024 · 10 comments

Comments

@Korne127
Copy link

I've recently spent a lot of time looking into AppImages and how to package them.

I noticed that since this plugin has first been developed, the excludelist has been changed. Especially glib and its dependencies are now always bundled in AppImages, see this comment by @probonopd:

Looks like we arrived at the conclusion that Glib/Gdk/Gtk/Pango/Cairo from the operating system usually can't be used and the whole stack of these and other closely related (e.g., libthai and possibly harfbuzz) libraries all need to be privately bundled.

Therefore I am not entirely sure whether this plugin is required anymore. When I tested packaging my Gtk4/Libadwaita project, I noticed that this plugin doesn't seem to be necessary:
I created a new virtual machine and installed Arch on it (with X-Org, LXQt and Openbox) without any GTK dependencies. I then tested both version of my program (packaged with linuxdeploy) on it: One with the GTK plugin and one without. And both worked (without a different terminal output). So I'm not sure whether this plugin is necessary anymore.
For the record, I should mention that I do not use any icon assets of any theme in my project, so I don't know whether the plugin changes anything related to that though.

I did notice one major difference though: While my GTK code uses Libadwaita, the AppImage without this plugin was displayed correctly (with the Libadwaita theme) while the version built with this plugin was displayed with the default theme (as if I hadn't used Libadwaita but just GTK-4). So this is certainly a bug of this plugin that should be fixed. I would have made this a separate issue, but as I'm unsure whether the plugin is needed at all, I'll just keep it here for now.

@TheAssassin Can you maybe explain what this plugin actually does and what it changes with the AppImage? Is there still something I'm missing this plugin is required for? Or is it actually not necessary anymore for Gtk4/Libadwaita?

@TheTumultuousUnicornOfDarkness
Copy link
Collaborator

Well, I remember this plugin was required for GTK3 at least. It was a long time ago, but I faced a lot of compatibility issues without this plugin in the past, especially when the GTK version was not the same during the build (e.g. Ubuntu LTS) and the run (e.g. an up-to-date Arch Linux). The oldest supported version of Ubuntu for GitHub Runners is 20.04, meaning GTK 3.24 (AKA the latest GTK3 version).

[...] while the version built with this plugin was displayed with the default theme

Please refer to #39.

[...] is it actually not necessary anymore for Gtk4/Libadwaita?

The excludelist is from pkg2appimage, it is not related to linuxdeploy.
I did not invest time in GTK 4.x, because I lost interest with GTK (GTK 3.x was a burden between each minor releases). But I fixed a lot of issues with this plugin, like #1, #6, #8, #9, #10, #13 and #18.
I have no idea how you are building your AppImage, but the GTK4 libraries are somewhere. You can extract the AppImage to check the tree.

@Korne127
Copy link
Author

Hey, thanks for your detailed answer, I appreciate it.

The excludelist is from pkg2appimage, it is not related to linuxdeploy.

That's actually wrong! That excludelist is hosted on pkg2appimage, but it's used by most AppImage creation tools including Linuxdeploy. Linuxdeploy uses the excludelist that was up-to-date at compile-time of the release, see linuxdeploy/linuxdeploy#286.
So I still think that this might be the reason for it working, as the GTK libraries used to be on the excludelist, but got removed.

especially when the GTK version was not the same during the build (e.g. Ubuntu LTS) and the run (e.g. an up-to-date Arch Linux)

Yeah, that supports my thought, as by now AppImages only use the GTK version that's used during the build and shipped in the AppImage itself.

Please refer to #39.

Thanks for the link, that's interesting. Although it contradicts my experience a bit. In there, it is stated that Adwaita is hardcoded as a theme, but I have the problem that I have a normal Libadwaita application with the Adwaita theme and it is not used (instead, the old default theme is used as a fallback). Maybe I misunderstood something?

@TheTumultuousUnicornOfDarkness
Copy link
Collaborator

That's actually wrong! That excludelist is hosted on pkg2appimage, but it's used by most AppImage creation tools including Linuxdeploy. Linuxdeploy uses the excludelist that was up-to-date at compile-time of the release, see linuxdeploy/linuxdeploy#286.
So I still think that this might be the reason for it working, as the GTK libraries used to be on the excludelist, but got removed.

Ah, my bad, I was not aware of the generate-excludelist.sh script in linuxdeploy that relies on pkg2appimage excludelist, sorry.
Yes, it seems you are right because Glib and other stuff are no more part of the excludelist (AppImageCommunity/pkg2appimage@1e3ecde, AppImageCommunity/pkg2appimage@199fc9f).

My knowledge about Libadwaita is very limited. I cannot say if this plugin is still necessary for GTK4, maybe it depends of application needs (like GDK PixBufs).

@TheAssassin
Copy link
Member

Just a side note: @probonopd and I are currently looking into truly bundling everything in the future. Right now, linuxdeploy still relies on the excludelist.

@Korne127
Copy link
Author

@probonopd Can you maybe confirm whether bundling Glib makes this plugin unnecessary? I'd assume it does so, based on my personal tests, but it would still be good to have your insight.
@TheAssassin Thanks for the notice. I didn't know that; I just knew that there was an optional switch in go-appimage to ignore the excludelist, but not that this was something you plan on switching to long-term.

@TheAssassin
Copy link
Member

@probonopd Can you maybe confirm whether bundling Glib makes this plugin unnecessary? I'd assume it does so, based on my personal tests, but it would still be good to have your insight.

It wouldn't. You still need to bundle auxiliary files, e.g., gsettings schemas and other files. You'd need to bundle all of these files. And that's what such a plugin is good at.

optional switch in go-appimage to ignore the excludelist, but not that this was something you plan on switching to long-term.

The idea came up a few days ago. We're wrapping up open projects right now, e.g., AppImageLauncher's new release.

@Korne127
Copy link
Author

Korne127 commented Nov 26, 2024

You still need to bundle auxiliary files, e.g., gsettings schemas and other files. You'd need to bundle all of these files. And that's what such a plugin is good at.

Thank you for that answer. As I said, my primary question was whether this is still important and what exactly this plugin does, as I tried an AppImge built without it on distributions without anything GTK-related and didn't make any difference.

However, if it's necessary (or at least recommended) to do this, can you explain why this removes the Libadwaita theme (which is the default every modern GTK application moves) and makes the application appear in the fallback default theme which shouldn't be used?

@TheAssassin
Copy link
Member

I am not an expert on Gtk+ and I also don't claim that the plugin does not contain any flaws. Your question was "do you need this plugin" and the answer is yes. Most applications use Gtk+ 3 with this plugin, testing with Gtk+ 4 could be better.

Regarding your AppImage, you can always be lucky, but testing a single (possibly simple) application is too small of a sample size. This plugin has helped improve the look and feel of many applications. It's always possible that a single application doesn't need the functionality, but it certainly shouldn't harm. If it does, that's a bug of the plugin or maybe the plugin is used incorrectly.

Regarding your Adwaita problem, I think it should be tracked in a separate issue because the verdict of this one is "do you need this plugin at all" which was replied to with "yes".

@probonopd
Copy link
Contributor

@probonopd Can you maybe confirm whether bundling Glib makes this plugin unnecessary?

I would assume that it is still needed, because bundling GLib does not mean that the rest of Gtk is deploying itself.

@Korne127
Copy link
Author

Thanks to both of you for these answers :)
I know a single AppImage is not a big sample size, but as I noticed that it worked without it, I was just unsure about whether this is still generally necessary (especially with all the descriptions only talking about Gtk+2-3). I didn't want to implicate that this plugin hasn't had a purpose or hasn't helped people and I'm sorry if you took it that way; I was just wondering about whether the situation might have changed. So thanks for clarifying.

I wrote the Adwaita thing in the same issue as it was the only difference I noticed and therefore was an important factor to consider whether to use this plugin (as well as this question); so they were connected in my head. If you want me to move it though, I can do that tomorrow.

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

4 participants