build: Make sure only the local .go files are loaded during compilation.

Reported by Andreas Enge <andreas@enge.fr>
at <http://lists.gnu.org/archive/html/guix-devel/2015-01/msg00272.html>.

* Makefile.am (.scm.go): Add "unset GUILE_LOAD_COMPILED_PATH".
This commit is contained in:
Ludovic Courtès 2015-01-20 14:55:06 +01:00
parent dbab5150f8
commit 28561d85da

@ -268,10 +268,18 @@ AM_V_GUILEC = $(AM_V_GUILEC_$(V))
AM_V_GUILEC_ = $(AM_V_GUILEC_$(AM_DEFAULT_VERBOSITY))
AM_V_GUILEC_0 = @echo " GUILEC" $@;
# Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
# $GUILE_LOAD_COMPILED_PATH contains $(moduledir), we may find .go files in
# there that are newer than the local .scm files (for instance because the
# user ran 'make install' recently). When that happens, we end up loading
# those previously-installed .go files, which may be stale, thereby breaking
# the whole thing.
#
# XXX: Use the C locale for when Guile lacks
# <http://git.sv.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=e2c6bf3866d1186c60bacfbd4fe5037087ee5e3f>.
.scm.go:
$(AM_V_GUILEC)$(MKDIR_P) `dirname "$@"` ; \
unset GUILE_LOAD_COMPILED_PATH ; \
LC_ALL=C \
$(top_builddir)/pre-inst-env \
$(GUILD) compile -L "$(top_builddir)" -L "$(top_srcdir)" \