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.devel Subject: Re: Finalizing 'inhibit-automatic-native-compilation' Date: Fri, 27 Jan 2023 14:19:39 +0000 Message-ID: References: <837cx8cey0.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="40828"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: emacs-devel@gnu.org, Lars Ingebrigtsen , Stefan Monnier , Rob Browning To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jan 27 15:20:31 2023 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 1pLPah-000ANs-3q for ged-emacs-devel@m.gmane-mx.org; Fri, 27 Jan 2023 15:20:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pLPZy-0002QH-Rf; Fri, 27 Jan 2023 09:19:46 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pLPZx-0002OQ-EE for emacs-devel@gnu.org; Fri, 27 Jan 2023 09:19:45 -0500 Original-Received: from mx.sdf.org ([205.166.94.24]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pLPZv-0002g7-Ar; Fri, 27 Jan 2023 09:19:45 -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 30REJdBQ013540 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Fri, 27 Jan 2023 14:19:39 GMT In-Reply-To: <837cx8cey0.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 27 Jan 2023 14:57:59 +0200") Received-SPF: pass client-ip=205.166.94.24; envelope-from=akrl@sdf.org; helo=mx.sdf.org X-Spam_score_int: 14 X-Spam_score: 1.4 X-Spam_bar: + X-Spam_report: (1.4 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:302685 Archived-At: Eli Zaretskii writes: > The variable 'inhibit-automatic-native-compilation' was introduced in > last October, as result of various discussions on this list regarding > the need to disable async native-compilation in some situations. > Since its introduction was met with some opposition, in particular > from Andrea, the final decision about whether this variable should > stay in Emacs was deferred, with the purpose of collecting more data > points and user experience. > > With the pretest of Emacs 29 just around the corner, I think now is > the time to make that final decision. With that in mind, I will first > summarize the changes which this variable introduced into Emacs, and > then ask for opinions regarding some of its aspects. > > This variable was introduced (under the name > 'inhibit-native-compilation') in commit 5fec9182db. In that commit: > > . comp-trampoline-compile was changed to avoid writing the > trampolines to the eln-cache if this variable is non-nil (instead, > it writes the trampolines to a temporary-file directory, and > attempts to delete them after that, which on Posix platforms will > cause their deletion when Emacs which produced them exits, and on > Windows currently fails). > . In normal-top-level, we set this variable if the environment > variable EMACS_INHIBIT_AUTOMATIC_NATIVE_COMPILATION is set. > . In several places this variable either replaces > native-comp-deferred-compilation or has the same effect as the > latter (modulo the opposite meaning of nil/t value), therefore > disabling async compilation of *.el files that Emacs loads for > which there are no corresponding *.eln files. > > Here are the questions I think we want to be answered to finalize the > implementation and effects of 'inhibit-automatic-native-compilation': > > . Do people actually use 'inhibit-automatic-native-compilation' or > the corresponding environment variable? If so, for what reasons, > and why tweaking 'native-comp-eln-load-path' to direct the *.eln > files to some other place, including the temporary-file directory, > was not enough? > > . What do we want to do about compiling trampolines when > native-compilation is disabled? > > Currently, 'inhibit-automatic-native-compilation' doesn't really > disable compilation of trampolines, it just causes them to be > written to a temporary location, and hopefully deleted when the > session ends. This means that, for example, if the user has a > broken installation of GCC and Binutils, loading Lisp code that > uses advices will signal errors when Emacs compiles the > trampolines (because the compilation fails). I believe that's the biggest issue here. As you have very well explained 'inhibit-automatic-native-compilation' simply doesn't really inhibit native compilation. This is source of user confusion and issues. As we can't provide a good command that really disables native compilation it's better for me to have the two original knobs, one for jit compilation and one for trampolines. I personally strongly prefer no abstraction over a broken one. I'm very curious about reading the anwers about if 'inhibit-automatic-native-compilation' is used and particularly why. The only functonality that 'inhibit-automatic-native-compilation' introduced is to leave the eln cache clean by trampoline files. IMO if targetting a tmp directory is not a sufficiently good option we probably should have controlled this clean-up mechanism with a new value in `comp-enable-subr-trampolines'. Best Regards Andrea