bugGuile - Bugs: bug #33165, `load' uses a wrong relative path

 
 

bug #33165: `load' uses a wrong relative path

Submitter:  Ludovic Courtès <civodul>
Submitted:  Tue 26 Apr 2011 01:20:16 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Invalid
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 21 Jun 2011 08:51:26 PM UTC, comment #4: 

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

Andy Wingo <wingo>
Group administrator
Sun 19 Jun 2011 08:16:50 PM UTC, comment #3: 

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.

Andy Wingo <wingo>
Group administrator
Sat 18 Jun 2011 05:57:54 PM UTC, comment #2: 

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

Ludovic Courtès <civodul>
Group administrator
Fri 17 Jun 2011 06:23:24 PM UTC, comment #1: 

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

Andy Wingo <wingo>
Group administrator
Tue 26 Apr 2011 01:20:16 PM UTC, original submission:  

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

Ludovic Courtès <civodul>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by wingo (Posted a comment)
  • -email is unavailable- added by civodul (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-06-21 wingo StatusNone Invalid
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code