* bug#23943: Guile loads "init.scm" from the current directory
@ 2016-07-11 7:44 Alex Kost
2016-07-11 16:07 ` Andy Wingo
0 siblings, 1 reply; 3+ messages in thread
From: Alex Kost @ 2016-07-11 7:44 UTC (permalink / raw)
To: 23943
Hello. If you start guile from a directory that contains "init.scm"
file, it will be loaded. Try this recipe (GUILE_..._PATH are unset for
a pure experiment):
cd /tmp
echo foo > init.scm
GUILE_LOAD_COMPILED_PATH= GUILE_LOAD_PATH= guile -q
And it fails with this error:
guile: uncaught throw to unbound-variable: (#f Unbound variable: ~S (foo) #f)
Cannot exit gracefully when init is in progress; aborting.
Aborted (core dumped)
I'm not sure I understand it right from the commentary in "init.c"[1],
but I think this behavior is not intended, or is it?
[1] http://git.savannah.gnu.org/cgit/guile.git/tree/libguile/init.c#n238
--
Alex
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#23943: Guile loads "init.scm" from the current directory
2016-07-11 7:44 bug#23943: Guile loads "init.scm" from the current directory Alex Kost
@ 2016-07-11 16:07 ` Andy Wingo
2016-07-12 7:33 ` Alex Kost
0 siblings, 1 reply; 3+ messages in thread
From: Andy Wingo @ 2016-07-11 16:07 UTC (permalink / raw)
To: Alex Kost; +Cc: 23943-done
On Mon 11 Jul 2016 09:44, Alex Kost <alezost@gmail.com> writes:
> cd /tmp
> echo foo > init.scm
> GUILE_LOAD_COMPILED_PATH= GUILE_LOAD_PATH= guile -q
>
> And it fails with this error:
>
> guile: uncaught throw to unbound-variable: (#f Unbound variable: ~S (foo) #f)
> Cannot exit gracefully when init is in progress; aborting.
> Aborted (core dumped)
>
> I'm not sure I understand it right from the commentary in "init.c"[1],
> but I think this behavior is not intended, or is it?
>
> [1] http://git.savannah.gnu.org/cgit/guile.git/tree/libguile/init.c#n238
Your invocation does not unset GUILE_LOAD_PATH and
GUILE_LOAD_COMPILED_PATH, but rather *sets* them to contain only one
element, the current directory. Use "unset" or similar to unset these
variables.
Andy
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#23943: Guile loads "init.scm" from the current directory
2016-07-11 16:07 ` Andy Wingo
@ 2016-07-12 7:33 ` Alex Kost
0 siblings, 0 replies; 3+ messages in thread
From: Alex Kost @ 2016-07-12 7:33 UTC (permalink / raw)
To: 23943
Andy Wingo (2016-07-11 19:07 +0300) wrote:
> On Mon 11 Jul 2016 09:44, Alex Kost <alezost@gmail.com> writes:
>
>> cd /tmp
>> echo foo > init.scm
>> GUILE_LOAD_COMPILED_PATH= GUILE_LOAD_PATH= guile -q
>>
>> And it fails with this error:
>>
>> guile: uncaught throw to unbound-variable: (#f Unbound variable: ~S (foo) #f)
>> Cannot exit gracefully when init is in progress; aborting.
>> Aborted (core dumped)
>>
>> I'm not sure I understand it right from the commentary in "init.c"[1],
>> but I think this behavior is not intended, or is it?
>>
>> [1] http://git.savannah.gnu.org/cgit/guile.git/tree/libguile/init.c#n238
>
> Your invocation does not unset GUILE_LOAD_PATH and
> GUILE_LOAD_COMPILED_PATH, but rather *sets* them to contain only one
> element, the current directory. Use "unset" or similar to unset these
> variables.
Aha, now I see that "GUILE_LOAD_PATH= guile" adds "" (an empty string)
to %load-path. Thanks for the answer!
--
Alex
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-07-12 7:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-11 7:44 bug#23943: Guile loads "init.scm" from the current directory Alex Kost
2016-07-11 16:07 ` Andy Wingo
2016-07-12 7:33 ` Alex Kost
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).