gdk-pixbuf: Use a different GDK_PIXBUF_MODULE_FILE environment variable on 32-bit and 64-bit systems.#60254
gdk-pixbuf: Use a different GDK_PIXBUF_MODULE_FILE environment variable on 32-bit and 64-bit systems.#60254ambrop72 wants to merge 1 commit intoNixOS:stagingfrom
Conversation
…le on 32-bit and 64-bit systems. Pull request NixOS#42562 caused a regression that running a 32-bit program that uses gdk-pixbuf would result in a crash because it would try to load a 64-bit library and fail. This change fixes this issue by patching gdk-pixbuf and many places where this variable is defined to use different variable names on 32-bit and 64-bit systems.
|
Note that in the referenced pull request #42562 there was a suggestion from @jtojnar that this could be solved by making sure librsvg included in wrappers and removing the variable setting from desktops. As already stated I agree with this approach, however the 32-bit program issue would still exist for any child processes of a wrapped program (e.g. if a terminal is a GTK app that is wrapped in this way), hence this pull request. |
Would not the child process be wrapped too with platform-correct modules? |
Certainly not all apps that use Anyway I am currently working on an idea to solve the problem of children inheriting variables set by wrappers, and it seems like there is a way with only minor modifications of programs. So I think we should just apply this as an immediate fix until we have a proper approach to such problems. |
|
Thank you for your contributions.
|
|
IMO we should do something like cc-wrapper's "suffix salt" to support multiple platforms more thoroughly than just |
|
I marked this as stale due to inactivity. → More info |
Pull request #42562 caused a regression that running a 32-bit program that uses
gdk-pixbuf would result in a crash because it would try to load a 64-bit
library and fail. This change fixes this issue by patching gdk-pixbuf and many
places where this variable is defined to use different variable names on
32-bit and 64-bit systems.
Motivation for this change
Fix regression running 32-bit programs.
This only intends to fix the 32-bit program issue. The situation is still a mess. The way I understand the situation is:
GDK_PIXBUF_MODULE_FILEsuch that all GTK apps will be able to load SVG icons. I presume this is because the desktop comes with SVG icons and the apps should be able to use the desktop-provided icons to integrate visually.GDK_PIXBUF_MODULE_FILEin the wrapper (the value comes from the gdk-pixbuf setup hook). In these cases the wrapper sets the variable to point to the cache file in librsvg.GDK_PIXBUF_MODULE_FILEin the wrapper without depending on librsvg, which results in the wraper setting the variable to the cache file from gdk-pixbuf. This wrapping might be to ensure the app works even ifGDK_PIXBUF_MODULE_FILEis set incorrectly (e.g. when NixOS is updated, if running outside NixOS) (if it is not set gdk-pixbuf will use its default cache file). Note that these apps will never support SVG icons even if the desktop sets the variable, because the wrapper overrides it! That's why I added a librsvg dependency to some apps, but I didn't check this for the many apps that get wrapped indirectly viawrapGAppsHook.My suggestion going forward would be to try to ensure that (almost?) all GTK apps are wrapped to set
GDK_PIXBUF_MODULE_FILEto the one from librsvg (yes, it results in a larger closure in some cases), and then remove the code in desktops to set the environment variable together with the gdk-pixbuf NixOS module.Things done
I have testes this on 19.03 branch and it seems to work as intended. I have checked that the correct variable is set by the gdk_pixbuf NixOS module and that the apps which set it in the wrapper set the correct variable. I have observed no breakage on my desktop system (KDE-based). I have tried running a 32-bit application (pavucontrol) and it does start and run (though there are errors loading 64-bit GVFS plugins).
sandboxinnix.confon non-NixOS)nix-shell -p nix-review --run "nix-review wip"./result/bin/)nix path-info -Sbefore and after)