From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matthew Bauer Newsgroups: gmane.emacs.bugs Subject: bug#48994: 28.0.50; [PATCH] 28.0.50; Native compilation unnecessarily recompiles .eln (macOS) Date: Sat, 12 Jun 2021 22:13:13 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34812"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Andrea Corallo To: 48994@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 13 05:14:15 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 1lsGZi-0008s4-Vj for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 13 Jun 2021 05:14:15 +0200 Original-Received: from localhost ([::1]:37340 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lsGZg-00086n-Rj for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 12 Jun 2021 23:14:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60668) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsGZW-00086V-IG for bug-gnu-emacs@gnu.org; Sat, 12 Jun 2021 23:14:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59102) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lsGZW-0000Zv-7V for bug-gnu-emacs@gnu.org; Sat, 12 Jun 2021 23:14:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lsGZW-0008IC-1L for bug-gnu-emacs@gnu.org; Sat, 12 Jun 2021 23:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Matthew Bauer Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 13 Jun 2021 03:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 48994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.162355400031807 (code B ref -1); Sun, 13 Jun 2021 03:14:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 Jun 2021 03:13:20 +0000 Original-Received: from localhost ([127.0.0.1]:42415 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lsGYq-0008Gx-6X for submit@debbugs.gnu.org; Sat, 12 Jun 2021 23:13:20 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:52972) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lsGYo-0008Gq-Sm for submit@debbugs.gnu.org; Sat, 12 Jun 2021 23:13:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60452) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsGYo-00081V-N2 for bug-gnu-emacs@gnu.org; Sat, 12 Jun 2021 23:13:18 -0400 Original-Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]:34484) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lsGYm-0008Mu-Sb for bug-gnu-emacs@gnu.org; Sat, 12 Jun 2021 23:13:18 -0400 Original-Received: by mail-ot1-x32a.google.com with SMTP id w22-20020a0568304116b02904060c6415c7so5002602ott.1 for ; Sat, 12 Jun 2021 20:13:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version; bh=+6dcHQuS18Mh3ncvCFU+2MoyZ+/txQfEO3/sqpovXts=; b=t8rBJdqh4H2f4Iev7ZiFbYqZX96yRlJnXXAg1vPZYwoQgLSoT1pn5yeYlbp8k+AVJk 4FjxQlS2iiz7AyZcJnfA3GP3vjxKrOyouo4zEKWaNPmIWIERBznXkURQFEtWhtfBY/2Q 7AIjNC3+Z52oFihjyANDijIzMOoOZljz9LB2SdfWk4tYV4loOKRLEwY71Equ5DlyFqBT pKo7FiOhDXw521mOc8/h4/NSvJ4ww55jMmu7tAxKIDSRxVYcxHUkrnQ2yaGtC1GCUJd9 mCP64eQD7Q5ui+DrAJbRVrBiztS7xvx5EN6nknZxrjIxQ/VNKgHHaYJ1rsm5A6SkjD8e /VUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version; bh=+6dcHQuS18Mh3ncvCFU+2MoyZ+/txQfEO3/sqpovXts=; b=cJgA9DVSV3Av13mwzD1SpW+lVrkkpa7sXYU3BbmblTBn/HYey3NisTcmA2m3hCHDHD kamOpL8aeqAzTqNTIbMb/GfzfmDKsbaFrTyJBOOJZP7wXIGFAuXilNwBEoVJvIMhmzUf U4VmyCQBxPE6HxnBcN7wYGWcFcuOByWzGC36grfuQMo9YifuKdZs5nSlby0oYR/8UrB3 M9rwdo/hbqnBJXtFI3YUwxusmyWrP+OchpOoU9vAXAxBwPWbmp2M/X0Tc/CvZt/07RkA bLgdFWGci5EmsxkQSaTee2s8ZvV9/ueqCxZA1hcduXlVOLT8CiIqH0Mzdh5E7kq3Qkja kzUw== X-Gm-Message-State: AOAM532kyNgXwS+LWvTRF4vEu8Gj/B2qDsGsu5gSfJSn9mCmCq84eoCC 9tK1+kUxm9OMwIhnE7Nai9U= X-Google-Smtp-Source: ABdhPJzwn598XAFUdKeOYiwuIo39d9dgJv3zn33P5BUvfz5MoOJh3ZuPAej2fBCYO1Ga9S8Hlcr6Eg== X-Received: by 2002:a9d:6f0d:: with SMTP id n13mr8858393otq.168.1623553994849; Sat, 12 Jun 2021 20:13:14 -0700 (PDT) Original-Received: from mac-mini.lan ([2605:a601:ac7b:7f00:2d69:8908:249:46b8]) by smtp.gmail.com with ESMTPSA id w8sm2324729otk.16.2021.06.12.20.13.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Jun 2021 20:13:14 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::32a; envelope-from=mjbauer95@gmail.com; helo=mail-ot1-x32a.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:208401 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable This is similar to bug#48497, but appears to still happen even after commit 3f207753a0. The basic problem is that the installed lisp path does not match either of the search expressions in comp-el-to-eln-rel-filename, meaning that native lisp needs to be recompiled needlessly. The problem seems to come from PATH_REL_LOADSEARCH being set for me (on macOS) to Contents/Resources/lisp, but the lisp files actually being installed to /nix/store/...-emacs-gcc-20210612.0/share/emacs/28.0.50/lisp (path generated by Nix). As a result, comp-el-to-eln-rel-filename used the filename comp-034d3699-516ce4bf.eln for comp.el.gz where 516ce4bf is the md5sum of the contents of comp.el and 034d3699 is the md5sum of the full path of comp.el, not of //emacs-lisp/comp.el (7672a6ed), which is what Emacs installs. To fix this, I propose using PATH_LOADSEARCH in addition to PATH_REL_LOADSEARCH so that we can catch both types of macOS installs (.app and unix). I=E2=80=99ve attached a patch which implements this, adding relative and absolute loadsearch resolution. - Matthew --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Use-PATH_LOADSEARCH-to-get-absolute-path-of-native-c.patch >From 32022ee8d977196c72ad42d89d23142a6e59ff8e Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Sat, 12 Jun 2021 00:37:28 -0500 Subject: [PATCH] Use PATH_LOADSEARCH to get absolute path of native comp We need to so that /usr/local/share/emacs/28.0.50/lisp/emacs-lisp/comp.el becomes: //emacs-lisp/comp.el which is what we install eln files as. --- src/comp.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/comp.c b/src/comp.c index 056d0860d8..8ccd99d583 100644 --- a/src/comp.c +++ b/src/comp.c @@ -4049,12 +4049,14 @@ DEFUN ("comp-el-to-eln-rel-filename", Fcomp_el_to_eln_rel_filename, As installing .eln files compiled during the build changes their absolute path we need an hashing mechanism that is not sensitive - to that. For this we replace if match PATH_DUMPLOADSEARCH or - *PATH_REL_LOADSEARCH with '//' before computing the hash. */ + to that. For this we replace if match PATH_DUMPLOADSEARCH, + PATH_REL_LOADSEARCH, or PATH_LOADSEARCH with '//' before + computing the hash. */ if (NILP (loadsearch_re_list)) { - Lisp_Object sys_re = + Lisp_Object sys_abs_re = Fregexp_quote (build_string (PATH_LOADSEARCH "/")); + Lisp_Object sys_rel_re = concat2 (build_string ("\\`[[:ascii:]]+"), Fregexp_quote (build_string ("/" PATH_REL_LOADSEARCH "/"))); Lisp_Object dump_load_search = @@ -4062,7 +4064,7 @@ DEFUN ("comp-el-to-eln-rel-filename", Fcomp_el_to_eln_rel_filename, #ifdef WINDOWSNT dump_load_search = Fw32_long_file_name (dump_load_search); #endif - loadsearch_re_list = list2 (sys_re, Fregexp_quote (dump_load_search)); + loadsearch_re_list = list3 (sys_abs_re, sys_rel_re, Fregexp_quote (dump_load_search)); } Lisp_Object lds_re_tail = loadsearch_re_list; -- 2.29.2 --=-=-=--