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

From: Maxim Cournoyer <[email-masked]>
Date: Mon, 20 Jan 2025 23:00:57 +0900

Hello,

[email-masked] writes:

> 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

Instead of reconstructing the paths from something like the suggested
new GUIX_LIBRARY_PATH, I think it'd be nice if additionally to the stock
environment variables supported by each software, we introduced GUIX_
prefixed variants such as GUIX_GTK3_PATH and GUIX_QT_PLUGIN_PATH which
would be used by the Guix search paths specifications defined on these
packages.

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

For the GDK_PIXBUF_MODULE_FILE special case, the problem is foremost
that it's a single entry value; as mentioned previously it'd be nice if
we could contribute a true multi-items variant named
GDK_PIXBUF_MODULE_FILES that could point to more than one file.
Alternatively we could use GUIX_GDK_PIXBUF_MODULE_FILE.  But I don't see
why we should use an intermetate GUIX_LIBRARY_PATH to compute all the
other correct paths; this should be left to the search paths, in my
opinion (as it's simpler, cleaner).

Thanks for the initiative!  Let me know if I misunderstood something.

-- 
Maxim