GNU bug report logs - #18835
load-from-path is inconsistent when looking for a compiled version of the source file

Previous Next

Package: guile;

Reported by: Geert Janssens <info <at> kobaltwit.be>

Date: Sat, 25 Oct 2014 17:31:01 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: Geert Janssens <info <at> kobaltwit.be>
To: 18835 <at> debbugs.gnu.org
Subject: bug#18835: load-from-path is inconsistent when looking for a compiled version of the source file
Date: Sat, 25 Oct 2014 19:09:09 +0200
[Message part 1 (text/plain, inline)]
$ guile --version
guile (GNU Guile) 2.0.11

$ config.guess 
x86_64-unknown-linux-gnu

$ rpm -qa | grep guile
compat-guile18-1.8.8-7.fc20.x86_64
guile-debuginfo-2.0.11-1.fc20.x86_64
guile-2.0.11-1.fc20.x86_64
guile-devel-2.0.11-1.fc20.x86_64

These steps illustrate the issue:

1. Download the attached file and save it as $HOME/guile/test.scm
Note: this is just an example file printing one line to indicate is has
successfully been called. Any other scm file will do to illustrate this bug.

2. Run these commands:
$ mkdir -p $HOME/guile/ccache
$ cd $HOME/guile/ccache
$ guild compile -o test.go ../test.scm
$ guild compile -o test.scm.go ../test.scm

This will generate two compiled versions of the test file, each with a different extension.

Now run these commands and observe what happens:
$ cd $HOME/guile
$ GUILE_LOAD_PATH=$HOME/guile \
  GUILE_LOAD_COMPILED_PATH=$HOME/guile/ccache \
  guile -c '(load-from-path "test")'

=> This command will use the file $HOME/guile/ccache/test.go. That is, no auto-compilation 
is triggered.

$ GUILE_LOAD_PATH=$HOME/guile \
  GUILE_LOAD_COMPILED_PATH=$HOME/guile/ccache \
  guile -c '(load-from-path "test.scm")'

=> This command will *not* use either of $HOME/guile/ccache/test.go or 
$HOME/guile/ccache/test.scm.go. Instead it will autocompile test.scm into <default-cache-
dir>/test.scm.go and use that one.

So there is no way to have the second command use your self-compiled files.

From Andy Wingo's comments on irc, it is expected that the second case would have used the 
self-compiled $HOME/guile/ccache/test.scm.go. I'm fine with that although using 
$HOME/guile/ccache/test.go would have made more sense from an outsider's point of view. At 
least it should be possible to make load-from-path use a self-compiled .go file regardless of 
whether the argument ends in .scm or not.

If more information is needed, feel free to ask.

Regards,

Geert
[Message part 2 (text/html, inline)]
[test.scm (text/x-scheme, attachment)]

This bug report was last modified 4 years and 28 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.