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: Updating *.el files and native compilation Date: Mon, 10 May 2021 07:35:53 +0000 Message-ID: References: <83mtt5acjw.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="13755"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 10 09:42:05 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 1lg0YG-0003PH-Jf for ged-emacs-devel@m.gmane-mx.org; Mon, 10 May 2021 09:42:04 +0200 Original-Received: from localhost ([::1]:40518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lg0YF-0008De-L3 for ged-emacs-devel@m.gmane-mx.org; Mon, 10 May 2021 03:42:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40542) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lg0SW-0002Cn-Jt for emacs-devel@gnu.org; Mon, 10 May 2021 03:36:08 -0400 Original-Received: from mx.sdf.org ([205.166.94.24]:52576) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lg0SS-0003qo-Oy; Mon, 10 May 2021 03:36:08 -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 14A7Zsco018536 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Mon, 10 May 2021 07:35:57 GMT In-Reply-To: <83mtt5acjw.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 08 May 2021 10:51:15 +0300") 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:269101 Archived-At: Eli Zaretskii writes: > Andrea, > > I'd like to better understand what happens with *.eln files when the > corresponding *.el files and the Emacs C code are updated and > recompiled. There are two use cases here that are relevant: > > . building Emacs as part of development, while keeping old Emacs > executables > > . updates to locally installed *.el files (e.g., in site-lisp) that > also target multiple Emacs versions > > With byte-compilation, we keep only 1 .elc file for each .el file; if > one starts an Emacs binary which doesn't fit the .elc file, we could > have Lisp errors when invoking the affected Lisp functions, but in > general Emacs should not crash. However, with native-compilation we > can have several *.eln files in the respective directories (either > native-comp or eln-cache), even if the ABI hash didn't change. So my > questions are: > > . if the .el file changes in incompatible ways, native-compilation > will produce a .eln file with a different file name, and each > Emacs executable will then load the .eln file with which it is > compatible, is that right? Hi Eli, that's correct. > . if, for some reason, Emacs loads an incompatible .eln file, then > some Lisp programs could crash the Emacs session, is that correct? > If so, how do we make sure such incompatible changes always cause > a new native compilation that yields a different file name for the > .eln file? Yes but this should not happen, every change that can introduce an incompatibility has to be accounted in the `comp-abi-hash' computation and AFAIK ATM it is. > The upshot of all this is that if one keeps multiple Emacs > executables, it should be safe to invoke each one of them without > risking crashes due to loading incompatible *.eln files that were > produced by other, subtly incompatible Emacs executables. Is this > indeed safe, or do we have some "gotchas" that still need to be taken > care of? As of today I'm not aware of any gotcha here, if we discover a case of this we should treat it as bug. Regards Andrea