Subject: [bug#75688] [PATCH 0/2] Introduce GUIX_LIBRARY_PATH to replace harmful environment variables

From: [email-masked]
Date: Mon, 20 Jan 2025 20:04:37 +0800

From: 宋文武 <[email-masked]>

Hello, we currently set many environment variables from search-paths, some can be harmful for
foreign system, which leading crash, eg: GDK_PIXBUF_MODULE_FILE, QT_PLUGIN_PATH, as reported in:

 <https://issues.guix.gnu.org/53514>
 <https://issues.guix.gnu.org/75523>
 <https://issues.guix.gnu.org/73897>

Instead of patch each software/library with its own environment variables (GUIX_GTK3_PATH, GUIX_QT_PLUGIN_PATH),
we can try patch all to calculate their from one GUIX_LIBRARY_PATH (default to ~/.guix-profile/lib), since the
problems mostly come from incompatible libraries ABI, so from "lib" construct its subdirectories should be enough.
eg:
  GTK3_PATH use: lib/gtk-3.0
  FCITX_ADDONS_DIRS use: lib/fcitx5

First patch add GUIX_LIBRARY_PATH to the default search paths, like PATH.
Second patch replace GDK_PIXBUF_MODULE_FILE with GUIX_LIBRARY_PATH.

If this is fine, I could work on replace QT_PLUGIN_PATH, etc. later.
What do you think?  Thank you! 

Sou Bunnbu (宋文武) (2):
  profiles: Add $GUIX_LIBRARY_PATH to default search paths.
  gnu: gdk-pixbuf: Respect GUIX_LIBRARY_PATH.

 gnu/local.mk                                  |  1 +
 gnu/packages/gtk.scm                          | 12 ++----
 ...gdk-pixbuf-respect-GUIX_LIBRARY_PATH.patch | 42 +++++++++++++++++++
 guix/build/profiles.scm                       |  1 +
 guix/profiles.scm                             |  8 ++--
 guix/search-paths.scm                         | 10 +++++
 6 files changed, 61 insertions(+), 13 deletions(-)
 create mode 100644 gnu/packages/patches/gdk-pixbuf-respect-GUIX_LIBRARY_PATH.patch

base-commit: c985075db3e6682d8a5a231c01c770aa5a147f72
-- 
2.47.1