GNU bug report logs - #29226
fresh-auto-compile doesn’t invalidate the compilation cache

Previous Next

Package: guile;

Reported by: ludovic.courtes <at> inria.fr (Ludovic Courtès)

Date: Thu, 9 Nov 2017 12:54:02 UTC

Severity: normal

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 29226 in the body.
You can then email your comments to 29226 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#29226; Package guile. (Thu, 09 Nov 2017 12:54:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to ludovic.courtes <at> inria.fr (Ludovic Courtès):
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Thu, 09 Nov 2017 12:54:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: ludovic.courtes <at> inria.fr (Ludovic Courtès)
To: bug-guile <at> gnu.org
Subject: fresh-auto-compile doesn’t invalidate the
 compilation cache
Date: Thu, 09 Nov 2017 13:53:22 +0100
[Message part 1 (text/plain, inline)]
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’.

[Message part 2 (text/x-patch, inline)]
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

Reply sent to ludo <at> gnu.org (Ludovic Courtès):
You have taken responsibility. (Wed, 22 Nov 2017 15:49:02 GMT) Full text and rfc822 format available.

Notification sent to ludovic.courtes <at> inria.fr (Ludovic Courtès):
bug acknowledged by developer. (Wed, 22 Nov 2017 15:49:02 GMT) Full text and rfc822 format available.

Message #10 received at 29226-done <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: 29226-done <at> debbugs.gnu.org
Subject: Re: bug#29226: fresh-auto-compile doesn’t
 invalidate the compilation cache
Date: Wed, 22 Nov 2017 16:48:35 +0100
ludovic.courtes <at> inria.fr (Ludovic Courtès) skribis:

> I believe the attached patch fixes it.

Pushed as 83d4c4d622b406ec0bc9d8139ec8182fa72b5720.

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 21 Dec 2017 12:24:04 GMT) Full text and rfc822 format available.

Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 15 Jan 2018 14:30:03 GMT) Full text and rfc822 format available.

Severity set to 'important' from 'normal' Request was from ludo <at> gnu.org (Ludovic Courtès) to control <at> debbugs.gnu.org. (Mon, 15 Jan 2018 14:30:04 GMT) Full text and rfc822 format available.

bug unarchived. Request was from ludo <at> gnu.org (Ludovic Courtès) to control <at> debbugs.gnu.org. (Mon, 15 Jan 2018 22:20:03 GMT) Full text and rfc822 format available.

Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 15 Jan 2018 22:20:03 GMT) Full text and rfc822 format available.

Reply sent to ludo <at> gnu.org (Ludovic Courtès):
You have taken responsibility. (Mon, 15 Jan 2018 22:22:02 GMT) Full text and rfc822 format available.

Notification sent to ludovic.courtes <at> inria.fr (Ludovic Courtès):
bug acknowledged by developer. (Mon, 15 Jan 2018 22:22:03 GMT) Full text and rfc822 format available.

Message #25 received at 29226-done <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Andy Wingo <wingo <at> igalia.com>
Cc: 29226-done <at> debbugs.gnu.org
Subject: Re: bug#29226: fresh-auto-compile doesn’t
 invalidate the compilation cache
Date: Mon, 15 Jan 2018 23:21:19 +0100
Andy Wingo <wingo <at> igalia.com> skribis:

> On Mon 15 Jan 2018 15:33, ludo <at> gnu.org (Ludovic Courtès) writes:
>
>> Hello,
>>
>> ludovic.courtes <at> inria.fr (Ludovic Courtès) skribis:
>>
>>> ‘%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.
>>
>>> Pushed as 83d4c4d622b406ec0bc9d8139ec8182fa72b5720.
>>
>> As we’ve discussed since then, this patch was misguided:
>> ‘%fresh-auto-compile’ is about ~/.cache, so the fact that .go files
>> found elsewhere in the search path get loaded is expected.
>>
>> My apologies for breaking this!
>>
>> So I guess we should revert 83d4c4d622b406ec0bc9d8139ec8182fa72b5720 and
>> release 2.2.4 afterwards.  Does that make sense, Andy?
>
> Makes sense to me, yes!

OK, reverted in a1793bc904d947810d64175945218c2cdace38cc.

Thanks,
Ludo’.




Information forwarded to bug-guile <at> gnu.org:
bug#29226; Package guile. (Tue, 16 Jan 2018 18:19:02 GMT) Full text and rfc822 format available.

Message #28 received at 29226-done <at> debbugs.gnu.org (full text, mbox):

From: David Pirotte <david <at> altosw.be>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: Andy Wingo <wingo <at> igalia.com>, 29226-done <at> debbugs.gnu.org
Subject: Re: bug#29226: fresh-auto-compile doesn’t
 invalidate the compilation cache
Date: Tue, 16 Jan 2018 16:18:46 -0200
[Message part 1 (text/plain, inline)]
Hello Andy,
Ludovic,
Mark,

> >> So I guess we should revert 83d4c4d622b406ec0bc9d8139ec8182fa72b5720 and
> >> release 2.2.4 afterwards.  Does that make sense, Andy?  

I hope (one of) you will find some time to look at 

	bug#29669: repl-print - requet for improvement
	bug#29684: exception printers - request for improvement

so a solution could be part of 2.2.4

Thanls,
David
[Message part 2 (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 14 Feb 2018 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 72 days ago.

Previous Next


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