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: Fri, 14 Jan 2022 10:58:20 -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="39643"; 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 Fri Jan 14 17:17:26 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 1n8PGX-000A8J-Ki for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 14 Jan 2022 17:17:25 +0100 Original-Received: from localhost ([::1]:39304 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8PGW-0007qB-NP for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 14 Jan 2022 11:17:24 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43822) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8Oyt-0002P2-OC for bug-gnu-emacs@gnu.org; Fri, 14 Jan 2022 10:59:13 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44983) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n8Oyj-0003dO-V8 for bug-gnu-emacs@gnu.org; Fri, 14 Jan 2022 10:59:11 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n8Oyj-0004rB-R1 for bug-gnu-emacs@gnu.org; Fri, 14 Jan 2022 10:59: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: Fri, 14 Jan 2022 15:59: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.164217591218622 (code B ref 48079); Fri, 14 Jan 2022 15:59:01 +0000 Original-Received: (at 48079) by debbugs.gnu.org; 14 Jan 2022 15:58:32 +0000 Original-Received: from localhost ([127.0.0.1]:37886 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n8OyG-0004qI-HE for submit@debbugs.gnu.org; Fri, 14 Jan 2022 10:58:32 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:42057) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n8OyD-0004pz-B3 for 48079@debbugs.gnu.org; Fri, 14 Jan 2022 10:58:31 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 480994423E8; Fri, 14 Jan 2022 10:58:23 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 8AEB0441645; Fri, 14 Jan 2022 10:58:21 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1642175901; bh=lPSA5mdHDf2iTd3bCoCaknJB7k0CpBhFYj01FHQsTGE=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=CzAIbvGTDZugBZC0oUumx3LhLt0AvVUqude2RvOa6243sErHXRM6geicFozhLlNxF piqYiPSuV14BNr4tNlM/y940V/kg0ACOrtmWWCadi/RErBYrSUAYFS4gG0s7Z8hjzo 721CyXRzXm2ZxpplT26vkXuwi6Kh5AdiQOI4xTLf2CAPu7vRDHjJ1gVcZ4BCakkK73 158bYqwgOLtp2ultdJ19VcF1KhXShscBoJqRpo7lS2d1QlsPqUr8ndqZFKLs5/OXG0 tGe5OjxuAGbvM7WtNjeAXP1ofJCfs4yNDsXppAg3YXjnBxkMa9hHdfzW+ggBywYBP+ xdC2AU/kmkPNA== Original-Received: from pastel (unknown [216.154.30.173]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 2B8DA1207AA; Fri, 14 Jan 2022 10:58:21 -0500 (EST) In-Reply-To: (Andrea Corallo's message of "Fri, 07 Jan 2022 16:30:05 +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:224216 Archived-At: Andrea Corallo [2022-01-07 16:30:05] wrote: > Stefan Monnier writes: >> 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. > > Eli's description of how it works. But your response seems to say that what I propose can't work, whereas I can't see in which sense what Eli says contradicts what I say. Stefan