From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#46617: 28.0.50; nativecomp: native compile cache is not invalidated when file is re-byte compiled and changes Date: Sun, 21 Mar 2021 20:54:04 +0000 Message-ID: References: Reply-To: Andrea Corallo Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12567"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 46617@debbugs.gnu.org To: Aaron Jensen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 21 21:55:21 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lO56W-0003BM-Sg for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 21 Mar 2021 21:55:20 +0100 Original-Received: from localhost ([::1]:51042 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lO56V-0003rL-U8 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 21 Mar 2021 16:55:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40938) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lO56F-0003r5-T1 for bug-gnu-emacs@gnu.org; Sun, 21 Mar 2021 16:55:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44001) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lO56E-0006kQ-23 for bug-gnu-emacs@gnu.org; Sun, 21 Mar 2021 16:55:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lO56D-0001Ml-VK for bug-gnu-emacs@gnu.org; Sun, 21 Mar 2021 16:55:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Mar 2021 20:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46617 X-GNU-PR-Package: emacs Original-Received: via spool by 46617-submit@debbugs.gnu.org id=B46617.16163600495183 (code B ref 46617); Sun, 21 Mar 2021 20:55:01 +0000 Original-Received: (at 46617) by debbugs.gnu.org; 21 Mar 2021 20:54:09 +0000 Original-Received: from localhost ([127.0.0.1]:55547 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lO55N-0001LW-B2 for submit@debbugs.gnu.org; Sun, 21 Mar 2021 16:54:09 -0400 Original-Received: from mx.sdf.org ([205.166.94.24]:64437) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lO55J-0001LJ-MM for 46617@debbugs.gnu.org; Sun, 21 Mar 2021 16:54:07 -0400 Original-Received: from mab (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 12LKs4bk015217 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Sun, 21 Mar 2021 20:54:04 GMT In-Reply-To: (Andrea Corallo via's message of "Sun, 21 Mar 2021 17:59:23 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:202807 Archived-At: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > Aaron Jensen writes: > >> On Sun, Mar 21, 2021 at 12:27 PM Andrea Corallo wrote: >>> >>> Hi Aaron, >>> >>> I had to slightly modify your init.el reproducer as we have changed the >>> semantic of `load' [1]. >> >> With this change, how do you specify that you want the eln to load if >> it's there? If I understand correctly, this prevents loading the eln >> with load unless it is specified explicitly? Or can you leave the >> extension off when loading and that will prefer the eln, then elc, >> then el? > > Exactly load by default tries to add the extentions to the FILE > argument. > >>> I think what happened is that in the original reproducer the second load >>> of the .elc file still automatically loaded in place the corresponding >>> .eln as the source file didn't changed. The issue here is that in the >>> compilation unit repro.elk is capturing some of the environment and this >>> is not accounted in the hash computation of the .eln file. >> >> The original repro simulated a restart without a restart. The real bug >> (in straight.el) is that on start, it loads a byte compiled/native >> compiled file that relies on outside environment. So, that may be >> fixed now because I believe they load the elc explicitly, but that >> means it'll never load the native compiled version. Ideally, they >> would, but I don't know how to force loading byte compiled OR native >> compiled in one command. > > ATM to force the byte-code version to be used one can use `load' making > the .elc extension explicit (or without using the extension binding > `load-no-native' to non-nil). > > To explicitly force load the native code version one has to do like: > > (load (comp-el-to-eln-filename ".../foo.el")) > > But this is limited as it works only if the .eln is in the first > directory of `com-eln-load-path', so probably we have to offer a more > complete solution. Okay I've added `comp-lookup-eln' son now the user can search if a certain .eln is in reach in `comp-eln-load-path' for a given .el. So now one can use the following to force a native load. (load (comp-lookup-eln ".../foo.el")) Andrea