From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Newsgroups: gmane.lisp.guile.user Subject: Re: guile-2.0 on mingw: the sequel Date: Sun, 25 Aug 2013 19:24:17 -0400 Message-ID: <20130825232417.TCPTK.135132.root@cdptpa-web34-z02> References: <87r4dh8n24.fsf@tines.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1377473075 13936 80.91.229.3 (25 Aug 2013 23:24:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 25 Aug 2013 23:24:35 +0000 (UTC) Cc: guile-user@gnu.org To: Eli Zaretskii , Mark H Weaver Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Aug 26 01:24:38 2013 Return-path: Envelope-to: guile-user@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 1VDjfh-0005u5-Qd for guile-user@m.gmane.org; Mon, 26 Aug 2013 01:24:38 +0200 Original-Received: from localhost ([::1]:48105 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDjfh-00083S-DS for guile-user@m.gmane.org; Sun, 25 Aug 2013 19:24:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDjfU-00082z-HU for guile-user@gnu.org; Sun, 25 Aug 2013 19:24:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VDjfO-0005mm-LJ for guile-user@gnu.org; Sun, 25 Aug 2013 19:24:24 -0400 Original-Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.120]:49166) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDjfO-0005ma-I3 for guile-user@gnu.org; Sun, 25 Aug 2013 19:24:18 -0400 Authentication-Results: cdptpa-omtalb.mail.rr.com smtp.user=dsmich@roadrunner.com; auth=pass (LOGIN) X-Authority-Analysis: v=2.0 cv=FJKZNpUs c=1 sm=0 a=GQqGoMZh8YgA:10 a=zTVDa7HKqxcA:10 a=IkcTkHD0fZMA:10 a=doupyKFmAAAA:8 a=KGjhK52YXX0A:10 a=KBRG4-To8hQA:10 a=DeTtaYkFAAAA:8 a=mDV3o1hIAAAA:8 a=pGLkceISAAAA:8 a=JMnnF-g5AAAA:8 a=YvkxNwxT-0q4FylSQE0A:9 a=QEXdDO2ut3YA:10 a=BiDrKXtPeRMA:10 a=ii61gXl28gQA:10 a=MSl-tDqOz04A:10 a=KOrh491K8B87fFeLgJkoRw==:117 X-Cloudmark-Score: 0 X-Authenticated-User: dsmich@roadrunner.com Original-Received: from [10.127.132.185] ([10.127.132.185:64087] helo=cdptpa-web34-z02) by cdptpa-oedge03.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTPA id 51/C5-11231-1229A125; Sun, 25 Aug 2013 23:24:17 +0000 In-Reply-To: <87r4dh8n24.fsf@tines.lan> X-Priority: 3 (Normal) Sensitivity: Normal X-Originating-IP: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 75.180.132.120 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:10711 Archived-At: ---- Mark H Weaver wrote: > Eli Zaretskii writes: > > >> From: Mark H Weaver > >> Cc: godek.maciek@gmail.com, guile-user@gnu.org > >> Date: Sun, 25 Aug 2013 15:56:53 -0400 > >> > >> Remember that Guile is a library, not just an executable. So argv[0] > >> could point to any arbitrary executable that's linked with libguile. > > > > We can provide an API for passing to the library the root of its > > installation. > > I suppose, but that assumes that the main program knows the location of > the libguile installation it's linked to. How would it know this? In > the common case on POSIX, the dynamic linker takes care of finding a > suitable copy of libguile, drawing from sources such as /etc/ld.so.conf, > /etc/ld.so.conf.d/*, LD_LIBRARY_PATH, rpaths, etc. How can the main > program know? > > > And btw, how is this different from GCC looking for its libgcc or GDB > > looking for its Python scripts? > > GCC and GDB are programs, not libraries. Finding out the location of > the current executable is a much easier problem than finding out the > install prefix of a particular library. > > > An executable linked with libguile will either be in /usr/bin or > > somesuch, i.e. close to /usr/lib where libguile lives; or it will be > > in some random place under the user's home directory, in which case > > either libguile is in the default place, or it is near the binary. > > The latter case is precisely the additional feature where looking for > > the library nearby will be a benefit. > > You're making a lot of very dubious assumptions here. I'm uncomfortable > advertising a new feature for Guile that is impossible to implement > robustly. If it has to make assumptions such as "the libguile library > is probably near the binary", it is likely to fail in many cases. > > > It's true that this is not 100% bulletproof on Posix, but it's close. > > So far, I've not seen a solution that's anywhere near close to being > correct on POSIX. All I've seen is a bunch of very dubious guesses. Linux (well, glibc) has dladdr http://linux.die.net/man/3/dladdr which could be used I guess. But that's not POSIX. On windows, I think you call GetModuleFileName() with the handle that was passed to DllMain(). Is it possible for libguile to do that? But there are fundamental differences in the way applications/libraries/packages are places on windows and POSIX and POSIX-like systems. Seems like most windows apps install everything into their own subtree. The main application is not even on the system PATH! On a POSIXy system, there are shared places for config files, libraries, documentation, and so on. It's just different. I don't see why we would need to be "relocatable" here. My $.02 -Dale