GNU bug report logs - #77468
30.1.50; package-quickstart file is not relocatable

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Spencer Baugh <sbaugh@HIDDEN>; dated Wed, 2 Apr 2025 18:47:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 77468 <at> debbugs.gnu.org:


Received: (at 77468) by debbugs.gnu.org; 3 Apr 2025 05:16:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 03 01:16:49 2025
Received: from localhost ([127.0.0.1]:60429 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u0Cwb-000669-1D
	for submit <at> debbugs.gnu.org; Thu, 03 Apr 2025 01:16:49 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:40482)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1u0CwZ-00065r-0u
 for 77468 <at> debbugs.gnu.org; Thu, 03 Apr 2025 01:16:47 -0400
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 <eliz@HIDDEN>)
 id 1u0CwS-0002cK-3p; Thu, 03 Apr 2025 01:16:40 -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=aRFI4wc42etx1Xq8j0U16V46rOnnn2RLS4yOE2AeF2Y=; b=MtdvshL+o+9y
 p3fc5bxsJ/XE9hWLRZu6axezXVdTQbDYo3peQdZDY188yWxc+7D7yqjq+YihYeGPSSmyf4zTI4g7M
 7tYFivjWXJaYmnOeFbuo1FKNGsTQpDPy5LGQWGxzNiOnqB+55s1EiQkOiG3HEM8LBKngPj+SboS0i
 jVMb/yuGbB1Wc9ILa9U+wtISk9avXd6H2pR8o1CEmy0DzwXauMZAdbIos0GV5upkAsvav6yHQHT+D
 q+0vdOcaB4QjmbF5nVVP2kvRKjswUgnepZN8UK+7L1ypL6CYJPiUaY+q3gwYhYNneJJmrfRDsBqAS
 iqGNAKLirkYrPx1J9TC74w==;
Date: Thu, 03 Apr 2025 08:16:37 +0300
Message-Id: <861pu925ai.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Spencer Baugh <sbaugh@HIDDEN>
In-Reply-To: <ier5xjm2r8x.fsf@HIDDEN> (bug-gnu-emacs@HIDDEN)
Subject: Re: bug#77468: 30.1.50; package-quickstart file is not relocatable
References: <ieriknmtna6.fsf@HIDDEN>
 <jwvldsiz77w.fsf-monnier+emacs@HIDDEN>
 <ier8qoi2vbr.fsf@HIDDEN>
 <jwva58yz55u.fsf-monnier+emacs@HIDDEN> <ier5xjm2r8x.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77468
Cc: monnier@HIDDEN, 77468 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: 77468 <at> debbugs.gnu.org
> Date: Wed, 02 Apr 2025 17:22:22 -0400
> From:  Spencer Baugh via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> 
> Stefan Monnier <monnier@HIDDEN> writes:
> >> Maybe package-quickstart.el could use relative names to packages in
> >> package-user-dir (since it itself lives in package-user-dir), and
> >> absolute names to packages outside that?
> >
> > Sounds OK.  Tho maybe we should check `file*-in-directory-p` (or the
> > presence of "../" in the output of `file-relative-name`) rather than
> > distinguishing based on `package-user-dir` vs `package-directory-list`?
> >
> > In any case, it sounds like a good compromise.
> 
> Makes sense.  How about this?

Thanks, but please always remember to comment such non-trivial code,
explaining its purpose and the problems it attempts to solve.
Otherwise we make Emacs much harder to maintain for those who come
after us.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#77468; Package emacs. Full text available.

Message received at 77468 <at> debbugs.gnu.org:


Received: (at 77468) by debbugs.gnu.org; 2 Apr 2025 22:30:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 02 18:30:23 2025
Received: from localhost ([127.0.0.1]:59911 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u06bH-00077i-Ft
	for submit <at> debbugs.gnu.org; Wed, 02 Apr 2025 18:30:23 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:39953)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <monnier@HIDDEN>)
 id 1u06bD-00076K-RU
 for 77468 <at> debbugs.gnu.org; Wed, 02 Apr 2025 18:30:20 -0400
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 8EF9310004C;
 Wed,  2 Apr 2025 18:30:13 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1743633008;
 bh=miJRsJ1M1yVbyyNAoRRjJNJtR1NF2UeKv6IEIzKylBk=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=DWur6RkKIjJaWTf3ITIBXrfJduwLU7I99Um1cntoc4/9sl3t0BwUkAnepi/szIlk5
 yju6gNUu2hfgbm6H/yqEwf/easMAb3+9uAJHF5PBlpOzaa5wEugxHXzRjMvKvgk1EF
 LywDhsthnOkeypiH07mJYVivf5EiW1JPdW074NygLf9u2ivM0fe4g/wdRFisptSnEd
 Wn3jO/jcXsLd//loQexMg5XCaI6dP/LGoZPAS/hvgKCvBumDYAGB7VZQSyt+5JVd18
 bVxUBMxiMfc9jENpIUcJGUZeEox15h6iqVtkwNnc9szdsh21irncxFnUUbiH3c+l3s
 J6UcSdlU/Deyg==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 42606100029;
 Wed,  2 Apr 2025 18:30:08 -0400 (EDT)
Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 259D2120227;
 Wed,  2 Apr 2025 18:30:08 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Spencer Baugh <sbaugh@HIDDEN>
Subject: Re: bug#77468: 30.1.50; package-quickstart file is not relocatable
In-Reply-To: <ier5xjm2r8x.fsf@HIDDEN>
Message-ID: <jwvmscyxl15.fsf-monnier+emacs@HIDDEN>
References: <ieriknmtna6.fsf@HIDDEN>
 <jwvldsiz77w.fsf-monnier+emacs@HIDDEN>
 <ier8qoi2vbr.fsf@HIDDEN>
 <jwva58yz55u.fsf-monnier+emacs@HIDDEN>
 <ier5xjm2r8x.fsf@HIDDEN>
Date: Wed, 02 Apr 2025 18:30:07 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.102 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77468
Cc: 77468 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Makes sense.  How about this?

See comments below.

> diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
> index b9a8dacab15..1269a9c95e7 100644
> --- a/lisp/emacs-lisp/package.el
> +++ b/lisp/emacs-lisp/package.el
> @@ -4591,6 +4591,14 @@ package--quickstart-maybe-refresh
>      (delete-file (concat package-quickstart-file "c"))
>      (delete-file package-quickstart-file)))
>  
> +(defun package--quickstart-relative (load-name file)
> +  "Return an expression which evaluates to FILE while loading LOAD-NAME."
> +  (let* ((dir (file-name-directory (expand-file-name load-name)))
> +         (relname (file-relative-name file dir)))
> +    (if (string-prefix-p ".." relname)
> +        file
> +      `(file-name-concat (file-name-directory load-file-name) ,relname))))

I think I'd test "../" just in case of dirnames that start with "..".
Also, could we compute (file-name-directory load-file-name)
once at the beginning of the quickstart file instead of once per
inlined file?

>  (defun package-quickstart-refresh ()
>    "(Re)Generate the `package-quickstart-file'."
>    (interactive)
> @@ -4605,7 +4613,8 @@ package-quickstart-refresh
>          ;; aren't truncated.
>          (print-length nil)
>          (print-level nil)
> -        (Info-directory-list '("")))
> +        (Info-directory-list '(""))
> +        (qs-dir (file-name-directory (expand-file-name package-quickstart-file))))

AFAICT `qs-dir` is not used.

> @@ -4622,7 +4631,7 @@ package-quickstart-refresh
>                  ;; Prefer uncompiled files (and don't accept .so files).
>                  (let ((load-suffixes '(".el" ".elc")))
>                    (locate-library (package--autoloads-file-name pkg))))
> -               (pfile (prin1-to-string file)))
> +               (pfile (prin1-to-string (package--quickstart-relative package-quickstart-file file))))
>            (insert "(let* ((load-file-name " pfile ")\
>  \(load-true-file-name load-file-name))\n")
>            (insert-file-contents file)

I think this needs wrapping to fit within 80 columns.

> @@ -4638,7 +4647,10 @@ package-quickstart-refresh
>                    (append ',(mapcar #'package-desc-name package--quickstart-pkgs)
>                            package-activated-list)))
>            (current-buffer))
> -      (let ((info-dirs (butlast Info-directory-list)))
> +      (let ((info-dirs
> +             (mapcar (lambda (info-dir)
> +                       (package--quickstart-relative package-quickstart-file info-dir))
> +                     (butlast Info-directory-list))))
>          (when info-dirs
>            (pp `(progn (require 'info)
>                        (info-initialize)

I think this won't work because the rest of the code does:

                      (setq Info-directory-list
                            (append ',info-dirs Info-directory-list)))

so the `file-name-concat`s won't be evaluated.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#77468; Package emacs. Full text available.

Message received at 77468 <at> debbugs.gnu.org:


Received: (at 77468) by debbugs.gnu.org; 2 Apr 2025 21:22:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 02 17:22:31 2025
Received: from localhost ([127.0.0.1]:59789 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u05Xb-0003wg-7w
	for submit <at> debbugs.gnu.org; Wed, 02 Apr 2025 17:22:31 -0400
Received: from mxout5.mail.janestreet.com ([64.215.233.18]:53905)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <sbaugh@HIDDEN>)
 id 1u05XX-0003wR-V5
 for 77468 <at> debbugs.gnu.org; Wed, 02 Apr 2025 17:22:28 -0400
From: Spencer Baugh <sbaugh@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#77468: 30.1.50; package-quickstart file is not relocatable
In-Reply-To: <jwva58yz55u.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
 of "Wed, 02 Apr 2025 16:24:38 -0400")
References: <ieriknmtna6.fsf@HIDDEN>
 <jwvldsiz77w.fsf-monnier+emacs@HIDDEN>
 <ier8qoi2vbr.fsf@HIDDEN>
 <jwva58yz55u.fsf-monnier+emacs@HIDDEN>
Date: Wed, 02 Apr 2025 17:22:22 -0400
Message-ID: <ier5xjm2r8x.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com;
 s=waixah; t=1743628942;
 bh=QFqrwc63gd++ZHr5PTR72DH/gg7cymWrBc9F+OKQ2eI=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=0WBkIcyMUjB+3v8eed/DfCPPgjsHxWWuydlwNpFeSMeSNHKExIsPyzZGQwsiEe1d5
 xYbdsEpu+8VcVCqk74Idp+T3/PMJb7fzcgIXj9HyvpTX9DR89BDlJIOct7TpVMfwho
 /m3rbe0bsqhsR54/9+c+OZoz0O9wnNTZaHYHtbTxjEtku9P/4HrL7qums+fSpuRzgt
 R/Wv8ymgm/b1Tj0C6wxg7SQoXIBTgJcvUbcreQlxDUCBvyG7MmSlXpUYoXAJQ+8RLr
 j4rlexfItRcF9YGKNqhHSQ/P/pTL3RevIT7voIk+5VSxiKHslo0WwHe88/PlIR/o+D
 6K2/a5eKk5H6Q==
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77468
Cc: 77468 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

--=-=-=
Content-Type: text/plain

Stefan Monnier <monnier@HIDDEN> writes:
>> Maybe package-quickstart.el could use relative names to packages in
>> package-user-dir (since it itself lives in package-user-dir), and
>> absolute names to packages outside that?
>
> Sounds OK.  Tho maybe we should check `file*-in-directory-p` (or the
> presence of "../" in the output of `file-relative-name`) rather than
> distinguishing based on `package-user-dir` vs `package-directory-list`?
>
> In any case, it sounds like a good compromise.

Makes sense.  How about this?


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline;
 filename=0001-Use-relative-names-where-possible-in-package-quickst.patch

From 7f465bee1605e0687f4f7713bcfeb9ac39b28355 Mon Sep 17 00:00:00 2001
From: Spencer Baugh <sbaugh@HIDDEN>
Date: Wed, 2 Apr 2025 17:21:24 -0400
Subject: [PATCH] Use relative names where possible in package-quickstart.el

package-quickstart.el hardcodes many absolute file names, which
makes it break if user-emacs-directory moves, or in other
situations.  To be slightly more robust to this, use relative
file names to packages that are located in the same directory as
package-quickstart.el.

* lisp/emacs-lisp/package.el (package--quickstart-relative):
Add.
(package-quickstart-refresh): Use package--quickstart-relative
on file names.  (bug#77468)
---
 lisp/emacs-lisp/package.el | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index b9a8dacab15..1269a9c95e7 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -4591,6 +4591,14 @@ package--quickstart-maybe-refresh
     (delete-file (concat package-quickstart-file "c"))
     (delete-file package-quickstart-file)))
 
+(defun package--quickstart-relative (load-name file)
+  "Return an expression which evaluates to FILE while loading LOAD-NAME."
+  (let* ((dir (file-name-directory (expand-file-name load-name)))
+         (relname (file-relative-name file dir)))
+    (if (string-prefix-p ".." relname)
+        file
+      `(file-name-concat (file-name-directory load-file-name) ,relname))))
+
 (defun package-quickstart-refresh ()
   "(Re)Generate the `package-quickstart-file'."
   (interactive)
@@ -4605,7 +4613,8 @@ package-quickstart-refresh
         ;; aren't truncated.
         (print-length nil)
         (print-level nil)
-        (Info-directory-list '("")))
+        (Info-directory-list '(""))
+        (qs-dir (file-name-directory (expand-file-name package-quickstart-file))))
     (dolist (elt package-alist)
       (condition-case err
           (package-activate (car elt))
@@ -4622,7 +4631,7 @@ package-quickstart-refresh
                 ;; Prefer uncompiled files (and don't accept .so files).
                 (let ((load-suffixes '(".el" ".elc")))
                   (locate-library (package--autoloads-file-name pkg))))
-               (pfile (prin1-to-string file)))
+               (pfile (prin1-to-string (package--quickstart-relative package-quickstart-file file))))
           (insert "(let* ((load-file-name " pfile ")\
 \(load-true-file-name load-file-name))\n")
           (insert-file-contents file)
@@ -4638,7 +4647,10 @@ package-quickstart-refresh
                   (append ',(mapcar #'package-desc-name package--quickstart-pkgs)
                           package-activated-list)))
           (current-buffer))
-      (let ((info-dirs (butlast Info-directory-list)))
+      (let ((info-dirs
+             (mapcar (lambda (info-dir)
+                       (package--quickstart-relative package-quickstart-file info-dir))
+                     (butlast Info-directory-list))))
         (when info-dirs
           (pp `(progn (require 'info)
                       (info-initialize)
-- 
2.39.3


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#77468; Package emacs. Full text available.

Message received at 77468 <at> debbugs.gnu.org:


Received: (at 77468) by debbugs.gnu.org; 2 Apr 2025 20:24:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 02 16:24:48 2025
Received: from localhost ([127.0.0.1]:59686 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u04dk-0001GZ-H0
	for submit <at> debbugs.gnu.org; Wed, 02 Apr 2025 16:24:48 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:10489)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <monnier@HIDDEN>)
 id 1u04di-0001GC-6V
 for 77468 <at> debbugs.gnu.org; Wed, 02 Apr 2025 16:24:46 -0400
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 7BDFC10004C;
 Wed,  2 Apr 2025 16:24:39 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1743625478;
 bh=X0tnMWzarrjaNms4aFpCCT0TA1eWozfb5JkaZvOua/Q=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=VFcd7yuQblQpxksDPizQEWfqB/bT/FksqREqVKk27dLS0Vpmp5TdNXoCFtrNmhXQr
 z5PvrBOGppkrGUCROqWd2xT6X98i+bVYmKfEKV9+FBs8hY/kOqMGtvmkgFRhelhXb+
 5EMzZ69jzZNCZ5ZPPNTlzgUvWx1+BSPPyaF254spMJVsF47447s9wZ9vSGqC7YW0N1
 46XC0hb/MH5O4/ch1Y8FD93C31BPPFLU7joOXZUDAVVbvGU8zg93a1V1SWZvIPTpsR
 CMU4v9ma20umDczwUFDUZ2iU+BUtaOszjTczANr4/7Ng0h23WGJEMK6C/XgLz/w9+I
 vo0BjrB6gzidg==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id B08DA100029;
 Wed,  2 Apr 2025 16:24:38 -0400 (EDT)
Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id A0C4B1203A5;
 Wed,  2 Apr 2025 16:24:38 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Spencer Baugh <sbaugh@HIDDEN>
Subject: Re: bug#77468: 30.1.50; package-quickstart file is not relocatable
In-Reply-To: <ier8qoi2vbr.fsf@HIDDEN>
Message-ID: <jwva58yz55u.fsf-monnier+emacs@HIDDEN>
References: <ieriknmtna6.fsf@HIDDEN>
 <jwvldsiz77w.fsf-monnier+emacs@HIDDEN>
 <ier8qoi2vbr.fsf@HIDDEN>
Date: Wed, 02 Apr 2025 16:24:38 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.105 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77468
Cc: 77468 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Maybe package-quickstart.el could use relative names to packages in
> package-user-dir (since it itself lives in package-user-dir), and
> absolute names to packages outside that?

Sounds OK.  Tho maybe we should check `file*-in-directory-p` (or the
presence of "../" in the output of `file-relative-name`) rather than
distinguishing based on `package-user-dir` vs `package-directory-list`?

In any case, it sounds like a good compromise.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#77468; Package emacs. Full text available.

Message received at 77468 <at> debbugs.gnu.org:


Received: (at 77468) by debbugs.gnu.org; 2 Apr 2025 19:54:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 02 15:54:25 2025
Received: from localhost ([127.0.0.1]:59614 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u04AK-0008HY-Mh
	for submit <at> debbugs.gnu.org; Wed, 02 Apr 2025 15:54:25 -0400
Received: from mxout5.mail.janestreet.com ([64.215.233.18]:50323)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <sbaugh@HIDDEN>)
 id 1u04AH-0008HJ-T8
 for 77468 <at> debbugs.gnu.org; Wed, 02 Apr 2025 15:54:22 -0400
From: Spencer Baugh <sbaugh@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#77468: 30.1.50; package-quickstart file is not relocatable
In-Reply-To: <jwvldsiz77w.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
 of "Wed, 02 Apr 2025 15:48:12 -0400")
References: <ieriknmtna6.fsf@HIDDEN>
 <jwvldsiz77w.fsf-monnier+emacs@HIDDEN>
Date: Wed, 02 Apr 2025 15:54:16 -0400
Message-ID: <ier8qoi2vbr.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com;
 s=waixah; t=1743623656;
 bh=DdN98qlxzZ5f7vOR/x/Nb6MIcPDjH0UUOxdFfUVsB6c=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=cEvgyhdeJKYwV7cC4Rfbbcfzkvu5Zuw5WSLNz7G4aZ2kRJHhRBZRkCrKY6X2bMSHt
 8sZuDmx0k4+eM/oPFRyAKROKkyQUmy8VXsr22kG4/+TZ/HZLD/NVwi2LHbHrgcw/QI
 8cflGomoNQDid61NbXVk3ur0jIGF6ic5RkZ4zOHOPheZqHUtTxJcGKb94DiiO5vCGH
 bxLDATNNhSeGb1dL+Pj3izumb2hIe6RjkDAvSnpAQGz0hTRaF7Gmn5W9Av5mDhpJVo
 qcpO157NRq2fbgPK9x7SBQZq6eBq/j/yI5nhQcopyy27nafs6ZOkMqDinGJZES8dm9
 usSVrABkr0zKQ==
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77468
Cc: 77468 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Stefan Monnier <monnier@HIDDEN> writes:
>> I think we should make package-quickstart use file names which are
>> relative to the location of the package-quickstart file itself.
>
> It would probably slow down startup a little bit since
> `package-quickstart.el` (PQ) would need to `expand-file-name` every time
> it binds `load-file-name`, but yes I think it would be a good change.
>
> There is still the problem that the relative file names may themselves
> break when your `package-directory-list` has directories that are
> outside of the home directory.
>
> Actually, now that I think about it, the change you suggest would break
> one of my use cases (where my packages are always at the same place,
> outside of $HOME, but $HOME does move).

Oh, right.  I didn't think of the case where package-quickstart.el
refers to packages outside the directory it lives in.

I definitely don't think package-quickstart.el should use relative names
to those packages - that would be quite weird - and I do expect it would
break some use cases.

Maybe package-quickstart.el could use relative names to packages in
package-user-dir (since it itself lives in package-user-dir), and
absolute names to packages outside that?

That would also fix my issue and I'd be happy to implement it.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#77468; Package emacs. Full text available.

Message received at 77468 <at> debbugs.gnu.org:


Received: (at 77468) by debbugs.gnu.org; 2 Apr 2025 19:48:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 02 15:48:24 2025
Received: from localhost ([127.0.0.1]:59579 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u044V-00081Y-ND
	for submit <at> debbugs.gnu.org; Wed, 02 Apr 2025 15:48:23 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:40103)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <monnier@HIDDEN>)
 id 1u044T-00081L-Mo
 for 77468 <at> debbugs.gnu.org; Wed, 02 Apr 2025 15:48:22 -0400
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 228C8442E1E;
 Wed,  2 Apr 2025 15:48:14 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1743623293;
 bh=uN+rIEP+1VwF6tLEXH4tpYt9O6gz1AFQnxUdgN5L0/4=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=lpxbr8BrY2oGB8XQYCRgGg1kSfphfcWwc6jrAmjuu+dbDv8+YYL9q4NOQx5UGZ3Qc
 LG2/kFLMWzM8S5sAfc2V83WRJCzVtXJe18JM9Ydf6O+E7kJJDCGDebclh0UcEW11Bd
 dHbMIxKXKJUlsNBo9vbe7uKr+g/ns+6vQ6UXGxlQdkH2u6ik3RBeP9q7NaGOPCwKRJ
 FFoKVJg4GzTiy2Y+Gbatkao/FZdOWMxuX47BBLHQMHo3Os/6RJn9AtdLlAmNJl9REo
 bcDfOmfZHPes/SjH4ud0Q7SDzxhnej8yGx92VqM/qNhzT8WJDUVf1vBeti0i0xJqrb
 Xp9OKL4rWToWQ==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 09C4B442DDA;
 Wed,  2 Apr 2025 15:48:13 -0400 (EDT)
Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id F16991202D5;
 Wed,  2 Apr 2025 15:48:12 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Spencer Baugh <sbaugh@HIDDEN>
Subject: Re: bug#77468: 30.1.50; package-quickstart file is not relocatable
In-Reply-To: <ieriknmtna6.fsf@HIDDEN>
Message-ID: <jwvldsiz77w.fsf-monnier+emacs@HIDDEN>
References: <ieriknmtna6.fsf@HIDDEN>
Date: Wed, 02 Apr 2025 15:48:12 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.216 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 77468
Cc: 77468 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> I think we should make package-quickstart use file names which are
> relative to the location of the package-quickstart file itself.

It would probably slow down startup a little bit since
`package-quickstart.el` (PQ) would need to `expand-file-name` every time
it binds `load-file-name`, but yes I think it would be a good change.

There is still the problem that the relative file names may themselves
break when your `package-directory-list` has directories that are
outside of the home directory.

Actually, now that I think about it, the change you suggest would break
one of my use cases (where my packages are always at the same place,
outside of $HOME, but $HOME does move).

Hmm...


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#77468; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 2 Apr 2025 18:46:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 02 14:46:08 2025
Received: from localhost ([127.0.0.1]:59386 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u036D-0005CZ-HM
	for submit <at> debbugs.gnu.org; Wed, 02 Apr 2025 14:46:08 -0400
Received: from lists.gnu.org ([2001:470:142::17]:57556)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <sbaugh@HIDDEN>)
 id 1u036A-0005Bz-QQ
 for submit <at> debbugs.gnu.org; Wed, 02 Apr 2025 14:46:03 -0400
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 <sbaugh@HIDDEN>)
 id 1u0364-0001yb-Vj
 for bug-gnu-emacs@HIDDEN; Wed, 02 Apr 2025 14:45:56 -0400
Received: from mxout5.mail.janestreet.com ([64.215.233.18])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <sbaugh@HIDDEN>)
 id 1u0363-0004hl-Cy
 for bug-gnu-emacs@HIDDEN; Wed, 02 Apr 2025 14:45:56 -0400
From: Spencer Baugh <sbaugh@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 30.1.50; package-quickstart file is not relocatable
X-Debbugs-Cc: Stefan Monnier <monnier@HIDDEN>
Date: Wed, 02 Apr 2025 14:45:53 -0400
Message-ID: <ieriknmtna6.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com;
 s=waixah; t=1743619553;
 bh=GhpXHkVn9esV+F1Aff4PM7KiJjQx5GI9xggaXMxgmMM=;
 h=From:To:Subject:Date;
 b=YU7oRd+U4q573bfA56K+1MNz6aUXy69HZRljS0Koc2WUbwDACIOPOlY82i1NQdI5x
 I2otwSJh5CRjlEASuGXMyOHuo6sL/ai2fStNxLvxiL54lmiP/EZoEa2zKIXrpdzYnp
 P+e0HDBJT5lfehYYrcZLD+AO79qYwsTQeFd3Y7OEqTJYr6tqWcEFUGij6TsHWrBKku
 PfuLsHQiEqUS42Thw2FWFTV26UQBXshb4NgvRahXiT7DNWgdlx2arttoRMhf/6PhUP
 XyZgSNOfFGIYxIiOXzRXl8i/jRCd5gzHhiMgwK4n3ZQuNqD3Gq6H+fUunUTznxctM2
 183zr/W6vFA1A==
Received-SPF: pass client-ip=64.215.233.18; envelope-from=sbaugh@HIDDEN;
 helo=mxout5.mail.janestreet.com
X-Spam_score_int: -43
X-Spam_score: -4.4
X-Spam_bar: ----
X-Spam_report: (-4.4 / 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,
 RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001,
 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,
 SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.9 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


The package-quickstart file hardcodes various absolute file names.  This
means it can't be used in situations where the package directory might
be at different absolute names at package-quickstart-refresh time
and at usage time.

For example:

- network filesystems where the user's home directory has a different
  absolute name on different hosts

- a system-wide package-directory-list entry which has a
  package-quickstart file generated for it at build time which has a
  different absolute name at install time (this is my use case; there
  are other problems with it, but the absolute names are the biggest
  one)

I think we should make package-quickstart use file names which are
relative to the location of the package-quickstart file itself.  I'm
happy to write the patch for this if that sounds reasonable.




Acknowledgement sent to Spencer Baugh <sbaugh@HIDDEN>:
New bug report received and forwarded. Copy sent to monnier@HIDDEN, bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to monnier@HIDDEN, bug-gnu-emacs@HIDDEN:
bug#77468; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 3 Apr 2025 05:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.