From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#64494: 30.0.50; Recursive load error with native-compile Date: Fri, 07 Jul 2023 21:22:33 -0400 Message-ID: References: <83ttuhgjpg.fsf@gnu.org> <83sf9zeg2k.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39217"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: germanp82@hotmail.com, 64494@debbugs.gnu.org, acorallo@gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 08 03:23:26 2023 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 1qHwfW-0009xz-0x for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Jul 2023 03:23:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qHwfA-0002HT-7v; Fri, 07 Jul 2023 21:23:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qHwf9-0002HI-5f for bug-gnu-emacs@gnu.org; Fri, 07 Jul 2023 21:23:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qHwf8-000509-Rf for bug-gnu-emacs@gnu.org; Fri, 07 Jul 2023 21:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qHwf8-0002GO-C2 for bug-gnu-emacs@gnu.org; Fri, 07 Jul 2023 21:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Jul 2023 01:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64494 X-GNU-PR-Package: emacs Original-Received: via spool by 64494-submit@debbugs.gnu.org id=B64494.16887793688662 (code B ref 64494); Sat, 08 Jul 2023 01:23:02 +0000 Original-Received: (at 64494) by debbugs.gnu.org; 8 Jul 2023 01:22:48 +0000 Original-Received: from localhost ([127.0.0.1]:43948 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qHwet-0002Fe-OI for submit@debbugs.gnu.org; Fri, 07 Jul 2023 21:22:48 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:3837) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qHwer-0002FQ-6H for 64494@debbugs.gnu.org; Fri, 07 Jul 2023 21:22:46 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 88DA08006F; Fri, 7 Jul 2023 21:22:39 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id F3506802B3; Fri, 7 Jul 2023 21:22:33 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1688779354; bh=4I7mwU1VHD4nBHwMX2xZYyS+4gVFg9dCPMBKKfyNXCs=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=SMHtopC3+3jiVrCPcyQAhHnYexnrAnL+y2itIccyEt5poBMJsYWEXDrQEcmqpLfBo ku7H0X/tKkY9SgfB8BnDg2PbAXzcBVvgsI2I2VCRmxZQBVVVwaxDMW4jmC9nknLH2F mVI02ApogVdNA/1u/xtQ+DJoQGRe9WH862t//OEGjhPi1O47OSVIVw5Pi4ErZ98vvL H5dht6gBxkobpKy4T/Iw+beWjLzCf69CPycekcVNGHTIDfwRF8kaHa0qw/rsENi3g4 N4DCCSRv+0ZjKFd6sC65EWAtLfx6XU6ug19jb4S6TkH1Hmvy4ufaKTUDnYj4hP4/CV ImoJmlynpxFcA== Original-Received: from pastel (69-165-155-162.dsl.teksavvy.com [69.165.155.162]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C481012026A; Fri, 7 Jul 2023 21:22:33 -0400 (EDT) In-Reply-To: (Stefan Monnier's message of "Fri, 07 Jul 2023 16:18:16 -0400") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:264749 Archived-At: > There's another thing I don't quite understand about our code here: why > do we call `native--compile-async` from `defalias` (via > `maybe_defer_native_compilation`) rather than doing it from something > like `after-load-functions`? Hmm... I see that its not done for the "deferred compilation" but it's done for the subsequent *reload* (which replaces the previously loaded bytecode functions with their newly native-compiled version). The problem being that we shouldn't load the .eln (and thus replace the bytecode with native code) if the bytecode has been replaced with something else in the mean time. IOW, we need some way to detect when changes occur to the `.elc`-defined functions between the time the `.elc` file is loaded and the time the `.eln` file is available for load. This is done by storing the `.elc` definitions in an auxiliary hash-table (`comp-deferred-pending-h`) so they can be compared to the current definition before replacing it withe new definition from`.eln`. So, if we want to do it from `after-load-functions`, we need to use `load-history` to collect all the definitions and populate `comp-deferred-pending-h`. Stefan