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/