From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#57627: 29.0.50; [native-compilation] cl-loaddefs.el recompiled on startup Date: Sun, 16 Oct 2022 10:21:47 +0200 Message-ID: <87k0502n6s.fsf@gnus.org> References: <87bkrsr1g2.fsf@gnus.org> <875yi0qz5b.fsf@gnus.org> <83sfl4ihfo.fsf@gnu.org> <87mtbcp774.fsf@gnus.org> <877d2e5ba1.fsf@gnus.org> <87czc4v5id.fsf@gnus.org> <874jxfsv9o.fsf@gnus.org> <874jw6d6cl.fsf@gnus.org> <871qr95r8z.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28767"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: germanp82@hotmail.com, 57627@debbugs.gnu.org, Eli Zaretskii , Andrea Corallo To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 16 10:23:13 2022 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 1ojyvR-0007GX-0A for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 16 Oct 2022 10:23:13 +0200 Original-Received: from localhost ([::1]:51582 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ojyvP-0002NJ-JX for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 16 Oct 2022 04:23:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59596) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ojyvJ-0002Mv-9j for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2022 04:23:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44187) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ojyvH-0005DO-1l for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2022 04:23:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ojyvF-00052p-Lr for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2022 04:23:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 16 Oct 2022 08:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57627 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 57627-submit@debbugs.gnu.org id=B57627.166590852719318 (code B ref 57627); Sun, 16 Oct 2022 08:23:01 +0000 Original-Received: (at 57627) by debbugs.gnu.org; 16 Oct 2022 08:22:07 +0000 Original-Received: from localhost ([127.0.0.1]:43265 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ojyuN-00051W-1a for submit@debbugs.gnu.org; Sun, 16 Oct 2022 04:22:07 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:41320) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ojyuI-00050w-K3 for 57627@debbugs.gnu.org; Sun, 16 Oct 2022 04:22:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=asoiDOth01QHQCJk6dwjXkBNLx6duALRUqpP+M/Y/vw=; b=iON2VOyyI8hZnLac76ulVUKglL klMSZzTcuUNC8r3x5HrxGEccXlLoqZIjiePXWqlO8ElYfzMQWdT8O7coVfKGzXDAYs1kEU0nA1a7v QgoDR1xiBLBMm4po9SE9kMJH/xc6yOu0zN43RPuq4HaKZys+EB7pQXFbxeTiP/5dnL0M=; Original-Received: from [84.212.220.105] (helo=downe) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ojyu6-00041q-KN; Sun, 16 Oct 2022 10:21:52 +0200 In-Reply-To: (Stefan Monnier's message of "Sat, 15 Oct 2022 10:19:57 -0400") Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAMFBMVEX+/v7r5ufa0dOT eoOIbHeecXKrnJ5NPD5KOEM2JzFJMTprVV4dEx7DtrmAO0X///8iZEbjAAAAAWJLR0QPGLoA2QAA AAd0SU1FB+YKEAcoKHvHDdQAAAEpSURBVDjL1dO/T4NAFMBx/A96XZxLnFxxc70QE+ZObpZcE4Mz rYwuYpnUICBOGvkRF1PSlr6OxpT0TR10MGz+IaLjg+72u35yL3eXPEnaylibMSZXdQgcdHsKNwd2 9EjgEMYKP7cH6ROBfv7e48mz+LwlcDR3uzx5aO2+EcgtYfJ4Kqx7Ak7wccyD1/YeHeWgZWnJtdin sChMAamXDWuwMgQkaBU39FaF2gcs0F4R0Gcu6FgJBQ20DNKrOKZfMr9UfT/jnKsEZqOT0wAqmFCY yF9/Jyjko/G0AK7UADz0cuBaRuEiDJcGcAAKDtqIkDWBHiJAGtdguV4gmMldDdy1UeQYRRReAn+I mh19nxEof+swmTFpS2ptAlGW60aoNqf5dTuMbZz2X/oBFFCMQmahl5wAAAAldEVYdGRhdGU6Y3Jl YXRlADIwMjItMTAtMTZUMDc6NDA6NDArMDA6MDDafE2zAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIy LTEwLTE2VDA3OjQwOjQwKzAwOjAwqyH1DwAAAABJRU5ErkJggg== X-Now-Playing: Pet Shop Boys's _Behaviour_: "The end of the world" 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:245605 Archived-At: Stefan Monnier writes: > Re-reading this discussion what I see is two different options, neither > of which is significantly better than the other. > So the motivation to change is not very high. True. So I've now implemented Stefan's suggestion (i.e., just putting a puthash into the .elc file if the file-local variable says so), and it seems to work fine. Andrea, does this look OK to you? diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 74ba8984f2..1dc5442716 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -2323,9 +2323,15 @@ byte-compile-from-buffer (setq case-fold-search nil)) (displaying-byte-compile-warnings (with-current-buffer inbuffer - (and byte-compile-current-file - (byte-compile-insert-header byte-compile-current-file - byte-compile--outbuffer)) + (when byte-compile-current-file + (byte-compile-insert-header byte-compile-current-file + byte-compile--outbuffer) + ;; Instruct native-comp to ignore this file. + (when (bound-and-true-p no-native-compile) + (with-current-buffer byte-compile--outbuffer + (insert + "(when (boundp 'native-comp--no-native-compile) + (puthash load-file-name t native-comp--no-native-compile))\n\n")))) (goto-char (point-min)) ;; Should we always do this? When calling multiple files, it ;; would be useful to delay this warning until all have been diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 889bffa3f5..3c64f472a0 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -4119,6 +4119,8 @@ native-compile-async-skip-p LOAD and SELECTOR work as described in `native--compile-async'." ;; Make sure we are not already compiling `file' (bug#40838). (or (gethash file comp-async-compilations) + (gethash (file-name-with-extension file "elc") + native-comp--no-native-compile) (cond ((null selector) nil) ((functionp selector) (not (funcall selector file))) diff --git a/lisp/loadup.el b/lisp/loadup.el index c01c827a75..95bfbc502e 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -501,7 +501,10 @@ bin-dest-dir) ;; Relative filename from the built uninstalled binary. (file-relative-name file invocation-directory))))) - comp-loaded-comp-units-h)))) + comp-loaded-comp-units-h))) + ;; Set up the mechanism to allow inhibiting native-comp via + ;; file-local variables. + (defvar native-comp--no-native-compile (make-hash-table :test #'equal))) (when (hash-table-p purify-flag) (let ((strings 0)