From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.devel 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 Message-ID: <87r4pblqv7.fsf@tines.lan> References: <505CF9FC.9060007@gmail.com> <5069022C.9040600@netris.org> <87y5jnn8y4.fsf_-_@tines.lan> <877gr6j7ml.fsf@gnu.org> <87mx00mixi.fsf@tines.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1349526996 4793 80.91.229.3 (6 Oct 2012 12:36:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 6 Oct 2012 12:36:36 +0000 (UTC) Cc: Bruce Korb , guile-devel@gnu.org To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Oct 06 14:36:40 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TKTcT-0000BN-UP for guile-devel@m.gmane.org; Sat, 06 Oct 2012 14:36:38 +0200 Original-Received: from localhost ([::1]:43358 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKTcO-0000yb-1N for guile-devel@m.gmane.org; Sat, 06 Oct 2012 08:36:32 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41648) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKTcK-0000xy-Qv for guile-devel@gnu.org; Sat, 06 Oct 2012 08:36:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TKTcJ-0002a2-RW for guile-devel@gnu.org; Sat, 06 Oct 2012 08:36:28 -0400 Original-Received: from world.peace.net ([96.39.62.75]:46458) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKTcJ-0002Zt-NC; Sat, 06 Oct 2012 08:36:27 -0400 Original-Received: from 209-6-91-212.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.91.212] helo=tines.lan) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1TKTcC-0007lm-3U; Sat, 06 Oct 2012 08:36:20 -0400 In-Reply-To: <87mx00mixi.fsf@tines.lan> (Mark H. Weaver's message of "Fri, 05 Oct 2012 22:30:01 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 96.39.62.75 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:14933 Archived-At: 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