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#46256: [feature/native-comp] AOT eln files ignored if run from build tree Date: Fri, 05 Mar 2021 10:19:11 +0000 Message-ID: References: <86wnut8fb9.fsf@gmail.com> <861rd1tbpa.fsf@gmail.com> <83pn0km6y3.fsf@gnu.org> <86ft1f8ara.fsf@gmail.com> <83sg5cjdn8.fsf@gnu.org> <83r1kwjcy2.fsf@gnu.org> <83k0qoj9zv.fsf@gnu.org> <83im68j963.fsf@gnu.org> <83tuprhur0.fsf@gnu.org> <831rcu25o2.fsf@gnu.org> <83v9a6zr22.fsf@gnu.org> <83o8fyzjrz.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="21070"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Eli Zaretskii , 46256@debbugs.gnu.org To: Pip Cet Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 05 11:27:18 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 1lI7fy-0005MY-A8 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Mar 2021 11:27:18 +0100 Original-Received: from localhost ([::1]:36966 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lI7fx-0008T6-D6 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Mar 2021 05:27:17 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46724) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lI7Yx-0000UX-0H for bug-gnu-emacs@gnu.org; Fri, 05 Mar 2021 05:20:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49621) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lI7Yw-0001Pm-HM for bug-gnu-emacs@gnu.org; Fri, 05 Mar 2021 05:20:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lI7Yw-0002Bp-CC for bug-gnu-emacs@gnu.org; Fri, 05 Mar 2021 05:20:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Mar 2021 10:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46256 X-GNU-PR-Package: emacs Original-Received: via spool by 46256-submit@debbugs.gnu.org id=B46256.16149395588360 (code B ref 46256); Fri, 05 Mar 2021 10:20:02 +0000 Original-Received: (at 46256) by debbugs.gnu.org; 5 Mar 2021 10:19:18 +0000 Original-Received: from localhost ([127.0.0.1]:32934 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lI7YE-0002Al-EN for submit@debbugs.gnu.org; Fri, 05 Mar 2021 05:19:18 -0500 Original-Received: from mx.sdf.org ([205.166.94.24]:58442) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lI7Y9-0002AZ-8w for 46256@debbugs.gnu.org; Fri, 05 Mar 2021 05:19:17 -0500 Original-Received: from mab (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 125AJBKT016169 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Fri, 5 Mar 2021 10:19:12 GMT In-Reply-To: (Pip Cet's message of "Fri, 5 Mar 2021 10:09:47 +0000") 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:201518 Archived-At: Pip Cet writes: > On Fri, Mar 5, 2021 at 9:33 AM Andrea Corallo via Bug reports for GNU > Emacs, the Swiss army knife of text editors > wrote: >> Eli Zaretskii writes: >> > So currently the only way to fill up a newly created subdirectory of >> > native-lisp/ is to manually delete the *.elc files of all the files in >> > lisp.mk's $shortlisp list, is that sufficient? >> >> Yes I think so. >> >> The trouble of using make for building such a system is that make is not >> aware of the .eln filename, so it should be necessary to ask the Emacs >> binary about that to create dynamically the precise (multiple target) >> rule. Not very practical IMO... > > I do wonder whether the whole filename scheme is really the best option. > > IIUC, and that's a big if in this case, the main motivation for using > hashes in the .eln filenames is that dlopen() is broken and may return > the same handle for subsequent dlopen()s of the same name, even if the > underlying file changed in between. Unfortunately this was only an unfortunate discover along the road... this design predates that. > Merely verifying that the ABI is correct could be done at runtime, so > that's no reason to keep a hash in the filename. > > So my vague idea is this: > > 1. implement fixed_dlopen(), which keeps track of filenames that have > been opened and, if necessary, creates a temporary file and loads that > instead of its argument. > 2. compile lisp/emacs-lisp/bytecomp.el to lisp/emacs-lisp/bytecomp.elc > and native-lisp/emacs-lisp/bytecomp.eln So it was at the beginning, I think we moved away from that before the odd dlopen behavior. > 3. add extra code in the top level function of each .eln to check that > the ABI is correct. > > This would allow us to use standard make rules. It would also make > .eln filenames predictable. It might even draw someone's attention to > the fact that dlopen() is broken and make them fix it. > > I'm probably missing other good reasons for the hashed filename scheme. Yep, this was discussed in length on emacs-devel, IIRC mainly on a long standing thread called "native compilation the bird-eye view" (or something close). Andrea