From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Updating *.el files and native compilation Date: Sat, 08 May 2021 10:51:15 +0300 Message-ID: <83mtt5acjw.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26178"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Andrea Corallo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 08 09:52:40 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 1lfHlP-0006jc-Ug for ged-emacs-devel@m.gmane-mx.org; Sat, 08 May 2021 09:52:39 +0200 Original-Received: from localhost ([::1]:58858 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lfHlO-0002Su-AZ for ged-emacs-devel@m.gmane-mx.org; Sat, 08 May 2021 03:52:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35948) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lfHk8-00015w-3I for emacs-devel@gnu.org; Sat, 08 May 2021 03:51:20 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:54118) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lfHk7-0007IR-IU; Sat, 08 May 2021 03:51:19 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3793 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lfHk6-0004iW-Mr; Sat, 08 May 2021 03:51:19 -0400 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:269026 Archived-At: 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? . 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? 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? Thanks.