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: Thu, 06 Jan 2022 12:15:31 -0500 Message-ID: References: <835z06hanw.fsf@gnu.org> <83y2d2fv6c.fsf@gnu.org> <83wnslekok.fsf@gnu.org> <83lf91e9bq.fsf@gnu.org> <83zgocbv2u.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="24806"; 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 Thu Jan 06 18:16:39 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 1n5WNT-0006K5-41 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 06 Jan 2022 18:16:39 +0100 Original-Received: from localhost ([::1]:46120 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n5WNP-0005ET-RL for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 06 Jan 2022 12:16:37 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44002) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n5WMs-0005DG-CV for bug-gnu-emacs@gnu.org; Thu, 06 Jan 2022 12:16:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49195) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n5WMs-0006Iy-3T for bug-gnu-emacs@gnu.org; Thu, 06 Jan 2022 12:16:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n5WMr-0000sW-QL for bug-gnu-emacs@gnu.org; Thu, 06 Jan 2022 12:16: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: Thu, 06 Jan 2022 17:16: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.16414893442274 (code B ref 48079); Thu, 06 Jan 2022 17:16:01 +0000 Original-Received: (at 48079) by debbugs.gnu.org; 6 Jan 2022 17:15:44 +0000 Original-Received: from localhost ([127.0.0.1]:42098 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5WMZ-0000aF-Gc for submit@debbugs.gnu.org; Thu, 06 Jan 2022 12:15:43 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:34280) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5WMW-0000RB-UY for 48079@debbugs.gnu.org; Thu, 06 Jan 2022 12:15:42 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 0FB644420CD; Thu, 6 Jan 2022 12:15:35 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 633F3441FCC; Thu, 6 Jan 2022 12:15:33 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1641489333; bh=h7AXRzbPak0JKSuZygZS69PiveYyL/R/Th4+JrKwgIY=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=KiR4WAvU4voRcfZ3lxRXeiJO8UYXzBQHQIXLcS5tkZzWwPwAP2vO7D447y83rk9/t 18phIgSGJyONaLYf7hJIbnA9Gznf/FbEVWt/bkjBnbS9pxPxFWAVDaUUOf9PETxReF qoNoEwLZZlwLM0X2JJnxdk08H9xhUwe5TQ9UP7x1F1ZpLnR1KDDJ8p4PjsmvTI6VU/ JGm82aW/n6GVcy99XBEb70AOciV4eUAgeJO08+TejODADLh84pk06a1dNpnDWbWQKL tZKR/EFY6waVj1nvkTb0QKJ23iOyZ1uKiA1JqcTuONTlWbJ6dxOS9ZilbPu4IRSzSV OIKrkiCzd2weA== Original-Received: from ceviche (unknown [216.154.30.173]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 273501201F0; Thu, 6 Jan 2022 12:15:33 -0500 (EST) In-Reply-To: (Andrea Corallo's message of "Thu, 06 Jan 2022 16:10:37 +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:223740 Archived-At: Andrea Corallo [2022-01-06 16:10:37] wrote: > Eli Zaretskii writes: >>> 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`. >> >> Are you sure your description above is accurate? No, but I haven't heard any indication to the contrary either. >> We have a backtrace in bug#48978 that shows when we create the >> .elcXXX temporary file. My reading of that backtrace is that it's >> the other way around: native-compilation invokes byte-compile-file, >> which compiles the Lisp into bytecode, creates the file with >> make-temp-file, and writes out the bytecode. It is true that we then >> defer renaming of the temporary file in this case I don't see why you say "the other way around". Maybe you're putting more emphasis on some detail of what I wrote than what I intended. The core os what I wrote is that we should change the code so that the native compilation takes place before the `.elcNNMMPP` file is written rather than after. AFAICT the native compiler does not read/need that file because it gets the same information in a more convenient format straight from `bytecomp.el`. > That's correct, I don't know what "That" refers to. Stefan