[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Don't augment LD_LIBRARY_PATH (was Re: [PATCH] do not augmen
Sjoerd van Leent Privé
Re: [PATCH] Don't augment LD_LIBRARY_PATH (was Re: [PATCH] do not augment environment)
Fri, 05 Oct 2012 11:43:01 +0200
Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0
Just a quick note. Now with GUILE_SYSTEM_EXTENSIONS_PATH, this could be
very practical when developing a module. However, if a module is already
present AND is inside SCM_LIB_DIR or SCM_EXTENSIONS_DIR, it would never
override that situation. I believe there should be a way to be able to
override the normal behavior.
On 10/03/2012 12:31 PM, Mark H Weaver wrote:
Here's a preliminary patch to avoid modifying LD_LIBRARY_PATH.
Following Bruce's suggestion, it causes 'sysdep_dynl_link' to manually
search additional directories if 'lt_dlopenext' fails to find the
library in the default paths. However, I took a somewhat different
approach, and tried to be more careful with regard to portability and
I read the code of libltdl, and mimicked their handling of path
separators and directory separators, to ensure that this patch will not
reduce our portability.
I also followed their lead in deciding when to perform a search. If any
directory separators are present (even if it's a relative pathname),
then libltdl does not perform a search. I used precisely the same
criterion to decide whether to search additional directories.
So what additional directories does it search?
If GUILE_SYSTEM_EXTENSIONS_PATH is set (even if it's empty), then it
specifies the additional directories to search. If it's unset, then the
default is to search SCM_LIB_DIR and SCM_EXTENSIONS_DIR.
*** Note that this changes the search order in the case where
GUILE_SYSTEM_EXTENSIONS_PATH is set to a non-empty string.
Currently, a non-empty GUILE_SYSTEM_EXTENSIONS_PATH is passed to
lt_dladdsearchdir, so it is searched before LTDL_LIBRARY_PATH and
LD_LIBRARY_PATH, but this patch causes GUILE_SYSTEM_EXTENSIONS_PATH to
be searched last, to be consistent with the handling of the default
directories SCM_LIB_DIR and SCM_EXTENSIONS_DIR. This seems sensible to
me. Does anyone see a problem with this change?
This patch also adds robust handling of the case where
GUILE_SYSTEM_EXTENSIONS_PATH contains more than one path component.
See below for my preliminary patch. I have not yet tested it carefully.
It's a context diff, because 'diff' made a mess of the unified diff.
Comments and suggestions solicited.
Re: [PATCH] Don't augment LD_LIBRARY_PATH (was Re: [PATCH] do not augment environment),
Sjoerd van Leent Privé <=