From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase [was: Add new bytecode op `switch' for implementing branch tables.] Date: Sat, 02 Jul 2022 17:28:55 -0400 Message-ID: References: <1b07c68a-873e-83c8-246d-423bc83a3881@gmail.com> <83y3xg4ldw.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="9145"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: rswgnu@gmail.com, Kaushal Modi , cpitclaudel@gmail.com, Emacs developers , Eli Zaretskii , Vibhav Pant , Tino Calancha To: Robert Weiner Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jul 02 23:30:37 2022 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 1o7khI-00028S-M3 for ged-emacs-devel@m.gmane-mx.org; Sat, 02 Jul 2022 23:30:36 +0200 Original-Received: from localhost ([::1]:43852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7khH-0002eM-Ch for ged-emacs-devel@m.gmane-mx.org; Sat, 02 Jul 2022 17:30:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52600) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7kfp-0001VH-6T for emacs-devel@gnu.org; Sat, 02 Jul 2022 17:29:05 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:62642) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7kfl-00053J-PQ; Sat, 02 Jul 2022 17:29:03 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 074E6100164; Sat, 2 Jul 2022 17:28:59 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 8D0DF100121; Sat, 2 Jul 2022 17:28:57 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1656797337; bh=TF3yU96nsPHQFOQ8whTMuAdDXTmw5/ynT5v0g4asXjQ=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=ntkx20egK2tYh9021avmEH8Bc27EG9o//EgGaYuqpehzc0DZRxYKDitZFpbZOmfJt FlllSQIG+FlLhhUrQLs7PEmbsNvpYm2gfyP1hEYLdPErNrjDBC5CGycfK44Pu/zR7e fxMO8c5bE6gQbh49MTeLz2pKkrbF1xrVm3urd5twJQbjkJYzQrbrj1f7PPnCABdH5t XBfuBxOQvHvzwuoJvVJ4poExBZGpgzzx8QUcZcLg4CInB7T8JmDhtcpsRYmiY3f+RV VHLmOxpMt6Mg7kuJaEQSYJtm7ps1SQ7zcG1G7jPcWV8+lCZk+kj27bBfbewnuuIqd9 VLZE+n+EsEoVg== Original-Received: from alfajor (unknown [45.72.196.165]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 2977E120488; Sat, 2 Jul 2022 17:28:57 -0400 (EDT) In-Reply-To: (Robert Weiner's message of "Sat, 2 Jul 2022 16:31:35 -0400") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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" Xref: news.gmane.io gmane.emacs.devel:291805 Archived-At: > I'm with you on your thoughts about removing the need for users to often > have to deal with byte-code or native-code compilation differences when > running different major versions of Emacs. But it is now 2022 and the > situation seems to be much worse than it was five years ago. What makes you think it is worse? > Say you use Emacs 27, 28 and 29, 5 years ago, that would have been ... 25, 26, and 27, right? > some with native compilation and some not. AFAIK native compilation is fully transparent, so it shouldn't make cause any extra trouble for the end-user (except maybe when it doesn't work, but that's a separate issue). > But you want to keep the same set of packages in use across all > these installations. The rule is that you need to compile with the oldest Emacs you're still using. Can you think of a package that can be compiled with Emacs-27 but whose resulting .elc files won't work in Emacs-29? AFAIK the only problem with a situation like the one you describe is when the user install a package with Emacs-NN and then tries to use this package with Emacs-MM where MM < NN. Ideally, we should detect this situation and force a recompilation of the package (the result of which should still work fine on Emacs-NN). The .elc files already contain the needed info: they start with ";ELC" where is a char that represents the major version of Emacs that compiled this file (char code 28 for both Emacs-28.1 and Emacs-28.2). So it's a "small matter" of adding code to detect when we load a file that's been compiled by a "future Emacs" and then cause it to be recompiled. Stefan