guile-devel
[Top][All Lists]
Advanced

[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


From: Mark H Weaver
Subject: Re: [PATCH] Don't augment LD_LIBRARY_PATH (was Re: [PATCH] do not augment environment)
Date: Sat, 06 Oct 2012 08:36:12 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

I wrote:
> I've read the message referenced above several times, but I've failed to
> understand why we cannot use 'lt_dladdsearchdir' to augment the path, as
> shown in the first code excerpt of that message:
>
>   env = getenv ("GUILE_SYSTEM_EXTENSIONS_PATH");
>
>   [...]
>
>   if (env)
>     lt_dladdsearchdir (env);
>   else
>     {
>       lt_dladdsearchdir (SCM_LIB_DIR);
>       lt_dladdsearchdir (SCM_EXTENSIONS_DIR);
>     }

Actually, I can already see a problem with this.  SCM_LIB_DIR is usually
(always?) already present in the library search paths before Guile is
initialized.  It is set to $(libdir) by libguile/Makefile.  Isn't
$(libdir) where libguile is installed?

A common case where this causes problems (the same one Bruce ran into)
is when SCM_LIB_DIR is /usr/lib, but the user has configured
/usr/local/lib to precede /usr/lib in the library search path.

Therefore, we must not add SCM_LIB_DIR to LD_LIBRARY_PATH, nor to
LTDL_LIBRARY_PATH, nor via 'lt_dladdsearchdir', or else we will reverse
the ordering of /usr/local/lib and /usr/lib that many people depend
upon.  The only possible option is to manually search it after all else
has failed, but it seems to me that we shouldn't be adding SCM_LIB_DIR
at all.  It should already be there.

SCM_EXTENSIONS_DIR is another matter.  It is unlikely to already be
present in the library search path, and in any case should not contain
anything other than Guile extensions.  Therefore, it is appropriate to
do: lt_dladdsearchdir (SCM_EXTENSIONS_DIR) unless
GUILE_SYSTEM_EXTENSIONS_PATH is set.

With this in mind, I now propose the following:

--8<---------------cut here---------------start------------->8---
  env = getenv ("GUILE_SYSTEM_EXTENSIONS_PATH");
  if (env)
    lt_dladdsearchdir (env);
  else
    lt_dladdsearchdir (SCM_EXTENSIONS_DIR);
--8<---------------cut here---------------end--------------->8---

and then to run the uninstalled guile, we'd need to set (or augment) one
of the *_LIBRARY_PATH environment variables to point within the build
directory, and also set GUILE_SYSTEM_EXTENSIONS_PATH.

What do you think?

On a related topic, why is libguilereadline-v-18.* installed in
SCM_LIB_DIR and not SCM_EXTENSIONS_DIR?

   Thanks,
     Mark



reply via email to

[Prev in Thread] Current Thread [Next in Thread]