Hartmut Goebel <h.goe...@crazy-compilers.com> writes:

> Hi,
>
> I don't understand what solution you propose.
>
> The GCD talks about setting some Env variable, like `GUIX_INTERPRETER_FILE` 
> and `GUIX_MAIN_SCRIPT_FILE` (for Python).
> What is happening then? Isn't there some code required for reading the files 
> in search-paths.d and set the variables
> accordingly?

Yes, those 2 variables will be used in GLib, and thus in other libraries
where need to patch in search-paths.d support.  See
<https://issues.guix.gnu.org/75688#26>.  In the function
g_build_guix_search_path_dirs, it need check if the current executable
is an interpreter script.  When it is, the /proc/self/exe must be the
same between we check it in Python and check it in GLib; otherwise it
had forked another executable.  Only under an interpreter script, we use
GUIX_MAIN_SCRIPT_FILE to get the location for the 'search-paths.d'
directory.  


> Regarding Python: There already is sys.executable. Why do we need 
> GUIX_INTERPRETER_FILE and GUIX_MAIN_SCRIPT_FILE?

The reading of search-paths.d will happend in C libraries (eg: GLib, GTK, Qt)
other than Python, it's the same process though, so we can use
environment variables to pass these information.

Reply via email to