unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* [bug #33165] `load' uses a wrong relative path
@ 2011-04-26 13:20 Ludovic Courtès
  2011-04-26 15:59 ` Mark H Weaver
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Ludovic Courtès @ 2011-04-26 13:20 UTC (permalink / raw)
  To: Ludovic Courtès, bug-guile

URL:
  <http://savannah.gnu.org/bugs/?33165>

                 Summary: `load' uses a wrong relative path
                 Project: Guile
            Submitted by: civodul
            Submitted on: Tue 26 Apr 2011 01:20:16 PM GMT
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

Hello!

Consider this session:

#v+
$ mkdir t

$ cd t

t$ touch a.scm

t$ mkdir d

t$ echo '(load "a.scm")' > d/b.scm

t$ guile -l a.scm d/b.scm 
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /home/ludo/src/kanren-book/t/a.scm
;;; compiled
/home/ludo/.cache/guile/ccache/2.0-LE-8-2.0/home/ludo/src/kanren-book/t/a.scm.go
;;; compiling /home/ludo/src/kanren-book/t/d/b.scm
;;; compiled
/home/ludo/.cache/guile/ccache/2.0-LE-8-2.0/home/ludo/src/kanren-book/t/d/b.scm.go
Backtrace:

[...]

   ?: 0 [primitive-load-path "home/ludo/src/kanren-book/t/d/a.scm"]

ERROR: In procedure primitive-load-path:
ERROR: In procedure primitive-load-path: Unable to find file
"home/ludo/src/kanren-book/t/d/a.scm" in load path
#v-

The relative path computed by `load' above is broken.  Adding a leading `/'
would fix it.

Ludo'.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?33165>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




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

* Re: [bug #33165] `load' uses a wrong relative path
  2011-04-26 13:20 [bug #33165] `load' uses a wrong relative path Ludovic Courtès
@ 2011-04-26 15:59 ` Mark H Weaver
  2011-04-29  8:32 ` Andy Wingo
  2011-06-17 18:23 ` Andy Wingo
  2 siblings, 0 replies; 7+ messages in thread
From: Mark H Weaver @ 2011-04-26 15:59 UTC (permalink / raw)
  To: Ludovic Courtès, bug-guile

Ludovic Courtès <INVALID.NOREPLY@gnu.org> writes:
>    ?: 0 [primitive-load-path "home/ludo/src/kanren-book/t/d/a.scm"]
>
> ERROR: In procedure primitive-load-path:
> ERROR: In procedure primitive-load-path: Unable to find file
> "home/ludo/src/kanren-book/t/d/a.scm" in load path

FYI, I'm unable to reproduce this on Guile 2.0.0.215-fb9cf.
Here's what I get:

mhw@freedomincluded:~/guile-test$ mkdir t
mhw@freedomincluded:~/guile-test$ cd t
mhw@freedomincluded:~/guile-test/t$ touch a.scm
mhw@freedomincluded:~/guile-test/t$ mkdir d
mhw@freedomincluded:~/guile-test/t$ echo '(load "a.scm")' > d/b.scm
mhw@freedomincluded:~/guile-test/t$ guile -l a.scm d/b.scm
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /home/mhw/guile-test/t/a.scm
;;; compiled /home/mhw/.cache/guile/ccache/2.0-LE-4-2.0/home/mhw/guile-test/t/a.scm.go
;;; compiling /home/mhw/guile-test/t/d/b.scm
;;; compiled /home/mhw/.cache/guile/ccache/2.0-LE-4-2.0/home/mhw/guile-test/t/d/b.scm.go
Backtrace:
In ice-9/boot-9.scm:
 170: 11 [catch #t #<catch-closure 603da0> ...]
In unknown file:
   ?: 10 [catch-closure]
In ice-9/boot-9.scm:
  62: 9 [call-with-prompt prompt0 ...]
In module/ice-9/eval.scm:
 389: 8 [eval # #]
In ice-9/boot-9.scm:
1918: 7 [save-module-excursion #<procedure 8bd700 at ice-9/boot-9.scm:3341:3 ()>]
3348: 6 [#<procedure 8bd700 at ice-9/boot-9.scm:3341:3 ()>]
In unknown file:
   ?: 5 [load-compiled/vm "/home/mhw/.cache/guile/ccache/2.0-LE-4-2.0/home/mhw/guile-test/t/d/b.scm.go"]
In ice-9/boot-9.scm:
1918: 4 [save-module-excursion #<procedure 928ee0 at ice-9/boot-9.scm:3341:3 ()>]
3348: 3 [#<procedure 928ee0 at ice-9/boot-9.scm:3341:3 ()>]
1190: 2 [%start-stack load-stack #<procedure 926770 at ice-9/boot-9.scm:3337:10 ()>]
1195: 1 [#<procedure 924738 ()>]
In unknown file:
   ?: 0 [primitive-load "/home/mhw/guile-test/t/d/a.scm"]

ERROR: In procedure primitive-load:
ERROR: In procedure open-file: No such file or directory: "/home/mhw/guile-test/t/d/a.scm"

    Best,
     Mark



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

* Re: [bug #33165] `load' uses a wrong relative path
  2011-04-26 13:20 [bug #33165] `load' uses a wrong relative path Ludovic Courtès
  2011-04-26 15:59 ` Mark H Weaver
@ 2011-04-29  8:32 ` Andy Wingo
  2011-06-17 18:23 ` Andy Wingo
  2 siblings, 0 replies; 7+ messages in thread
From: Andy Wingo @ 2011-04-29  8:32 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: bug-guile

On Tue 26 Apr 2011 15:20, Ludovic Courtès <INVALID.NOREPLY@gnu.org> writes:

>    ?: 0 [primitive-load-path "home/ludo/src/kanren-book/t/d/a.scm"]

Was / in your GUILE_LOAD_PATH at some point?  That would explain this,
because the file name canonicalization of the syntax source in b.scm
would yield "home/ludo/src/kanren-book/t/d/b.scm".  It would also
explain why Mark was not able to reproduce the error.

Andy
-- 
http://wingolog.org/



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

* [bug #33165] `load' uses a wrong relative path
  2011-04-26 13:20 [bug #33165] `load' uses a wrong relative path Ludovic Courtès
  2011-04-26 15:59 ` Mark H Weaver
  2011-04-29  8:32 ` Andy Wingo
@ 2011-06-17 18:23 ` Andy Wingo
  2011-06-18 17:57   ` Ludovic Courtès
  2 siblings, 1 reply; 7+ messages in thread
From: Andy Wingo @ 2011-06-17 18:23 UTC (permalink / raw)
  To: Ludovic Courtès, Andy Wingo, bug-guile

Follow-up Comment #1, bug #33165 (project guile):

The lack of an initial / on a primitive-load-path call indicates that / was in
your GUILE_LOAD_PATH at compilation time, though perhaps not at load time. 
Can you check that?

Andy

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?33165>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




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

* [bug #33165] `load' uses a wrong relative path
  2011-06-17 18:23 ` Andy Wingo
@ 2011-06-18 17:57   ` Ludovic Courtès
  2011-06-19 20:16     ` Andy Wingo
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2011-06-18 17:57 UTC (permalink / raw)
  To: Ludovic Courtès, Andy Wingo, bug-guile

Follow-up Comment #2, bug #33165 (project guile):

I can reproduce it, and with an empty $GUILE_LOAD_PATH:

#v+
[ludo@nixey:~/src/guile/bug33165]$ mkdir t

[ludo@nixey:~/src/guile/bug33165]$ touch t/a.scm

[ludo@nixey:~/src/guile/bug33165]$ mkdir t/d

[ludo@nixey:~/src/guile/bug33165]$ echo '(load "a.scm")' > t/d/b.scm

[ludo@nixey:~/src/guile/bug33165]$ ../meta/guile -l t/a.scm t/d/b.scm 
;;; note: source file /home/ludo/src/guile/bug33165/t/a.scm
;;;       newer than compiled
/home/ludo/src/guile/cache/guile/ccache/2.0-LE-8-2.0/home/ludo/src/guile/bug33165/t/a.scm.go
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /home/ludo/src/guile/bug33165/t/a.scm
;;; compiled
/home/ludo/src/guile/cache/guile/ccache/2.0-LE-8-2.0/home/ludo/src/guile/bug33165/t/a.scm.go
;;; note: source file /home/ludo/src/guile/bug33165/t/d/b.scm
;;;       newer than compiled
/home/ludo/src/guile/cache/guile/ccache/2.0-LE-8-2.0/home/ludo/src/guile/bug33165/t/d/b.scm.go
;;; compiling /home/ludo/src/guile/bug33165/t/d/b.scm
;;; compiled
/home/ludo/src/guile/cache/guile/ccache/2.0-LE-8-2.0/home/ludo/src/guile/bug33165/t/d/b.scm.go
Backtrace:
In module/ice-9/boot-9.scm:
 170: 11 [catch #t #<catch-closure eb6c20> ...]
In unknown file:
   ?: 10 [catch-closure]
In module/ice-9/boot-9.scm:
  62: 9 [call-with-prompt prompt0 ...]
In module/ice-9/eval.scm:
 389: 8 [eval # #]
In module/ice-9/boot-9.scm:
2103: 7 [save-module-excursion #<procedure 1431100 at
module/ice-9/boot-9.scm:3534:3 ()>]
3541: 6 [#<procedure 1431100 at module/ice-9/boot-9.scm:3534:3 ()>]
In unknown file:
   ?: 5 [load-compiled/vm
"/home/ludo/src/guile/cache/guile/ccache/2.0-LE-8-2.0/home/ludo/src/guile/bug33165/t/d/b.scm.go"]
In module/ice-9/boot-9.scm:
2103: 4 [save-module-excursion #<procedure 143f340 at
module/ice-9/boot-9.scm:3534:3 ()>]
3543: 3 [#<procedure 143f340 at module/ice-9/boot-9.scm:3534:3 ()>]
1375: 2 [%start-stack load-stack ...]
1380: 1 [#<procedure 143bf60 ()>]
In unknown file:
   ?: 0 [primitive-load-path "bug33165/t/d/a.scm"]

ERROR: In procedure primitive-load-path:
ERROR: In procedure primitive-load-path: Unable to find file
"bug33165/t/d/a.scm" in load path

[ludo@nixey:~/src/guile/bug33165]$ ../meta/guile --version
guile (GNU Guile) 2.0.1.131-c245d
Copyright (C) 2011 Free Software Foundation, Inc.

License LGPLv3+: GNU LGPL 3 or later <http://gnu.org/licenses/lgpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

[ludo@nixey:~/src/guile/bug33165]$ echo $GUILE_LOAD_COMPILED_PATH
$GUILE_LOAD_PATH
#v-

But here that's the uninstalled environment, which presumably has ~/src/guile
in its load path.  Still...

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?33165>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




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

* [bug #33165] `load' uses a wrong relative path
  2011-06-18 17:57   ` Ludovic Courtès
@ 2011-06-19 20:16     ` Andy Wingo
  2011-06-21 20:51       ` Andy Wingo
  0 siblings, 1 reply; 7+ messages in thread
From: Andy Wingo @ 2011-06-19 20:16 UTC (permalink / raw)
  To: Ludovic Courtès, Andy Wingo, bug-guile

Follow-up Comment #3, bug #33165 (project guile):

Hi Ludo,

> [ludo@nixey:~/src/guile/bug33165]$ ../meta/guile -l t/a.scm t/d/b.scm 

Note that ~/src/guile is in your GUILE_LOAD_PATH and
GUILE_LOAD_COMPILED_PATH in this case, because of (test-suite lib).

This is an error IMO but it is how it is, and it explains the relative
path here:

>    ?: 0 [primitive-load-path "bug33165/t/d/a.scm"]

In this case the (load "a.scm") in bug33165/t/d/b.scm resolves "a.scm"
relative to the the file doing the load, which is bug33165/t/d/b.scm.
So to me things are working correctly here, as far as they can work.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?33165>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




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

* [bug #33165] `load' uses a wrong relative path
  2011-06-19 20:16     ` Andy Wingo
@ 2011-06-21 20:51       ` Andy Wingo
  0 siblings, 0 replies; 7+ messages in thread
From: Andy Wingo @ 2011-06-21 20:51 UTC (permalink / raw)
  To: Ludovic Courtès, Andy Wingo, bug-guile

Update of bug #33165 (project guile):

                  Status:                    None => Invalid                
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #4:

I am going to close this one as not a bug.  Please reopen if you have more
details.  Thanks!

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?33165>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




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

end of thread, other threads:[~2011-06-21 20:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-26 13:20 [bug #33165] `load' uses a wrong relative path Ludovic Courtès
2011-04-26 15:59 ` Mark H Weaver
2011-04-29  8:32 ` Andy Wingo
2011-06-17 18:23 ` Andy Wingo
2011-06-18 17:57   ` Ludovic Courtès
2011-06-19 20:16     ` Andy Wingo
2011-06-21 20:51       ` Andy Wingo

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