unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* [bug #30480] VM: load looks for files in the wrong directory
@ 2010-07-18 22:51 Luca Saiu
  2010-07-18 22:54 ` Luca Saiu
  0 siblings, 1 reply; 13+ messages in thread
From: Luca Saiu @ 2010-07-18 22:51 UTC (permalink / raw)
  To: Luca Saiu, bug-guile


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/




^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2011-02-17 14:08 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-18 22:51 [bug #30480] VM: load looks for files in the wrong directory Luca Saiu
2010-07-18 22:54 ` 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

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).