From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo via "Emacs development discussions." Newsgroups: gmane.emacs.devel Subject: Re: The emacs-28 release branch has been created Date: Mon, 04 Oct 2021 19:40:50 +0000 Message-ID: References: <83lf3dgbl3.fsf@gnu.org> <6c7a9f1a-bf2d-4213-b954-2025eee1f282@cornell.edu> <838rzaa264.fsf@gnu.org> <2434455f-34f5-3e6b-b26f-db7b66cf8f3d@cornell.edu> <83ee9287ef.fsf@gnu.org> <83a6jq84wu.fsf@gnu.org> <10401c4a-1d0a-817c-942e-f08ab3130552@cornell.edu> <834k9y814j.fsf@gnu.org> <83tuhx7w54.fsf@gnu.org> <30b78a17-2b95-5d0c-fb46-10c37ee91638@cornell.edu> <96912815-d275-8b54-9ba8-cc4fd5b0fe91@cornell.edu> <83v92c6f4n.fsf@gnu.org> <83sfxg6ehc.fsf@gnu.org> <83r1d06dry.fsf@gnu.org> <83h7dw681k.fsf@gnu.org> Reply-To: Andrea Corallo Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15549"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Eli Zaretskii , kbrown@cornell.edu To: Andrea Corallo via "Emacs development discussions." Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Oct 04 21:43:24 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mXTrw-0003rf-Ah for ged-emacs-devel@m.gmane-mx.org; Mon, 04 Oct 2021 21:43:24 +0200 Original-Received: from localhost ([::1]:40624 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXTrv-0006ZB-7J for ged-emacs-devel@m.gmane-mx.org; Mon, 04 Oct 2021 15:43:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38634) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXTpZ-00031U-D0 for emacs-devel@gnu.org; Mon, 04 Oct 2021 15:40:57 -0400 Original-Received: from mx.sdf.org ([205.166.94.24]:59646) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXTpW-0000Hh-Ku; Mon, 04 Oct 2021 15:40:57 -0400 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 194JeogW026545 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Mon, 4 Oct 2021 19:40:50 GMT In-Reply-To: (Andrea Corallo via's message of "Mon, 04 Oct 2021 19:38:43 +0000") Received-SPF: pass client-ip=205.166.94.24; envelope-from=akrl@sdf.org; helo=mx.sdf.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:276260 Archived-At: --=-=-= Content-Type: text/plain Andrea Corallo via "Emacs development discussions." writes: > Eli Zaretskii writes: > >>> From: Andrea Corallo >>> Cc: kbrown@cornell.edu, emacs-devel@gnu.org >>> Date: Mon, 04 Oct 2021 16:15:35 +0000 >>> >>> Okay I see what's the issue. In `comp-final' we spawn a child process >>> to run the final pass or not discriminating on the `byte+native-compile' >>> var. This is wrong cause this is not bound when using >>> `batch-native-compile'. >>> >>> When spawning the sub-process we print the limple dump in a file and this >>> gets in this case truncated (still to be understood why) leading to the >>> error. >>> >>> Will come with patch after dinner. >> >> Thanks. > > Attached. Ok for emacs-28? Attached for real... Apologies Andrea --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-batch-native-compile-not-to-spawn-a-subprocess.patch >From d3f96619660000ff37663c8f9717ff2f620ab2a6 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Mon, 4 Oct 2021 21:15:02 +0200 Subject: [PATCH] * Fix `batch-native-compile' not to spawn a subprocess * lisp/emacs-lisp/comp.el (comp-running-batch-compilation): New var. (comp-final): Use it. (batch-native-compile): Bind `comp-running-batch-compilation' it. --- lisp/emacs-lisp/comp.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 94753ec3d9..63d4a74b54 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -3653,6 +3653,9 @@ comp-final1 (defvar comp-async-compilation nil "Non-nil while executing an asynchronous native compilation.") +(defvar comp-running-batch-compilation nil + "Non-nil when compilation is driven by any `batch-*-compile' function.") + (defun comp-final (_) "Final pass driving the C back-end for code emission." (maphash #'comp-compute-function-type (comp-ctxt-funcs-h comp-ctxt)) @@ -3661,7 +3664,7 @@ comp-final ;; unless during bootstrap or async compilation (bug#45056). GCC ;; leaks memory but also interfere with the ability of Emacs to ;; detect when a sub-process completes (TODO understand why). - (if (or byte+native-compile comp-async-compilation) + (if (or comp-running-batch-compilation comp-async-compilation) (comp-final1) ;; Call comp-final1 in a child process. (let* ((output (comp-ctxt-output comp-ctxt)) @@ -4202,9 +4205,10 @@ batch-native-compile will be placed under the native-lisp/ directory (actually, in the last directory in `native-comp-eln-load-path')." (comp-ensure-native-compiler) - (let ((native-compile-target-directory - (if for-tarball - (car (last native-comp-eln-load-path))))) + (let ((comp-running-batch-compilation t) + (native-compile-target-directory + (if for-tarball + (car (last native-comp-eln-load-path))))) (cl-loop for file in command-line-args-left if (or (null byte+native-compile) (cl-notany (lambda (re) (string-match re file)) -- 2.20.1 --=-=-=--