From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Sjoerd_van_Leent_Priv=E9?= Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] Don't augment LD_LIBRARY_PATH (was Re: [PATCH] do not augment environment) Date: Fri, 05 Oct 2012 11:43:01 +0200 Message-ID: <506EABA5.8070309@gmail.com> References: <505CF9FC.9060007@gmail.com> <5069022C.9040600@netris.org> <87y5jnn8y4.fsf_-_@tines.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1349430183 5217 80.91.229.3 (5 Oct 2012 09:43:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Oct 2012 09:43:03 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Oct 05 11:43:07 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 1TK4R1-0007Yu-9H for guile-devel@m.gmane.org; Fri, 05 Oct 2012 11:43:07 +0200 Original-Received: from localhost ([::1]:42861 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TK4Qs-0000ep-It for guile-devel@m.gmane.org; Fri, 05 Oct 2012 05:42:58 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TK4Qk-0000dZ-Ce for guile-devel@gnu.org; Fri, 05 Oct 2012 05:42:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TK4Qg-000559-Dh for guile-devel@gnu.org; Fri, 05 Oct 2012 05:42:50 -0400 Original-Received: from mail-bk0-f41.google.com ([209.85.214.41]:51139) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TK4Qg-00054u-6k for guile-devel@gnu.org; Fri, 05 Oct 2012 05:42:46 -0400 Original-Received: by mail-bk0-f41.google.com with SMTP id jm1so759016bkc.0 for ; Fri, 05 Oct 2012 02:42:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=4p26on5SyeIUNH0/ETCFDHK/VP1GPT+/PNO9ysGoMuo=; b=YcHcmU3qZGLcFX8nELcjPz3ErwlGfaF/cPXTVljuTkC3O75brf22UMbkah1aqsGZwW R6u6+4j/IpBtcb7GJ0/ucw5PlWKyFFoNnzGyLyrMpOxh60kjBqVqZFgrDg9Kvs4gup+f OLA7Mj6M5vmJqfg2m+t/5Y8ZYlVuPz+3mmbTZOWLGUEmJeh0ZImZH6CwSlqsh8tO67/X gySVIDY0HyloZjaMOroHUTbFJ674lEUec2Wgtq4zzqlHVl1YTxekQxLxsCYGkLUGA4/w N3i3UHEbvVxC1freAYIggtbK15prDa0+s9KVVRxapZyf+RwENR7gKvOKVWnr/ZU3L7Ur /g/Q== Original-Received: by 10.204.7.88 with SMTP id c24mr2574715bkc.118.1349430164525; Fri, 05 Oct 2012 02:42:44 -0700 (PDT) Original-Received: from [172.16.3.14] (5352DA6A.cm-6-3d.dynamic.ziggo.nl. [83.82.218.106]) by mx.google.com with ESMTPS id 1sm4487817bks.3.2012.10.05.02.42.41 (version=SSLv3 cipher=OTHER); Fri, 05 Oct 2012 02:42:43 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 In-Reply-To: <87y5jnn8y4.fsf_-_@tines.lan> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.214.41 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:14929 Archived-At: Hi Mark, 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. Regards, Sjoerd On 10/03/2012 12:31 PM, Mark H Weaver wrote: > Hello all, > > 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 > correctness. > > 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. > > Mark > >