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 "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#48025: 28.0.50; Add an invocation option to inhibit native-compilation functionality Date: Mon, 26 Apr 2021 14:10:23 +0000 Message-ID: References: <421d2e18-e74c-8e0c-6a49-b6e23376eb14@orcon.net.nz> <83o8e1jlj4.fsf@gnu.org> Reply-To: Andrea Corallo Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="333"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Phil Sainty , 48025@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 26 16:11:11 2021 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 1lb1x8-000AOZ-Ol for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 26 Apr 2021 16:11:10 +0200 Original-Received: from localhost ([::1]:39274 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lb1x7-0002dW-PY for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 26 Apr 2021 10:11:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48250) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lb1x0-0002dQ-L6 for bug-gnu-emacs@gnu.org; Mon, 26 Apr 2021 10:11:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35126) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lb1x0-0008SA-CK for bug-gnu-emacs@gnu.org; Mon, 26 Apr 2021 10:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lb1x0-0003wl-6e for bug-gnu-emacs@gnu.org; Mon, 26 Apr 2021 10:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 26 Apr 2021 14:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48025 X-GNU-PR-Package: emacs Original-Received: via spool by 48025-submit@debbugs.gnu.org id=B48025.161944623315130 (code B ref 48025); Mon, 26 Apr 2021 14:11:02 +0000 Original-Received: (at 48025) by debbugs.gnu.org; 26 Apr 2021 14:10:33 +0000 Original-Received: from localhost ([127.0.0.1]:46672 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lb1wX-0003vw-5i for submit@debbugs.gnu.org; Mon, 26 Apr 2021 10:10:33 -0400 Original-Received: from mx.sdf.org ([205.166.94.24]:49745) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lb1wT-0003vh-1E for 48025@debbugs.gnu.org; Mon, 26 Apr 2021 10:10:31 -0400 Original-Received: from mab (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 13QEAN92011922 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Mon, 26 Apr 2021 14:10:25 GMT In-Reply-To: <83o8e1jlj4.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 26 Apr 2021 15:08:31 +0300") 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:204949 Archived-At: Eli Zaretskii writes: >> From: Phil Sainty >> Date: Mon, 26 Apr 2021 17:52:52 +1200 >> Cc: Andrea Corallo >> >> Now that the native-compilation feature is merged, it would be very >> useful to be able to build Emacs --with-native-compilation but be >> able to choose to inhibit that functionality at start time via a >> command-line option such as 'emacs --no-native-compilation', which >> would cause Emacs to load/execute only .el and .elc files. >> >> This will enable users to easily compare functionality with and >> without native-compilation, so that native-compilation bugs can be >> more easily identified and reproduced without requiring people to >> maintain more than one build of Emacs in order to test how the >> traditional interpreters behave. >> >> I'm not sure if/how this ties in with the portable dumper. Perhaps >> there are .eln files included in the dump? If so, perhaps the dump >> would need to include both the .elc and the .eln code, and choose >> which to use based on the new option. > > Andrea will correct me, but I think this is not trivial to implement, > not even close. Indeed, the contents of the pdumper file is different > in the two cases, and I see no easy way of having both byte-compiled > and native-compiled stuff live together in the same dump (they define > the same functions, remember?). > > We could perhaps provide a special value of --temacs= switch to > temacs, so that the same temacs executable could be dumped into 2 > different *.pdmp files, one with natively-compiled preloaded stuff, > the other with byte-compiled stuff; then users could use the existing > option --dump-file= to start Emacs with the non-standard pdumper file > (they will also need to set comp-deferred-compilation to nil to > prevent any run-time native-compilations once Emacs starts). > > But frankly, I would hesitate to complicate Emacs even for the latter > possibility. What you ask for doesn't seem to be a user-level > feature, it is mainly important for Emacs developers, and those can > always build 2 separate binaries (e.g., I already did). Building a > differently-configured Emacs, even from the same Git repository, is so > easy that I don't really see a justification for a feature like you > describe. > > (As for reproducing problems easily: it isn't hard to run the > interpreted or byte-compiled Lisp, if you can identify the relevant > Lisp files involved in the problem: just load them manually. Andrea, > am I missing something?) No you are not, once we bootstrap and dump a native compiled Emacs there's no way we can undone it and get the equivalent one with only bytecode. Other than I can mention some knobs we already have that might partially help here: - inibith the automatic native compilation of new code with `comp-deferred-compilation'. - prevent .eln from being loaded in place of bytecode with `load-no-native'. Thanks Andrea