From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.bugs Subject: bug#48079: Temporary files while building after native-comp merge Date: Fri, 07 Jan 2022 16:30:05 +0000 Message-ID: References: <835z06hanw.fsf@gnu.org> <83y2d2fv6c.fsf@gnu.org> <83wnslekok.fsf@gnu.org> <83lf91e9bq.fsf@gnu.org> <83zgocbv2u.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9526"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 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 Fri Jan 07 17:31: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 1n5s93-0002Fl-JR for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 Jan 2022 17:31:13 +0100 Original-Received: from localhost ([::1]:39238 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n5s92-00058U-AX for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 Jan 2022 11:31:12 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:34590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n5s8s-000564-5d for bug-gnu-emacs@gnu.org; Fri, 07 Jan 2022 11:31:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52867) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n5s8r-00063O-Rf for bug-gnu-emacs@gnu.org; Fri, 07 Jan 2022 11:31:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n5s8r-0002Sm-OC for bug-gnu-emacs@gnu.org; Fri, 07 Jan 2022 11:31:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 07 Jan 2022 16:31: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.16415730139393 (code B ref 48079); Fri, 07 Jan 2022 16:31:01 +0000 Original-Received: (at 48079) by debbugs.gnu.org; 7 Jan 2022 16:30:13 +0000 Original-Received: from localhost ([127.0.0.1]:45770 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5s84-0002RQ-RF for submit@debbugs.gnu.org; Fri, 07 Jan 2022 11:30:13 -0500 Original-Received: from mx.sdf.org ([205.166.94.24]:62435) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5s80-0002Q8-5B for 48079@debbugs.gnu.org; Fri, 07 Jan 2022 11:30:10 -0500 Original-Received: from ma.sdf.org (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 207GU50k025071 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Fri, 7 Jan 2022 16:30:05 GMT In-Reply-To: (Stefan Monnier's message of "Thu, 06 Jan 2022 12:15:31 -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:223802 Archived-At: 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. BR Andrea