From: Luca Saiu <INVALID.NOREPLY@gnu.org>
To: Luca Saiu <positron@gnu.org>, bug-guile@gnu.org
Subject: [bug #30480] VM: load looks for files in the wrong directory
Date: Sun, 18 Jul 2010 22:51:54 +0000 [thread overview]
Message-ID: <20100719-005153.sv1523.70961@savannah.gnu.org> (raw)
In-Reply-To:
URL:
<http://savannah.gnu.org/bugs/?30480>
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:
<http://savannah.gnu.org/bugs/?30480>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
next reply other threads:[~2010-07-18 22:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-18 22:51 Luca Saiu [this message]
2010-07-18 22:54 ` [bug #30480] VM: load looks for files in the wrong directory Luca Saiu
2010-07-18 22:59 ` Luca Saiu
2010-07-24 16:16 ` Ludovic Courtès
2011-02-13 18:51 ` Andy Wingo
2011-02-15 11:59 ` Likely bug: SMOBs and mark functions [Was: Re: [bug #30480] VM: load looks for files in the wrong directory] Luca Saiu
2011-02-15 12:08 ` Luca Saiu
2011-02-15 15:38 ` Ludovic Courtès
2011-02-15 16:17 ` Luca Saiu
2011-02-16 13:23 ` Ludovic Courtès
2011-02-17 9:41 ` Luca Saiu
2011-02-17 11:13 ` Likely bug: SMOBs and mark functions Andy Wingo
2011-02-17 14:08 ` Luca Saiu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100719-005153.sv1523.70961@savannah.gnu.org \
--to=invalid.noreply@gnu.org \
--cc=bug-guile@gnu.org \
--cc=positron@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).