From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: akrl--- via "Emacs development discussions." Newsgroups: gmane.emacs.devel Subject: Re: [feature/native-comp] breakage on build Date: Mon, 01 Feb 2021 19:01:23 +0000 Message-ID: References: <87lfca7lsb.fsf@russet.org.uk> <463a837ca8ddbf7533c403350d75125d@russet.org.uk> <39105f71034e0902a749994dda9c4704@russet.org.uk> <83mtwq8kf3.fsf@gnu.org> <83k0ru8jnx.fsf@gnu.org> <83im7e8icf.fsf@gnu.org> <838s8a8adr.fsf@gnu.org> <83sg6h6s6d.fsf@gnu.org> <8335yf7qtf.fsf@gnu.org> <831rdz7mf5.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="22081"; 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, phillip.lord@russet.org.uk To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Feb 01 20:02: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 1l6eSb-0005eX-7j for ged-emacs-devel@m.gmane-mx.org; Mon, 01 Feb 2021 20:02:05 +0100 Original-Received: from localhost ([::1]:40850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6eSa-0000ot-9P for ged-emacs-devel@m.gmane-mx.org; Mon, 01 Feb 2021 14:02:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39950) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6eS0-0000Ee-8V for emacs-devel@gnu.org; Mon, 01 Feb 2021 14:01:28 -0500 Original-Received: from mab.sdf.org ([205.166.94.33]:37694 helo=ma.sdf.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6eRy-00065d-3Y; Mon, 01 Feb 2021 14:01:28 -0500 Original-Received: from akrl by ma.sdf.org with local (Exim 4.92) (envelope-from ) id 1l6eRv-0004Yz-Av; Mon, 01 Feb 2021 19:01:23 +0000 In-Reply-To: <831rdz7mf5.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 01 Feb 2021 19:00:46 +0200") Received-SPF: pass client-ip=205.166.94.33; envelope-from=akrl@sdf.org; helo=ma.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_NONE=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:263692 Archived-At: Eli Zaretskii writes: >> From: Andrea Corallo >> Cc: phillip.lord@russet.org.uk, emacs-devel@gnu.org >> Date: Mon, 01 Feb 2021 16:20:17 +0000 >> >> > OK, thanks. I understand the reasons now. However, I'm not sure we >> > should encode all this information in the .eln file's name. For >> > starters, some of those reasons are also true for *.elc files, right? >> > For example, suppose that a primitive that the .el file calls changed >> > its signature in backward-incompatible ways -- the .el files which >> > call it need to be recompiled, or else they will fail, either silently >> > or noisily. Right? But we don't encode those details in the names of >> > the *.elc files, do we? Why should the *.eln files be different? >> >> I think with eln the situation is considerably more sentitive than the >> elc one in this respect. The reason is that we (on purpose) skip >> Ffuncall to call directly into C code, as a consequence an >> incompatibility will most certainly lead to a crash and not a runtime >> error. > > Crash aside, I don't see the crucial difference, sorry. Agree, for me runtime error vs unrecoverable crash is a crucial difference than easily can drive to different design decisions. > And if we > detect incompatibility and prevent the crash, I seed no difference at > all, as that can happen with *.elc files as well. > >> 2- We move HASH1 into the eln as metadata. >> >> - The limitation of 1 persists >> >> - To check that each eln is loadable one has: to 'dlopen' it, read the >> metadata ('dlsym'), verify and in case reject. This is certainly >> way more expansive than directly searching for a given filename and >> might impact negatively startup time, especially on certain OSes >> where opening files is an expensive operation. > > How much more expensive? I'd be surprised to hear it's significant, > since in-memory operations are much faster than file I/O. Is it > possible to measure the difference, so that we could make a decision > based on facts? Not easily without implementing it. Also we should then measure on all supported platforms. And still we'd have the first mentioned limitation. >> - We'd have name clashes for different eln coming from different >> Emacs configurations/versions. > > A different version will have a different directory, like it does now > with *.elc files. As for different configurations: if you mean the > same architecture, how probable is that, for normal users? If the > issue happens with Emacs developers, wed could design something > special for that case. Configuring with different flags can lead to a different set of exposed primitives and as a consequence to eln incompatibility so yeah, I think this is quite sensitive. > I guess I'm saying that using the file names to record this > information is not necessarily justified by the issues it is supposed > to solve, and there are alternative solutions with smaller costs. > >> Shall we pick a length? 8 characters is probably more than okay but we >> can go for 16 if we prefer to stay on the safe side. > > If 8 is enough, then why go for 16? How is that safer? I agree 8 is enough, 16 would be safer as reduces further the clash probability but with 8 is already very low (1/1785793904896 if I'm not wrong). Regards Andrea