[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #30480] VM: load looks for files in the wrong directory
From: |
Luca Saiu |
Subject: |
[bug #30480] VM: load looks for files in the wrong directory |
Date: |
Sun, 18 Jul 2010 22:51:54 +0000 |
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) |
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/
- [bug #30480] VM: load looks for files in the wrong directory,
Luca Saiu <=