* bug#29226: fresh-auto-compile doesn’t invalidate the compilation cache
@ 2017-11-09 12:53 Ludovic Courtès
2017-11-22 15:48 ` Ludovic Courtès
[not found] ` <87shb7fayt.fsf@gnu.org>
0 siblings, 2 replies; 4+ messages in thread
From: Ludovic Courtès @ 2017-11-09 12:53 UTC (permalink / raw)
To: 29226
[-- Attachment #1: Type: text/plain, Size: 1033 bytes --]
Hello,
‘%fresh-auto-compile’ is documented as a way to “forcibly invalidate the
auto-compilation cache” (info "(guile) Compilation"), but it seems that
it doesn’t invalidate much. Specifically, ‘primitive-load-path’ does:
compiled_thunk = load_thunk_from_path (filename, full_filename, &stat_source,
&found_stale_compiled_file);
if (scm_is_false (compiled_thunk)
&& scm_is_false (*scm_loc_fresh_auto_compile)
…)
{ … }
…
if (scm_is_true (compiled_thunk))
return scm_call_0 (compiled_thunk);
else
{
SCM freshly_compiled = scm_try_auto_compile (full_filename);
…
}
So if there’s a .go file in the search path, it is *always* loaded, and
there’s no way we reach ‘scm_try_auto_compile’.
‘load-absolute’ in boot-9.scm seems to have the same problem:
(and scmstat (or (pre-compiled) (fallback)))
I believe the attached patch fixes it.
Thoughts?
Thanks,
Ludo’.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 2097 bytes --]
diff --git a/libguile/load.c b/libguile/load.c
index 7b8136af8..3747dd9ad 100644
--- a/libguile/load.c
+++ b/libguile/load.c
@@ -1,5 +1,5 @@
/* Copyright (C) 1995, 1996, 1998, 1999, 2000, 2001, 2004, 2006, 2008,
- * 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc.
+ * 2009, 2010, 2011, 2012, 2013, 2014, 2017 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -1195,13 +1195,16 @@ SCM_DEFINE (scm_primitive_load_path, "primitive-load-path", 0, 0, 1,
*scm_loc_load_extensions, SCM_BOOL_F,
&stat_source);
- compiled_thunk = load_thunk_from_path (filename, full_filename, &stat_source,
- &found_stale_compiled_file);
+ if (scm_is_false (*scm_loc_fresh_auto_compile))
+ compiled_thunk = load_thunk_from_path (filename, full_filename,
+ &stat_source,
+ &found_stale_compiled_file);
+ else
+ compiled_thunk = SCM_BOOL_F;
if (scm_is_false (compiled_thunk)
&& scm_is_true (full_filename)
&& scm_is_true (*scm_loc_compile_fallback_path)
- && scm_is_false (*scm_loc_fresh_auto_compile)
&& scm_is_pair (*scm_loc_load_compiled_extensions)
&& scm_is_string (scm_car (*scm_loc_load_compiled_extensions)))
{
diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm
index 7127d73f7..612040aa4 100644
--- a/module/ice-9/boot-9.scm
+++ b/module/ice-9/boot-9.scm
@@ -3812,7 +3812,10 @@ when none is available, reading FILE-NAME with READER."
scmstat
go-file-name))))))
- (let ((compiled (and scmstat (or (pre-compiled) (fallback)))))
+ (let ((compiled (and scmstat
+ (or (and (not %fresh-auto-compile)
+ (pre-compiled))
+ (fallback)))))
(if compiled
(begin
(if %load-hook
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-01-16 18:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-09 12:53 bug#29226: fresh-auto-compile doesn’t invalidate the compilation cache Ludovic Courtès
2017-11-22 15:48 ` Ludovic Courtès
[not found] ` <87shb7fayt.fsf@gnu.org>
[not found] ` <87h8rnb2no.fsf@igalia.com>
2018-01-15 22:21 ` Ludovic Courtès
2018-01-16 18:18 ` David Pirotte
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).