unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Empty entries in $GUILE_LOAD_PATH
@ 2012-05-08 14:24 Ludovic Courtès
  2012-05-14 22:30 ` Mark H Weaver
  0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2012-05-08 14:24 UTC (permalink / raw)
  To: guile-devel

Hello!

Try something like:

  $ GUILE_LOAD_PATH=/foo/bar: make check

… and see the LALR tests fail with:

  ERROR: In procedure primitive-load-path: Unable to find file "home/ludo/src/guile/test-suite/lalr/common-test.scm" in load path

(These tests use ‘load’.)

Is that expected?  What’s the meaning of empty entries in the load path?

Should ‘meta/uninstalled-env’ & co. clear $GUILE_LOAD_PATH?

Thanks,
Ludo’.




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

* Re: Empty entries in $GUILE_LOAD_PATH
  2012-05-08 14:24 Empty entries in $GUILE_LOAD_PATH Ludovic Courtès
@ 2012-05-14 22:30 ` Mark H Weaver
  2012-05-15 17:13   ` Ludovic Courtès
  2012-05-15 18:44   ` Andy Wingo
  0 siblings, 2 replies; 4+ messages in thread
From: Mark H Weaver @ 2012-05-14 22:30 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guile-devel

ludo@gnu.org (Ludovic Courtès) writes:
> Try something like:
>
>   $ GUILE_LOAD_PATH=/foo/bar: make check
>
> … and see the LALR tests fail with:
>
>   ERROR: In procedure primitive-load-path: Unable to find file
> "home/ludo/src/guile/test-suite/lalr/common-test.scm" in load path
>
> (These tests use ‘load’.)
>
> Is that expected?  What’s the meaning of empty entries in the load path?

It seems to me that a valid load path should never contain empty
entries, because the empty string is not a valid path.

> Should ‘meta/uninstalled-env’ & co. clear $GUILE_LOAD_PATH?

I don't see why it should.

     Mark



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

* Re: Empty entries in $GUILE_LOAD_PATH
  2012-05-14 22:30 ` Mark H Weaver
@ 2012-05-15 17:13   ` Ludovic Courtès
  2012-05-15 18:44   ` Andy Wingo
  1 sibling, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2012-05-15 17:13 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: guile-devel

Hi Mark,

Mark H Weaver <mhw@netris.org> skribis:

> ludo@gnu.org (Ludovic Courtès) writes:
>> Try something like:
>>
>>   $ GUILE_LOAD_PATH=/foo/bar: make check
>>
>> … and see the LALR tests fail with:
>>
>>   ERROR: In procedure primitive-load-path: Unable to find file
>> "home/ludo/src/guile/test-suite/lalr/common-test.scm" in load path
>>
>> (These tests use ‘load’.)
>>
>> Is that expected?  What’s the meaning of empty entries in the load path?
>
> It seems to me that a valid load path should never contain empty
> entries, because the empty string is not a valid path.

Apparently ‘search_path’ has always treated "" as the current directory:

  $ guile
  GNU Guile 2.0.5.132-ff4d3
  Copyright (C) 1995-2012 Free Software Foundation, Inc.

  Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
  This program is free software, and you are welcome to redistribute it
  under certain conditions; type `,show c' for details.

  Enter `,help' for help.
  scheme@(guile-user)> (not (not (member "" %load-path)))
  $1 = #t
  scheme@(guile-user)> (chdir "/etc")
  scheme@(guile-user)> (search-path '("") "resolv.conf")
  $2 = "resolv.conf"

(Same with 1.8.)

So we probably can’t change that.

>> Should ‘meta/uninstalled-env’ & co. clear $GUILE_LOAD_PATH?
>
> I don't see why it should.

Actually the problem was:

  scheme@(guile-user)> (set! %load-path (cons "" %load-path))
  scheme@(guile-user)> (with-fluids ((%file-port-name-canonicalization 'relative))
                         (port-filename (open-input-file "/dev/null")))
  $1 = "dev/null"

I just fixed it.  Comments welcome!

Thanks,
Ludo’.



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

* Re: Empty entries in $GUILE_LOAD_PATH
  2012-05-14 22:30 ` Mark H Weaver
  2012-05-15 17:13   ` Ludovic Courtès
@ 2012-05-15 18:44   ` Andy Wingo
  1 sibling, 0 replies; 4+ messages in thread
From: Andy Wingo @ 2012-05-15 18:44 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: Ludovic Courtès, guile-devel

Heya,

On Tue 15 May 2012 00:30, Mark H Weaver <mhw@netris.org> writes:

> It seems to me that a valid load path should never contain empty
> entries, because the empty string is not a valid path.

Traditionally empty path components indicate the current directory,
AFAIK.  I think they're valid, and if we are not interpreting them that
way, that's probably a bug.  (Though, as you note, their existence is
itself probably a bug; perhaps we should emit a warning if one is
found...)

>> Should ‘meta/uninstalled-env’ & co. clear $GUILE_LOAD_PATH?
>
> I don't see why it should.

Me neither.

Andy
-- 
http://wingolog.org/



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

end of thread, other threads:[~2012-05-15 18:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-08 14:24 Empty entries in $GUILE_LOAD_PATH Ludovic Courtès
2012-05-14 22:30 ` Mark H Weaver
2012-05-15 17:13   ` Ludovic Courtès
2012-05-15 18:44   ` 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).