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#48079: Temporary files while building after native-comp merge Date: Sun, 02 Jan 2022 18:38:41 -0500 Message-ID: References: <835z06hanw.fsf@gnu.org> <83y2d2fv6c.fsf@gnu.org> <83wnslekok.fsf@gnu.org> <83lf91e9bq.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="25918"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Eli Zaretskii , stefan@marxist.se, 48079@debbugs.gnu.org To: Andrea Corallo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 03 00:40:45 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 1n4ASx-0006Wa-UA for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 03 Jan 2022 00:40:44 +0100 Original-Received: from localhost ([::1]:56432 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n4ASw-0006Fn-Rb for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 Jan 2022 18:40:42 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n4ASI-0006Fc-BI for bug-gnu-emacs@gnu.org; Sun, 02 Jan 2022 18:40:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50596) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n4ASI-0008HG-1z for bug-gnu-emacs@gnu.org; Sun, 02 Jan 2022 18:40:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n4ASH-0001L1-So for bug-gnu-emacs@gnu.org; Sun, 02 Jan 2022 18:40:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 02 Jan 2022 23:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48079 X-GNU-PR-Package: emacs Original-Received: via spool by 48079-submit@debbugs.gnu.org id=B48079.16411667425058 (code B ref 48079); Sun, 02 Jan 2022 23:40:01 +0000 Original-Received: (at 48079) by debbugs.gnu.org; 2 Jan 2022 23:39:02 +0000 Original-Received: from localhost ([127.0.0.1]:33909 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4ARJ-0001JL-RC for submit@debbugs.gnu.org; Sun, 02 Jan 2022 18:39:02 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:13610) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4ARH-0001J0-Dl for 48079@debbugs.gnu.org; Sun, 02 Jan 2022 18:39:00 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 271C310018E; Sun, 2 Jan 2022 18:38:53 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id AD8D1100054; Sun, 2 Jan 2022 18:38:51 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1641166731; bh=FEoEkY27XRWZ1OhjaP1NghK1f/kKL0zM3HHEBO0whdA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=PHwwaIOeRzYqZ8g8/y5zJXHtblM4/AueoHIptGUD3I9vUzULSTcObVplADeUS1dmc jd0Kra3stTL4bH7EBWpZbZfBfsUUGxScdRZldzpFa9avTM2GBe5mkXphN9V2oDzmLu Dio/aGLLsdS7A4M6js2viC7cWdvWXZW0FcYW1o8DBXmCZ4ZVTRvo3dolCPaccTvJer xO08HRUmtJEDdrRpfEd2RNSutiTFvRCKi0XYHN3oR8wLue6fb3DYIG5JspRnBeVlgJ aLMmA32HHB6fcGbz5wlAInP+YBkACGsXHb1YWVOcodz/WKpmYDYbSJJUzyKWn2BXPo 7DH5TclXdg7bw== Original-Received: from ceviche (unknown [216.154.30.173]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 757221202B9; Sun, 2 Jan 2022 18:38:51 -0500 (EST) In-Reply-To: (Andrea Corallo's message of "Thu, 29 Apr 2021 10:15:58 +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:223571 Archived-At: >> Btw, what is the reason that these temporary *.elc files live longer >> with the native compilation? > > Yes, essentially just the fact that compilation takes longer. > > When we compile Emacs the makefile uses > `batch-byte-native-compile-for-bootstrap' to produce both the .elc and > the .eln. As the eln is produced as side product of the .elc to have > the makefile dependecy model work we can't rename the .elc before the > .eln is also finished even if we could, otherwise in case of > interruption we may have the .elc produced but not the .eln. Hmm... IIUC the situation is the following: In the plain old byte-compiler, these files are *very* short lived because they're not created during the compilation itself but only at the very end when we save the result to a file (and we just do it by first saving to `foo.elcNNMMPP` and then renaming that to `foo.elc`). Now with `batch-byte-native-compile-for-bootstrap` apparently we "suspend the byte-compiler" right in the middle of this small time window, i.e. after writing to `foo.elcNNMMPP` but before its renamed. Then we call the native compiler and only once the native compiler is done, we resume the byte compilation which just renames the file and exits. If that understanding is correct, then I think we may be able to fix the problem by just changing the moment at which we suspend the byte-compiler: suspend it *before* it writes to `foo.elcNNMMPP`. Stefan