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.bugs Subject: bug#62609: 29.0.60; [PATCH] src/comp.c: New variable `comp-el-to-eln-strip-prefix` for `comp-el-to-eln-rel-filename` Date: Sun, 02 Apr 2023 09:02:54 +0300 Message-ID: <831ql2yg6p.fsf@gnu.org> References: <1181651021.466162.1581309285621.ref@mail.yahoo.com> <1181651021.466162.1581309285621@mail.yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11874"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 62609@debbugs.gnu.org To: lin Sun , Andrea Corallo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 02 08:03:11 2023 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 1piqo3-0002qG-AN for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 Apr 2023 08:03:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1piqnw-0000kO-3T; Sun, 02 Apr 2023 02:03:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1piqnu-0000k1-Iq for bug-gnu-emacs@gnu.org; Sun, 02 Apr 2023 02:03:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1piqnu-0006qS-B1 for bug-gnu-emacs@gnu.org; Sun, 02 Apr 2023 02:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1piqnt-0002C3-UV for bug-gnu-emacs@gnu.org; Sun, 02 Apr 2023 02:03:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 02 Apr 2023 06:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62609 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-Cc: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16804153638405 (code B ref -1); Sun, 02 Apr 2023 06:03:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Apr 2023 06:02:43 +0000 Original-Received: from localhost ([127.0.0.1]:39016 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piqna-0002BV-Qu for submit@debbugs.gnu.org; Sun, 02 Apr 2023 02:02:43 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:38584) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piqnY-0002BN-O2 for submit@debbugs.gnu.org; Sun, 02 Apr 2023 02:02:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1piqnX-0000dm-HS for bug-gnu-emacs@gnu.org; Sun, 02 Apr 2023 02:02:39 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1piqnW-0006mE-TU; Sun, 02 Apr 2023 02:02:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=NZPp5pLbOwQ/CLFDu4NnDJKE5SHO+GwuRP+9ZRGfVOI=; b=sEHUHYTCGY8u 4Qo12Ta/zEiGf/9YCOWWXvGI6yGoEI83x/1E3CcVK2gtrcpbwx+5syOCFeumD8aRuW3rGvBai8dEq urj9w/ZOgzW/kgJ3xevZ28KbFXzXpkAEfTcNE2sx/lCTzqgdZr5IBpoX04razHArEUHpdReXQrUxY 421MWu2C8PTrtHrIMLhklpSuuuvUb6sFzkNK8Hbr31SnB2GKCL+avfz5JwfuHg51cmbIjxxldR18g fLZEsSp8tZK4A7jbsEi5dhM7L1qW/EgwCF8L65eMLB6QoDCq41HfihzaAiD2QeqoHkLTBsg/hpCQn 8OcAygWOwg4F9bcGloXEFQ==; Original-Received: from [87.69.77.57] (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 1piqnU-0000N6-3A; Sun, 02 Apr 2023 02:02:37 -0400 In-Reply-To: (message from lin Sun on Sun, 2 Apr 2023 05:13:28 +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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:259094 Archived-At: > From: lin Sun > Date: Sun, 2 Apr 2023 05:13:28 +0000 > > The emacs with native compile enabled will always rebuild all the > ~/.emacs.d/eln-cache/VER/*.eln files if I moved/copied eln-cache > folder from > /home/userA/.emacs.d/eln-cache/ to > /home/userB/.emacs.d/eln-cache/. > > It is caused by the function `comp-el-to-eln-rel-filename` calculating > the hash value from the absolute *.el filename to be the middle of the > eln file name. Thanks. However, I'm not sure I understand: the names of the *.eln files reflect the absolute name of the *.el file, so the *.eln files will be regenerated when the *.el files are moved, not when the eln-cache directory is moved. Right? Then what is the problem you are trying to fix? > The new variable `comp-el-to-eln-strip-prefix` in this patch will > allow moving the eln-cache/ folder without rebuilding *.eln in it. Sorry, I don't think I agree to this change (assuming I understand it correctly). We encode the absolute name of the *.el files in the names of the *.eln files for a reason, so ignoring arbitrary parts of those absolute names will lead to dangerous clashes. Please keep in mind that, unlike with *.elc files, loading an incorrect *.eln files can crash Emacs. So we must be very cautious in which files we allow to load. And again, I don't think I understand why moving eln-cache without moving the source *.el files would require the *.eln files in eln-cache to be recompiled. Andrea, what am I missing here?