From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Luca Saiu Newsgroups: gmane.lisp.guile.bugs Subject: [bug #30480] VM: load looks for files in the wrong directory Date: Sun, 18 Jul 2010 22:51:54 +0000 Message-ID: <20100719-005153.sv1523.70961@savannah.gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=UTF-8 X-Trace: dough.gmane.org 1279493534 2183 80.91.229.12 (18 Jul 2010 22:52:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 18 Jul 2010 22:52:14 +0000 (UTC) To: Luca Saiu , bug-guile@gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Mon Jul 19 00:52:12 2010 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OaciL-0001WP-EM for guile-bugs@m.gmane.org; Mon, 19 Jul 2010 00:52:05 +0200 Original-Received: from localhost ([127.0.0.1]:35379 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OaciK-0002On-U0 for guile-bugs@m.gmane.org; Sun, 18 Jul 2010 18:52:04 -0400 Original-Received: from [140.186.70.92] (port=45437 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OaciD-0002OT-U9 for bug-guile@gnu.org; Sun, 18 Jul 2010 18:51:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OaciC-0001Ar-SA for bug-guile@gnu.org; Sun, 18 Jul 2010 18:51:57 -0400 Original-Received: from colonialone.fsf.org ([140.186.70.51]:56913 helo=internal.in.savannah.gnu.org) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OaciB-0001Ac-2L; Sun, 18 Jul 2010 18:51:55 -0400 Original-Received: from [10.1.0.103] (helo=frontend.in.savannah.gnu.org) by internal.in.savannah.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OaciA-0001hs-AT; Sun, 18 Jul 2010 22:51:54 +0000 Original-Received: from www-data by frontend.in.savannah.gnu.org with local (Exim 4.69) (envelope-from ) id 1OaciA-0002Bq-8J; Sun, 18 Jul 2010 22:51:54 +0000 X-Savane-Server: savannah.gnu.org:443 [10.1.0.103] X-Savane-Project: guile X-Savane-Tracker: bugs X-Savane-Item-ID: 30480 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.10) Gecko/20100623 Iceweasel/3.5.10 (like Firefox/3.5.10) X-Apparently-From: 82.243.84.93 (Savane authenticated user positrone) Original-References: In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:4711 Archived-At: URL: Summary: VM: load looks for files in the wrong directory Project: Guile Submitted by: positrone Submitted on: Mon 19 Jul 2010 12:51:53 AM CEST Category: None Severity: 3 - Normal Item Group: None Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any _______________________________________________________ Details: The behavior of the load function in bytecode programs is wrong and different from interpreted programs. * The interpreter works just like 1.8 did: loaded files are looked for in paths relative to the directory of the script calling load. This is the reasonable and useful behavior. * The virtual machine looks for the file to load in paths relative to the cwd (I don't know if at startup time or at load time). Absolute pathnames work in either case. Ludovic said this when we spoke about that in Göteborg: load should call canonicalize-path relative to the directory of the file which loads the other one, not relative to `pwd`. Of course this is a regression compared to 1.8. How to reproduce the malfunction, in a particularly simple case (no explicit relative paths in the pathnames given to load): $ cd /tmp; mkdir q; echo '(display "b\n")' > q/b.scm; echo '(load "b.scm")(display "a\n")' > q/a.scm $ rm -rf ~/.cache $ guile --no-autocompile q/a.scm b a $ guile --autocompile q/a.scm ;;; note: autocompilation is enabled, set GUILE_AUTO_COMPILE=0 ;;; or pass the --no-autocompile argument to disable. ;;; compiling q/a.scm ;;; compiled /home/luca/.cache/guile/ccache/2.0-0.Q-LE-8/tmp/q/a.scm.go ERROR: In procedure open-file: ERROR: No such file or directory: "b.scm" _______________________________________________________ Reply to this item at: _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/