From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "N. Jackson" Newsgroups: gmane.emacs.bugs Subject: bug#73303: 30.0.91; Native compiler repeatedly interrupts at random moments Date: Tue, 17 Sep 2024 16:01:18 +0000 Message-ID: <87ed5iz2up.fsf@Phoenix> References: <87wmjbmpnt.fsf@moondust.awandering> <867cbbcuen.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4044"; mail-complaints-to="usenet@ciao.gmane.io" To: 73303@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 17 18:02:17 2024 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 1sqaef-0000t9-7E for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 17 Sep 2024 18:02:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sqaeE-0007aT-Uj; Tue, 17 Sep 2024 12:01:51 -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 1sqaeC-0007VS-5H for bug-gnu-emacs@gnu.org; Tue, 17 Sep 2024 12:01:48 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sqaeB-00048S-SP for bug-gnu-emacs@gnu.org; Tue, 17 Sep 2024 12:01:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=U/bQEA7lghpFJtk0WjLIrlbK5hxjAMTz6rzviXnevgM=; b=EJhW3fRhzRJ/1g6yIPCPGtyF9oltV8UFWpy7lKJ2WNWgmgHv1+uzHoedoIIhrm3nWYgD+cKCMfSoIneQPVfffHkAPBl15NoOnKdLuZyOjE9/sBviOmOxg59Y5ayuLVLN+JMtSVsWcA81mGPS2WvqTkwmmqNP9/K7gaNDXBoL61QOKAa92sCdA65TLkEJ/OdrmQlc7v1iunheS88QFte4G+9BQDzDol/W7ThKN5SWVoRT/2ZwTxlU9xw/8tX2Cbd2OoeUOmUHQfjnqCFUqlv9W2cmcPi6d/a90RGpkvldvlJ2YnALPxqta6mMesaMEyTnTByYg7igyPmbXp2v2iUwWw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sqaeQ-00058a-5v for bug-gnu-emacs@gnu.org; Tue, 17 Sep 2024 12:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "N. Jackson" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Sep 2024 16:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73303 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 73303-submit@debbugs.gnu.org id=B73303.172658890519717 (code B ref 73303); Tue, 17 Sep 2024 16:02:02 +0000 Original-Received: (at 73303) by debbugs.gnu.org; 17 Sep 2024 16:01:45 +0000 Original-Received: from localhost ([127.0.0.1]:55776 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sqae8-00057x-RQ for submit@debbugs.gnu.org; Tue, 17 Sep 2024 12:01:45 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:39483) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sqae5-00057g-UE for 73303@debbugs.gnu.org; Tue, 17 Sep 2024 12:01:42 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 0211A240029 for <73303@debbugs.gnu.org>; Tue, 17 Sep 2024 18:01:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1726588881; bh=8BgvwPWgEkJdCVRfbqQ2OEY0CRaHG5M7k3/PQuFcLDY=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=MkxLMpY9r1Gmt9QiEumdZ2xHKPZQGpJYu1TqRKwZopV5uhpLViLCk8vRLCt2P9Kr7 ZcMN7HNgrwRJSN+P1+U46E0AFaasmNejgAAVk+JoKhILwGeCP5DGbYJOsS7a0Btmig cNZzei60CaejsEiUJZCUQmQ9SqXBkv1nUOB2rvePEkPgM4B48OnsH9ITm7lypswRsy Y80KUHVASGt6UZPcMkkx0bhp6vSErSIIAZaTpDJA4/AP03Cj+pzCdECJXnRjrYaVtz yidTiFV4zvyBW52IsZ2dCjxKNRte18BdyF2AhpxCRbU2Bt8bCZw9V+yew/GNnhwr8/ 9gXR8zrATJHdw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4X7RNJ1Z7Qz6tw4 for <73303@debbugs.gnu.org>; Tue, 17 Sep 2024 18:01:19 +0200 (CEST) In-Reply-To: <867cbbcuen.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 16 Sep 2024 21:42:24 +0300") 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:291951 Archived-At: I'm resending this message to 73303@debbugs.gnu.org only, because the first time my mail service provider bounced the copy to 73303@debbugs.gnu.org (because debbugs.gnu.org[209.51.188.43] refused a TLS connection). Hello Eli, thank you for your response. At 21:42 +0300 on Monday 2024-09-16, Eli Zaretskii wrote: > I see no bug in what you describe. Fair enough. The concern that prompted me to file a bug report was not that native compile is broken (a literal bug) but rather that since it's a newish feature you might welcome end-user feedback about it's default behaviour (or perceived behaviour) that might lead to to beneficial tweaks to either the behaviour or to the documentation. > These warnings usually mean that the offending Lisp file lacks > some 'require's. JIT native compilation runs in a separate Emacs > session, which only loads the file it compiles, so any missing > 'require's or autoloading cookies trigger these warnings, whereas > when the same packages are loaded into your main Emacs session, > they can benefit from packages loaded earlier in the session. ... > JIT native compilation is triggered by loading a .elc file that > doesn't yet have a corresponding .eln file Thank you for the overview of how native compilation works. I had wrongly guessed that it was deferring the compilation lazily and doing it later on an idle timer or something of that sort. If I understand what you are saying correctly, the native compiler, not having a crystal ball, cannot possibly know ahead of time what .elc files a user might load, so it cannot compile them ahead of time. However, as a na=C3=AFve end-user of Emacs, when I am _using_ Emacs, as a tool to get a job done -- writing an essay, say -- I don't want to think about the guts of how Emacs works. I'm happy to save that for when I'm building Emacs or maintaining my configuration files and that is when I would want the native compilation to happen, if that were possible. You write > You can disable these warnings if you are annoyed by them. They > are just warnings, and will not usually cause any problems when > using the compiled code. See > native-comp-async-report-warnings-errors. Sweeping warnings under the rug isn't something I'm comfortable with even if nine times out of ten (or 999 times in 1000) they're false alarms. (I'm the sort of person that -Werror was made for.) > You can cause these compilations to happen at the beginning of your > Emacs session if you change your init files such that Emacs loads all > these files. ... > In any case, Emacs compiles each Lisp file just once, so you should > only see these when you start a new Emacs version for the first time. I guess, then, that I would want to (somehow) process my init files -- before using Emacs for the first time after upgrading to a new version -- to ensure native compilation of all dependencies. Do you have any pointers on how to go about doing that? It seems impractical for a casual Emacs user since they don't necessary know what files will be loaded by the packages they use. The warnings I've seen so far all refer to files I've never heard of. I don't suppose there's a function native-compile-eagerly-compile-all-dependencies-of-my-init-files-and-do-it-= synchronously-right-now?! If I can deal with my init files (ensuring that they won't load any files that haven't yet been native compiled), it seems I would be left with two potential sources of files being native compiled -- Emacs itself, and newly installed/updated packages. Two questions about that, then: 1. Does the native compiler compile all the .elc files in Emacs itself into .eln files ahead of time, or does it also leave those until they are loaded? 2. When the package system installs/updates a package, does it natively compile the files at the same time as it byte compiles them?