From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: ludovic.courtes@inria.fr (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Newsgroups: gmane.lisp.guile.bugs Subject: bug#29226: fresh-auto-compile =?UTF-8?Q?doesn=E2=80=99t?= invalidate the compilation cache Date: Thu, 09 Nov 2017 13:53:22 +0100 Message-ID: <87zi7vmx4t.fsf@inria.fr> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1510232051 32065 195.159.176.226 (9 Nov 2017 12:54:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 9 Nov 2017 12:54:11 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) To: 29226@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Thu Nov 09 13:54:06 2017 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eCmLO-000867-1Z for guile-bugs@m.gmane.org; Thu, 09 Nov 2017 13:54:06 +0100 Original-Received: from localhost ([::1]:36550 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCmLV-00014Z-7y for guile-bugs@m.gmane.org; Thu, 09 Nov 2017 07:54:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60746) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCmLO-00014J-Rq for bug-guile@gnu.org; Thu, 09 Nov 2017 07:54:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eCmLK-0006BR-Qh for bug-guile@gnu.org; Thu, 09 Nov 2017 07:54:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50826) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eCmLK-0006BL-My for bug-guile@gnu.org; Thu, 09 Nov 2017 07:54:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eCmLK-0001Fb-Ft for bug-guile@gnu.org; Thu, 09 Nov 2017 07:54:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: ludovic.courtes@inria.fr (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Thu, 09 Nov 2017 12:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 29226 X-GNU-PR-Package: guile X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15102320174770 (code B ref -1); Thu, 09 Nov 2017 12:54:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Nov 2017 12:53:37 +0000 Original-Received: from localhost ([127.0.0.1]:59507 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eCmKv-0001Es-Hh for submit@debbugs.gnu.org; Thu, 09 Nov 2017 07:53:37 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:41509) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eCmKu-0001Eh-Pg for submit@debbugs.gnu.org; Thu, 09 Nov 2017 07:53:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eCmKo-00063W-NE for submit@debbugs.gnu.org; Thu, 09 Nov 2017 07:53:31 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:39201) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eCmKo-00063Q-Jb for submit@debbugs.gnu.org; Thu, 09 Nov 2017 07:53:30 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCmKn-0000yu-6c for bug-guile@gnu.org; Thu, 09 Nov 2017 07:53:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eCmKk-00062b-3n for bug-guile@gnu.org; Thu, 09 Nov 2017 07:53:29 -0500 Original-Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:33733) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eCmKj-00061p-Qc for bug-guile@gnu.org; Thu, 09 Nov 2017 07:53:26 -0500 X-IronPort-AV: E=Sophos;i="5.44,369,1505772000"; d="scan'208";a="300075012" Original-Received: from unknown (HELO ribbon) ([193.50.110.150]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/AES256-GCM-SHA384; 09 Nov 2017 13:53:22 +0100 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 19 Brumaire an 226 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:8885 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, =E2=80=98%fresh-auto-compile=E2=80=99 is documented as a way to =E2=80=9Cfo= rcibly invalidate the auto-compilation cache=E2=80=9D (info "(guile) Compilation"), but it seems = that it doesn=E2=80=99t invalidate much. Specifically, =E2=80=98primitive-load-= path=E2=80=99 does: compiled_thunk =3D load_thunk_from_path (filename, full_filename, &stat_s= ource, &found_stale_compiled_file); if (scm_is_false (compiled_thunk) && scm_is_false (*scm_loc_fresh_auto_compile) =E2=80=A6) { =E2=80=A6 } =E2=80=A6 if (scm_is_true (compiled_thunk)) return scm_call_0 (compiled_thunk); else { SCM freshly_compiled =3D scm_try_auto_compile (full_filename); =E2=80=A6 } So if there=E2=80=99s a .go file in the search path, it is *always* loaded,= and there=E2=80=99s no way we reach =E2=80=98scm_try_auto_compile=E2=80=99. =E2=80=98load-absolute=E2=80=99 in boot-9.scm seems to have the same proble= m: (and scmstat (or (pre-compiled) (fallback))) I believe the attached patch fixes it. Thoughts? Thanks, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: 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 --=-=-=--