From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#48079: Temporary files while building after native-comp merge Date: Mon, 03 Jan 2022 19:14:17 +0200 Message-ID: <83zgocbv2u.fsf@gnu.org> References: <835z06hanw.fsf@gnu.org> <83y2d2fv6c.fsf@gnu.org> <83wnslekok.fsf@gnu.org> <83lf91e9bq.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33620"; mail-complaints-to="usenet@ciao.gmane.io" Cc: akrl@sdf.org, stefan@marxist.se, 48079@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 03 18:15:14 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 1n4QvR-0008Zb-SK for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 03 Jan 2022 18:15:14 +0100 Original-Received: from localhost ([::1]:35986 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n4QvQ-0005tQ-5Y for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 03 Jan 2022 12:15:12 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:33836) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n4QvG-0005tB-Qq for bug-gnu-emacs@gnu.org; Mon, 03 Jan 2022 12:15:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52792) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n4QvG-0003yV-Hd for bug-gnu-emacs@gnu.org; Mon, 03 Jan 2022 12:15:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n4QvG-0001lm-EP for bug-gnu-emacs@gnu.org; Mon, 03 Jan 2022 12:15:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 03 Jan 2022 17:15:02 +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.16412300626734 (code B ref 48079); Mon, 03 Jan 2022 17:15:02 +0000 Original-Received: (at 48079) by debbugs.gnu.org; 3 Jan 2022 17:14:22 +0000 Original-Received: from localhost ([127.0.0.1]:36105 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4Qub-0001kY-M8 for submit@debbugs.gnu.org; Mon, 03 Jan 2022 12:14:21 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:33022) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n4Qua-0001kD-30 for 48079@debbugs.gnu.org; Mon, 03 Jan 2022 12:14:20 -0500 Original-Received: from [2001:470:142:3::e] (port=56422 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n4QuS-0003qR-S5; Mon, 03 Jan 2022 12:14:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=F03yojL2VJiI0ZS1gGhg6/65uxW/WsCHJ8BrAhE3YyM=; b=geJeeAp6yGQc c0Iyxo2zJdl0q91HqXcYBehanq7CbV0UHC2bNFjkAifNgmEfIy3vkMCZcuYum3s+Xrvx6QOEpqOYB kk3bKOlLg8smbFo0uTplr8xHieE+v5bN6sMaVsvizYrqQ+R1GGBCIiVS58BDbZAxfsHSdJgwXh5OL hTbCKHW7+RFm8uqMhwiLDAhO0ptfnhwdo8wqiwJYjFXGY3U3zCwROPBfr1BA507DowIwjehIcC0Se RfONGQ/AztFZ6umTHvMEAsrrjis9r9GI8Sfzr79df93G/KR98oEuNktNmbqtdSLPFaWgQYZVz/eA9 tTckxmgKjVZptwVHHebCiQ==; Original-Received: from [87.69.77.57] (port=2364 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n4QuS-0000eB-Sj; Mon, 03 Jan 2022 12:14:13 -0500 In-Reply-To: (message from Stefan Monnier on Sun, 02 Jan 2022 18:38:41 -0500) 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:223593 Archived-At: > From: Stefan Monnier > Cc: Eli Zaretskii , stefan@marxist.se, 48079@debbugs.gnu.org > Date: Sun, 02 Jan 2022 18:38:41 -0500 > > 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`. Are you sure your description above is accurate? 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, but it looks like the "suspend later" idea might not work?