guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Extension search path changed in 1.9


From: Ludovic Courtès
Subject: Extension search path changed in 1.9
Date: Tue, 23 Nov 2010 21:56:24 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux)

Hello!

‘sysdep_dynl_init’ has been doing this for some time in 1.9:

--8<---------------cut here---------------start------------->8---
  env = getenv ("GUILE_SYSTEM_EXTENSIONS_PATH");

  [...]

  if (env)
    lt_dladdsearchdir (env);
  else
    {
      lt_dladdsearchdir (SCM_LIB_DIR);
      lt_dladdsearchdir (SCM_EXTENSIONS_DIR);
    }
--8<---------------cut here---------------end--------------->8---

While these functions /append/ their argument to ltdl’s search path,
said path (‘user_search_path’ in ltdl.c) actually prevails over
$LTDL_LIBRARY_PATH and $LD_LIBRARY_PATH:

--8<---------------cut here---------------start------------->8---
static int
try_dlopen (lt_dlhandle *phandle, const char *filename, const char *ext,
            lt_dladvise advise)
{

[...]

          const char *search_path = user_search_path;

          if (search_path)
            file = find_file (user_search_path, base_name, &dir);

          if (!file)
            {
              search_path = getenv (LTDL_SEARCHPATH_VAR);
              if (search_path)
                file = find_file (search_path, base_name, &dir);
            }

[...]

}
--8<---------------cut here---------------end--------------->8---

(See
<http://git.savannah.gnu.org/cgit/libtool.git/tree/libltdl/ltdl.c#n1342>.)

This introduces a difference compared to 1.8.

In 1.8, to run the test suite of libguile-foo from its build tree, I
typically had a ‘pre-inst-guile’ like this:

--8<---------------cut here---------------start------------->8---
exec @abs_top_builddir@/libtool --mode=execute                  \
       -dlopen "@abs_top_builddir@/src/libguile-foo.la" \
       @GUILE@ "$@"
--8<---------------cut here---------------end--------------->8---

which amounts to “LD_LIBRARY_PATH=$PWD/src/.libs:$LD_LIBRARY_PATH” on
GNU/Linux.

However, this no longer works with 2.0: if libguile-foo.so is already
present in SCM_EXTENSIONS_DIR, then it will be loaded instead of the one
from the build tree.

In 2.0, the script above can be fixed by preceding the guile invocation
by:

--8<---------------cut here---------------start------------->8---
GUILE_SYSTEM_EXTENSIONS_PATH="@abs_top_builddir@/src"
export GUILE_SYSTEM_EXTENSIONS_PATH
--8<---------------cut here---------------end--------------->8---

I’m not sure what can be done.  We could document
$GUILE_SYSTEM_EXTENSIONS_PATH.

I suspect it may hit other Guile users, so at least this message
documents the problem.  :-)

Thanks,
Ludo’.




reply via email to

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