GNU bug report logs - #81908
31.1; Circular dependency: package-vc on a mono-repo package such as dash.el

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: Dan <daanturo@HIDDEN>; dated Tue, 22 Sep 2026 11:12:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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


Received: (at 81908) by debbugs.gnu.org; 3 Oct 2026 11:40:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 03 07:40:24 2026
Received: from localhost ([127.0.0.1]:55278 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1xCy6F-0003Dk-6T
	for submit <at> debbugs.gnu.org; Sat, 03 Oct 2026 07:40:23 -0400
Received: from mail-10697.protonmail.ch ([79.135.106.97]:31533)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <daanturo@HIDDEN>)
 id 1xCy66-00039h-4t
 for 81908 <at> debbugs.gnu.org; Sat, 03 Oct 2026 07:40:15 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me;
 s=protonmail2; t=1791027602; x=1791286802;
 bh=QNc5/vbukJHhsf4NdbOm82/uVnOsd9dnzkJkXge7Bqo=;
 h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References:
 Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID:
 Message-ID:BIMI-Selector;
 b=wEi7f60KvFhU2a9HBPgaIYZrVYmD0Ns6+O31chaMoe9xPNqd0k7QD/soGb51wf5QW
 0MSfhNZWAFPsEWlXO10qU6CY+BgOrUMpp5Lwuy6W0HurzYdMwzW5trmD5NGMFZDARe
 /jxZYDbBjSuY5SRXo6o4V+iU2VzcXkphjO6upBmWiHuD0nAoPsO4F3GKsqLvyeftpB
 g/lm6cMgeX/yZFCrlH8hLx82NJb/sOZpKKg93vvYC9r8Sdfilu3JcA0WHGsNw2gPfI
 M+Z2Llj8qSNyUgudVh8tHurM9/LJAjt1egU9kbZByZRjwo1snusic5YpmpJXDmzsWL
 ZsFR+ub+wqGfw==
Date: Sat, 03 Oct 2026 11:40:00 +0000
To: Philip Kaludercic <philipk@HIDDEN>
From: Dan <daanturo@HIDDEN>
Subject: Re: bug#81908: 31.1;
 Circular dependency: package-vc on a mono-repo package such as dash.el
Message-ID: <H1AFrUCO4V6kq7_tQMceUDBrrrF8rkc8wgTXHGTiREnPTs4iDisqoWOf4vrIKkND7GePRi54hfJ1R9FyzHD060HWFo1SLD6tEX62FyTwSUs=@proton.me>
In-Reply-To: <871pa9qgua.fsf@HIDDEN>
References: <oTqlp8kKMCh7bahcziVIQCtTAHRD-O9D3IL80JvzXR8qx-HUjFVx5Q-V5nTvUPUdJZfMIjD4XH7ngdiB2OS7GWa6kGZfaqo_14uSGwqaYwo=@proton.me>
 <87pky5eahg.fsf@HIDDEN> <87bj9pqj8v.fsf@HIDDEN>
 <wY1jVWIVHeEbm8dMN8sX5sFvmzCQgFY5fW8_GO-RKQZ9y5WRHLqd4aMISF5jAgtfilOSlDfhR3EJH4gqpCMTu2w-R4iXn57anI5zetm5qrQ=@proton.me>
 <87se2zq0tf.fsf@HIDDEN>
 <KbvrAsw63xkKtsJh4dxhbve_uhF3O_LA1ejabq3C_DHP1QrjFSzM_DH99GF7BY0nPnYPgRxGLAxB1pCIk3Xt1wT94C6kXyLMkZvXnONux-8=@proton.me>
 <878q4norsr.fsf@HIDDEN> <jwvpkxywvhg.fsf-monnier+emacs@HIDDEN>
 <871pa9qgua.fsf@HIDDEN>
Feedback-ID: 101171749:user:proton
X-Pm-Message-ID: 7cf99b3f2fcfe146eb45c77b510dd8e612801b24
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 81908
Cc: 81908 <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: -1.7 (-)

> diff --git a/lisp/emacs-lisp/package-activate.el b/lisp/emacs-lisp/packag=
e-activate.el
> index 823ce88dcd4..d98f65e2b58 100644
> --- a/lisp/emacs-lisp/package-activate.el
> +++ b/lisp/emacs-lisp/package-activate.el
> @@ -386,16 +386,21 @@ package-activate-1
> =20
>  (defun package--get-activatable-pkg (pkg-name)
>    ;; Is "activatable" a word?
> -  (let ((pkg-descs (cdr (assq pkg-name package-alist))))
> -    ;; Check if PACKAGE is available in `package-alist'.
> -    (while
> -        (when pkg-descs
> -          (let ((available-version (package-desc-version (car pkg-descs)=
)))
> -            (or (package-disabled-p pkg-name available-version)
> -                ;; Prefer a builtin package.
> -                (package-built-in-p pkg-name available-version))))
> -      (setq pkg-descs (cdr pkg-descs)))
> -    (car pkg-descs)))
> +  (catch 'activate
> +    (let ((pkg-descs (cdr (assq pkg-name package-alist))))
> +      ;; Prefer VC packages
> +      (dolist (desc pkg-descs)
> +        (when (package-vc-p desc)
> +          (throw 'activate desc)))
> +      ;; Check if PACKAGE is available in `package-alist'.
> +      (dolist (desc pkg-descs)
> +        (let ((available-version (package-desc-version desc)))
> +          (unless (or (package-disabled-p pkg-name available-version)
> +                      ;; Prefer a builtin package: If the build-in
> +                      ;; version of the package is newer than DESC, we
> +                      ;; skip considering to activate it.
> +                      (package-built-in-p pkg-name available-version))
> +            (throw 'activate desc)))))))
> =20
>  ;; This function activates a newer version of a package if an older
>  ;; one was already activated.  It also loads a features of this

Thank you, let's consider the "prefer vc" problem solved.

Back to "dependencies", how will we decide on the customizing method?  I
think passing to package-vc-install's arguments is cleaner; but
extending the said function's parameters will leave use-package's :vc
unsupported, without modifying its handlers; adding more info to PACKAGE
arg's spec is problematic as (IIRC) if (PNAME . SPEC) is used, then user
must supply further info without archives filling in.  Or a global
defcustom almost like package-load-list?  I don't have a strong opinion.


----Dan.






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

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


Received: (at 81908) by debbugs.gnu.org; 1 Oct 2026 20:57:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 01 16:57:45 2026
Received: from localhost ([127.0.0.1]:55997 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1xCNqb-0006Ur-0k
	for submit <at> debbugs.gnu.org; Thu, 01 Oct 2026 16:57:45 -0400
Received: from mout01.posteo.de ([185.67.36.65]:32877)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <philipk@HIDDEN>)
 id 1xCNqY-0006U8-0R
 for 81908 <at> debbugs.gnu.org; Thu, 01 Oct 2026 16:57:42 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 22DFF240029
 for <81908 <at> debbugs.gnu.org>; Thu,  1 Oct 2026 22:57:35 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posteo.net;
 s=1984.8680eb; t=1790888255;
 bh=VWrHvUUdBIhqrYfQqCf4tEvdMrfh9MS99HYz32moTvk=;
 h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version:
 Content-Type:From;
 b=TIGprtw3IvSap+DeQ5/XmrvFOjE8lAzKp2AfHmIA+4OzYAb6xMMqF7Mf8YQpK1X/G
 ssV2i5/ZjI6l8An4yAdoHjDf/nsyBGo4b0wXMcee4BMoGVnzVbaWMifJg9YcUIgWB0
 r51482/hEYQe0FGT+ChRFV6F08yuih8PHbQapDYIl2mAs21h6szRaydKB2ibZDvxTk
 zxYArK8aAssUuy+UXUEF8P1PZVWcxRl1Oz12iI7uLvmUvkQ6WW2ZT8ryldq+arJXQa
 370sei65Zt/wFNEkrfNrxRG8ReZxigNGBX00DYVpIdisX+Nq6/Xyussppyg7b/YJRp
 G56LWWvW7A64g==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4hwkkk2SmYz6tsg;
 Thu,  1 Oct 2026 22:57:34 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#81908: 31.1; Circular dependency: package-vc on a mono-repo
 package such as dash.el
In-Reply-To: <jwvpkxywvhg.fsf-monnier+emacs@HIDDEN>
References: <oTqlp8kKMCh7bahcziVIQCtTAHRD-O9D3IL80JvzXR8qx-HUjFVx5Q-V5nTvUPUdJZfMIjD4XH7ngdiB2OS7GWa6kGZfaqo_14uSGwqaYwo=@proton.me>
 <87pky5eahg.fsf@HIDDEN> <87bj9pqj8v.fsf@HIDDEN>
 <wY1jVWIVHeEbm8dMN8sX5sFvmzCQgFY5fW8_GO-RKQZ9y5WRHLqd4aMISF5jAgtfilOSlDfhR3EJH4gqpCMTu2w-R4iXn57anI5zetm5qrQ=@proton.me>
 <87se2zq0tf.fsf@HIDDEN>
 <KbvrAsw63xkKtsJh4dxhbve_uhF3O_LA1ejabq3C_DHP1QrjFSzM_DH99GF7BY0nPnYPgRxGLAxB1pCIk3Xt1wT94C6kXyLMkZvXnONux-8=@proton.me>
 <878q4norsr.fsf@HIDDEN> <jwvpkxywvhg.fsf-monnier+emacs@HIDDEN>
OpenPGP: id=philipk@HIDDEN;
 url="https://keys.openpgp.org/vks/v1/by-email/philipk@HIDDEN";
 preference=signencrypt
Date: Thu, 01 Oct 2026 20:57:34 +0000
Message-ID: <871pa9qgua.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 81908
Cc: Dan <daanturo@HIDDEN>, 81908 <at> debbugs.gnu.org,
 Sean Whitton <spwhitton@HIDDEN>
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:

>> CC Stefan: You wrote up this function a few years back, and one thing
>> that confuses me is the "Prefer a builtin package." comment, since the
>> function seems like it is doing the opposite?  We are skipping over
>> package descriptors if they are built-in (as they don't have to be
>> activated in the first place).
>
> It took me a while, but now I got it: the `package-built-in-p` test
> doesn't check if the `(car pkg-descs)` describes a built-in package (by
> definition it doesn't), but checks if the non-built-in package `(car
> pkg-descs)` is an older version of a built-in package.
>
> IOW, the key is that built-in packages are pre-activated and that
> `package-alist` does not include builtin packages.

Ah yes, that makes sense since the second argument of package-built-in-p
is MIN-VERSION.  So we are skipping all entries in package-alist that
are older than the built-in version.

So I revise my previous proposal to include a comment that says
something along those lines:


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline

diff --git a/lisp/emacs-lisp/package-activate.el b/lisp/emacs-lisp/package-activate.el
index 823ce88dcd4..d98f65e2b58 100644
--- a/lisp/emacs-lisp/package-activate.el
+++ b/lisp/emacs-lisp/package-activate.el
@@ -386,16 +386,21 @@ package-activate-1
 
 (defun package--get-activatable-pkg (pkg-name)
   ;; Is "activatable" a word?
-  (let ((pkg-descs (cdr (assq pkg-name package-alist))))
-    ;; Check if PACKAGE is available in `package-alist'.
-    (while
-        (when pkg-descs
-          (let ((available-version (package-desc-version (car pkg-descs))))
-            (or (package-disabled-p pkg-name available-version)
-                ;; Prefer a builtin package.
-                (package-built-in-p pkg-name available-version))))
-      (setq pkg-descs (cdr pkg-descs)))
-    (car pkg-descs)))
+  (catch 'activate
+    (let ((pkg-descs (cdr (assq pkg-name package-alist))))
+      ;; Prefer VC packages
+      (dolist (desc pkg-descs)
+        (when (package-vc-p desc)
+          (throw 'activate desc)))
+      ;; Check if PACKAGE is available in `package-alist'.
+      (dolist (desc pkg-descs)
+        (let ((available-version (package-desc-version desc)))
+          (unless (or (package-disabled-p pkg-name available-version)
+                      ;; Prefer a builtin package: If the build-in
+                      ;; version of the package is newer than DESC, we
+                      ;; skip considering to activate it.
+                      (package-built-in-p pkg-name available-version))
+            (throw 'activate desc)))))))
 
 ;; This function activates a newer version of a package if an older
 ;; one was already activated.  It also loads a features of this

--=-=-=--




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

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


Received: (at 81908) by debbugs.gnu.org; 27 Sep 2026 15:57:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 27 11:57:23 2026
Received: from localhost ([127.0.0.1]:36733 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1xArFj-0003ry-5J
	for submit <at> debbugs.gnu.org; Sun, 27 Sep 2026 11:57:23 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:7553)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <monnier@HIDDEN>)
 id 1xArFh-0003rg-EX
 for 81908 <at> debbugs.gnu.org; Sun, 27 Sep 2026 11:57:21 -0400
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 307C080976;
 Sun, 27 Sep 2026 11:57:15 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1790524634;
 bh=XeitivItvVDQz4xt6YIkCfoG5UFYW+rpUSwC1IAtO34=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=TKMrv+BhLaj7bcd+N3IkdhSbebrekzxPDkGXR9ME+NqZPd0V2X3Hx+zLpGtDYJ0QL
 hi2M/U8M/kgxRjSaU7yVSafV06N+oJ3W8/TxKLO/I3EJfbWrnjZMD5rYCWmBDj/YzW
 ko2irp1BnQhsRA3p0JpBP51JuX47c8hpWL3fm0A70sJ5NS6EBcuCD2IhSVgAAvYWwE
 gHQVTNZv9/RZ9LsYE32BwXL1RnRk8u5ElCknnUFTmsc31Vq7p3DZMwv+BvkJn8ByCL
 isRPGM5VwxubKlvOgr95jRJrWAYZSUh9PMUuQDOJcJp6Fw20MppvEAoea3Yd+yon+e
 nqfnkilm23Uog==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 780E2806A5;
 Sun, 27 Sep 2026 11:57:14 -0400 (EDT)
Received: from pastel (104-195-194-42.cpe.teksavvy.com [104.195.194.42])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 3F9ED120352;
 Sun, 27 Sep 2026 11:57:14 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
Subject: Re: bug#81908: 31.1; Circular dependency: package-vc on a mono-repo
 package such as dash.el
In-Reply-To: <878q4norsr.fsf@HIDDEN>
Message-ID: <jwvpkxywvhg.fsf-monnier+emacs@HIDDEN>
References: <oTqlp8kKMCh7bahcziVIQCtTAHRD-O9D3IL80JvzXR8qx-HUjFVx5Q-V5nTvUPUdJZfMIjD4XH7ngdiB2OS7GWa6kGZfaqo_14uSGwqaYwo=@proton.me>
 <87pky5eahg.fsf@HIDDEN> <87bj9pqj8v.fsf@HIDDEN>
 <wY1jVWIVHeEbm8dMN8sX5sFvmzCQgFY5fW8_GO-RKQZ9y5WRHLqd4aMISF5jAgtfilOSlDfhR3EJH4gqpCMTu2w-R4iXn57anI5zetm5qrQ=@proton.me>
 <87se2zq0tf.fsf@HIDDEN>
 <KbvrAsw63xkKtsJh4dxhbve_uhF3O_LA1ejabq3C_DHP1QrjFSzM_DH99GF7BY0nPnYPgRxGLAxB1pCIk3Xt1wT94C6kXyLMkZvXnONux-8=@proton.me>
 <878q4norsr.fsf@HIDDEN>
Date: Sun, 27 Sep 2026 11:57: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.081 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: 81908
Cc: Dan <daanturo@HIDDEN>, 81908 <at> debbugs.gnu.org,
 Sean Whitton <spwhitton@HIDDEN>
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 Stefan: You wrote up this function a few years back, and one thing
> that confuses me is the "Prefer a builtin package." comment, since the
> function seems like it is doing the opposite?  We are skipping over
> package descriptors if they are built-in (as they don't have to be
> activated in the first place).

It took me a while, but now I got it: the `package-built-in-p` test
doesn't check if the `(car pkg-descs)` describes a built-in package (by
definition it doesn't), but checks if the non-built-in package `(car
pkg-descs)` is an older version of a built-in package.

IOW, the key is that built-in packages are pre-activated and that
`package-alist` does not include builtin packages.


=== Stefan





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

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


Received: (at 81908) by debbugs.gnu.org; 27 Sep 2026 11:30:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 27 07:30:24 2026
Received: from localhost ([127.0.0.1]:46883 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1xAn5M-0002lh-8l
	for submit <at> debbugs.gnu.org; Sun, 27 Sep 2026 07:30:24 -0400
Received: from mout02.posteo.de ([185.67.36.66]:49611)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <philipk@HIDDEN>)
 id 1xAn5J-0002Ps-70
 for 81908 <at> debbugs.gnu.org; Sun, 27 Sep 2026 07:30:22 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 3AE86240101
 for <81908 <at> debbugs.gnu.org>; Sun, 27 Sep 2026 13:30:14 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posteo.net;
 s=1984.8680eb; t=1790508614;
 bh=xHO3eRQNhHgewKVH+EL/jASBUz8UuAmQP/q8iD+tYPE=;
 h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version:
 Content-Type:From;
 b=LgTydJhoJa4rgnQG6lXa9deEFJKw0dCijIr9yMwQGhE3/IuruGhLQOcSJcLkeA4KX
 MwBKzaO1uF9ffkmCO/seXpGq4Sla6mDUcBjWcZc/hFxEA5OjSfFbea1GPdMD0bQ/OR
 CjP7wawTtOnw2DS3TBR3VIIVe0bdsfHo1b3Wq3VuPj9fBgnR9kMVWeziuQqfZ0Fr2U
 ZYord1tGUxNi5Yp9d/k47z1ZbjOt4bFlYxxT+eKyHgkWohWP8htoOC7nenpRcNbxlu
 v1FZAsgKipweyoGJkARFZIsW+q1MEU1o2REL1vj2k2J0I4kKy1Hq2J7lMsLheOxAQe
 8fLAZab6hhH0g==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4ht2Kx2Y1Zz6twJ;
 Sun, 27 Sep 2026 13:30:13 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: Dan <daanturo@HIDDEN>
Subject: Re: bug#81908: 31.1; Circular dependency: package-vc on a mono-repo
 package such as dash.el
In-Reply-To: <KbvrAsw63xkKtsJh4dxhbve_uhF3O_LA1ejabq3C_DHP1QrjFSzM_DH99GF7BY0nPnYPgRxGLAxB1pCIk3Xt1wT94C6kXyLMkZvXnONux-8=@proton.me>
References: <oTqlp8kKMCh7bahcziVIQCtTAHRD-O9D3IL80JvzXR8qx-HUjFVx5Q-V5nTvUPUdJZfMIjD4XH7ngdiB2OS7GWa6kGZfaqo_14uSGwqaYwo=@proton.me>
 <87pky5eahg.fsf@HIDDEN> <87bj9pqj8v.fsf@HIDDEN>
 <wY1jVWIVHeEbm8dMN8sX5sFvmzCQgFY5fW8_GO-RKQZ9y5WRHLqd4aMISF5jAgtfilOSlDfhR3EJH4gqpCMTu2w-R4iXn57anI5zetm5qrQ=@proton.me>
 <87se2zq0tf.fsf@HIDDEN>
 <KbvrAsw63xkKtsJh4dxhbve_uhF3O_LA1ejabq3C_DHP1QrjFSzM_DH99GF7BY0nPnYPgRxGLAxB1pCIk3Xt1wT94C6kXyLMkZvXnONux-8=@proton.me>
OpenPGP: id=philipk@HIDDEN;
 url="https://keys.openpgp.org/vks/v1/by-email/philipk@HIDDEN";
 preference=signencrypt
Date: Sun, 27 Sep 2026 11:30:13 +0000
Message-ID: <878q4norsr.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 81908
Cc: 81908 <at> debbugs.gnu.org, Stefan
 Monnier <monnier@HIDDEN>, Sean Whitton <spwhitton@HIDDEN>
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

Dan <daanturo@HIDDEN> writes:

>> The point is that we can't make any specific assumptions like that,
>> since package-vc doesn't make any assumptions like that.  It is as much
>> the fault of the user as the maintainer -- the point is to try and avoid
>> issues that are hard to debug and handle a situation like that gracefully.
>
> Alright, then I think it's good as long as there is a supported workaround.
>
>> Hmm, for some reason I misremembered that something like this should
>> already be the case?  My suggestion would be to modify
>> `package--get-activatable-pkg' instead.  I am not sure the order of
>> packages in the alist values is actually documented to specify a
>> priority of what packages to load, as the docstring referrers to
>> `package-load-list'.
>
> While looking at package--get-activatable-pkg, a random idle git blame
> pointed me to bug#63757 3 years ago, resolved by a reverting commit:
> https://github.com/emacs-mirror/emacs/commit/90eadc3e2349c155a14aedb6cf09d9c571d8e698
>
>  (defun package--get-activatable-pkg (pkg-name)
>    ;; Is "activatable" a word?
> -  (let ((pkg-descs (sort (cdr (assq pkg-name package-alist))
> -                         (lambda (p1 p2)
> -                           (let ((v1 (package-desc-version p1))
> -                                 (v2 (package-desc-version p2)))
> -                             (or
> -                              ;; Prefer VC packages.
> -                              (package-vc-p p1)
> -                              (package-vc-p p2)
> -                              ;; Prefer builtin packages.
> -                              (package-disabled-p p1 v1)
> -                              (not (package-disabled-p p2 v2))))))))
> +  (let ((pkg-descs (cdr (assq pkg-name package-alist))))
>      ;; Check if PACKAGE is available in `package-alist'.
>      (while
>          (when pkg-descs
>            (let ((available-version (package-desc-version (car pkg-descs))))
> -            (package-disabled-p pkg-name available-version)))
> +            (or (package-disabled-p pkg-name available-version)
> +                ;; Prefer a builtin package.
> +                (package-built-in-p pkg-name available-version))))
>        (setq pkg-descs (cdr pkg-descs)))
>
> Note the '(package-vc-p p2)' part, while the mentioned reverted commit fb87d50
> did '(not (eq (package-desc-kind p2) 'vc))'.
>
> Commit e75994f2ff0fb863cb978e354926d0d138d5b362 before reverting:
>
> -                              (eq (package-desc-kind p1) 'vc)
> -                              (not (eq (package-desc-kind p2) 'vc))
> +                              (package-vc-p p1)
> +                              (package-vc-p p2)
>
> The error seems to be here?  sort's LESSP func arg decides if p1 would
> be positioned before p2, but it even puts p1 first when p2 is vc and p1
> isnt.  Therefore the sorted result went wrong, perhaps that was the
> cause of bug#63757?

I actually think part of the issue is that `sort' is destructive, so
finding a package to activate could actually destroy the structure of
package-alist, which has repercussions down the line if any package
accesses `package-alist'.

Since the lists are usually short enough, we could consider changing the
implementation of the function along these lines:


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline

diff --git a/lisp/emacs-lisp/package-activate.el b/lisp/emacs-lisp/package-activate.el
index 823ce88dcd4..2a5117f5302 100644
--- a/lisp/emacs-lisp/package-activate.el
+++ b/lisp/emacs-lisp/package-activate.el
@@ -386,16 +386,19 @@ package-activate-1
 
 (defun package--get-activatable-pkg (pkg-name)
   ;; Is "activatable" a word?
-  (let ((pkg-descs (cdr (assq pkg-name package-alist))))
-    ;; Check if PACKAGE is available in `package-alist'.
-    (while
-        (when pkg-descs
-          (let ((available-version (package-desc-version (car pkg-descs))))
-            (or (package-disabled-p pkg-name available-version)
-                ;; Prefer a builtin package.
-                (package-built-in-p pkg-name available-version))))
-      (setq pkg-descs (cdr pkg-descs)))
-    (car pkg-descs)))
+  (catch 'activate
+    (let ((pkg-descs (cdr (assq pkg-name package-alist))))
+      ;; Prefer VC packages
+      (dolist (desc pkg-descs)
+        (when (package-vc-p desc)
+          (throw 'activate desc)))
+      ;; Check if PACKAGE is available in `package-alist'.
+      (dolist (desc pkg-descs)
+        (let ((available-version (package-desc-version desc)))
+          (unless (or (package-disabled-p pkg-name available-version)
+                      ;; Prefer a builtin package.
+                      (package-built-in-p pkg-name available-version))
+            (throw 'activate desc)))))))
 
 ;; This function activates a newer version of a package if an older
 ;; one was already activated.  It also loads a features of this

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


It doesn't seem to break anything in my setup, but I haven't properly
tested it yet.

CC Stefan: You wrote up this function a few years back, and one thing
that confuses me is the "Prefer a builtin package." comment, since the
function seems like it is doing the opposite?  We are skipping over
package descriptors if they are built-in (as they don't have to be
activated in the first place).

--=-=-=--




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

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


Received: (at 81908) by debbugs.gnu.org; 24 Sep 2026 09:16:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 24 05:16:46 2026
Received: from localhost ([127.0.0.1]:35949 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1x9fZJ-0000fH-Eu
	for submit <at> debbugs.gnu.org; Thu, 24 Sep 2026 05:16:46 -0400
Received: from mail-10697.protonmail.ch ([79.135.106.97]:59469)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <daanturo@HIDDEN>)
 id 1x9fZ8-0000aI-CM
 for 81908 <at> debbugs.gnu.org; Thu, 24 Sep 2026 05:16:36 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me;
 s=protonmail; t=1790241382; x=1790500582;
 bh=HYR077OrlONXeSDRix2x/WuJo/f4d87zYb/RRb6cq8w=;
 h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References:
 Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID:
 Message-ID:BIMI-Selector;
 b=Dd+x6cMSO91i3lT0nCD80Bq1dvYyWYmqwx2KJdkcgoTM2L4kLGyZZ1SxOS6mV9Y1D
 1oMLP6FTx2iDyrns2Mk1fYOQxVjTWuV44eP6OXYv6IY4poJ8cq5xM8LcKHfMzdms+v
 y6rTwYWSHGoXjj//4xMQwH4KLyKnLobcKH3zHMwrVKuaowMP3eZTeNRSG8GgJXmon1
 7OAR09ywWm+mwtpjltGR0gcOFr1v8Op2BWXYCmCY4DM7ZmZip4iJKQRiPI/FE93KWa
 ayrRls1qiIHpizAfSLLcTNkStLuyi2iZxBSVwBA9Ie9jy6hyYBcbnB1xhJWv3KPLCV
 tsUE+jkFcRIQQ==
Date: Thu, 24 Sep 2026 09:16:19 +0000
To: Philip Kaludercic <philipk@HIDDEN>
From: Dan <daanturo@HIDDEN>
Subject: Re: bug#81908: 31.1;
 Circular dependency: package-vc on a mono-repo package such as dash.el
Message-ID: <KbvrAsw63xkKtsJh4dxhbve_uhF3O_LA1ejabq3C_DHP1QrjFSzM_DH99GF7BY0nPnYPgRxGLAxB1pCIk3Xt1wT94C6kXyLMkZvXnONux-8=@proton.me>
In-Reply-To: <87se2zq0tf.fsf@HIDDEN>
References: <oTqlp8kKMCh7bahcziVIQCtTAHRD-O9D3IL80JvzXR8qx-HUjFVx5Q-V5nTvUPUdJZfMIjD4XH7ngdiB2OS7GWa6kGZfaqo_14uSGwqaYwo=@proton.me>
 <87pky5eahg.fsf@HIDDEN> <87bj9pqj8v.fsf@HIDDEN>
 <wY1jVWIVHeEbm8dMN8sX5sFvmzCQgFY5fW8_GO-RKQZ9y5WRHLqd4aMISF5jAgtfilOSlDfhR3EJH4gqpCMTu2w-R4iXn57anI5zetm5qrQ=@proton.me>
 <87se2zq0tf.fsf@HIDDEN>
Feedback-ID: 101171749:user:proton
X-Pm-Message-ID: b8a2d0884e6ed746e4ff09324bfa971fd3174b58
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 81908
Cc: 81908 <at> debbugs.gnu.org, Sean Whitton <spwhitton@HIDDEN>
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.7 (-)

> The point is that we can't make any specific assumptions like that,
> since package-vc doesn't make any assumptions like that.  It is as much
> the fault of the user as the maintainer -- the point is to try and avoid
> issues that are hard to debug and handle a situation like that gracefully=
.

Alright, then I think it's good as long as there is a supported workaround.

> Hmm, for some reason I misremembered that something like this should
> already be the case?  My suggestion would be to modify
> `package--get-activatable-pkg' instead.  I am not sure the order of
> packages in the alist values is actually documented to specify a
> priority of what packages to load, as the docstring referrers to
> `package-load-list'.

While looking at package--get-activatable-pkg, a random idle git blame
pointed me to bug#63757 3 years ago, resolved by a reverting commit:
https://github.com/emacs-mirror/emacs/commit/90eadc3e2349c155a14aedb6cf09d9=
c571d8e698

 (defun package--get-activatable-pkg (pkg-name)
   ;; Is "activatable" a word?
-  (let ((pkg-descs (sort (cdr (assq pkg-name package-alist))
-                         (lambda (p1 p2)
-                           (let ((v1 (package-desc-version p1))
-                                 (v2 (package-desc-version p2)))
-                             (or
-                              ;; Prefer VC packages.
-                              (package-vc-p p1)
-                              (package-vc-p p2)
-                              ;; Prefer builtin packages.
-                              (package-disabled-p p1 v1)
-                              (not (package-disabled-p p2 v2))))))))
+  (let ((pkg-descs (cdr (assq pkg-name package-alist))))
     ;; Check if PACKAGE is available in `package-alist'.
     (while
         (when pkg-descs
           (let ((available-version (package-desc-version (car pkg-descs)))=
)
-            (package-disabled-p pkg-name available-version)))
+            (or (package-disabled-p pkg-name available-version)
+                ;; Prefer a builtin package.
+                (package-built-in-p pkg-name available-version))))
       (setq pkg-descs (cdr pkg-descs)))

Note the '(package-vc-p p2)' part, while the mentioned reverted commit fb87=
d50
did '(not (eq (package-desc-kind p2) 'vc))'.

Commit e75994f2ff0fb863cb978e354926d0d138d5b362 before reverting:

-                              (eq (package-desc-kind p1) 'vc)
-                              (not (eq (package-desc-kind p2) 'vc))
+                              (package-vc-p p1)
+                              (package-vc-p p2)

The error seems to be here?  sort's LESSP func arg decides if p1 would
be positioned before p2, but it even puts p1 first when p2 is vc and p1
isnt.  Therefore the sorted result went wrong, perhaps that was the
cause of bug#63757?



----Dan.




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

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


Received: (at 81908) by debbugs.gnu.org; 23 Sep 2026 18:28:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 23 14:28:59 2026
Received: from localhost ([127.0.0.1]:55609 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1x9RiD-0000lc-Ku
	for submit <at> debbugs.gnu.org; Wed, 23 Sep 2026 14:28:59 -0400
Received: from mout01.posteo.de ([185.67.36.65]:40207)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <philipk@HIDDEN>)
 id 1x9Ri9-0000ju-8A
 for 81908 <at> debbugs.gnu.org; Wed, 23 Sep 2026 14:28:55 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 1703D240029
 for <81908 <at> debbugs.gnu.org>; Wed, 23 Sep 2026 20:28:46 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posteo.net;
 s=1984.8680eb; t=1790188126;
 bh=d7j6P/HHnEUnQe6i/jAFCD708C+yOwqshN9mMxtVy1w=;
 h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version:
 Content-Type:From;
 b=Uksg28f//WJXFbsEuzW3rLdeMLkXw+Uk4XlvQBNh2pBmCyXxm4Nhf8j9sWcacdVjV
 sAQTXqo3ooYTcXEWuKKEP1Y1wl7yzjgD6G8AAvh7gnRa8diCwSLnDJ6gPjyZazCYaI
 zoE9YJOAYVkUqW8UNgQxgS7YYsQvpB6RMyWDQjYKSqQzmcKe6PESAmmzsxK0UNGc5n
 O/Jwfuym2vQb9dBM4IdtSVBzoiTSHzWX68QtQHROPV3cLSB8OOUMI1Rrh20RdMWhdE
 6Gm9wnQpDbB1FfHzNY6frDIXAFMgTplM1n+/it8UO1lRuBd1BlMOAMtrNwtHsksA2q
 hxov9n1sS6zAA==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4hqlpj34pLz6tyT;
 Wed, 23 Sep 2026 20:28:44 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: Dan <daanturo@HIDDEN>
Subject: Re: bug#81908: 31.1; Circular dependency: package-vc on a mono-repo
 package such as dash.el
In-Reply-To: <wY1jVWIVHeEbm8dMN8sX5sFvmzCQgFY5fW8_GO-RKQZ9y5WRHLqd4aMISF5jAgtfilOSlDfhR3EJH4gqpCMTu2w-R4iXn57anI5zetm5qrQ=@proton.me>
References: <oTqlp8kKMCh7bahcziVIQCtTAHRD-O9D3IL80JvzXR8qx-HUjFVx5Q-V5nTvUPUdJZfMIjD4XH7ngdiB2OS7GWa6kGZfaqo_14uSGwqaYwo=@proton.me>
 <87pky5eahg.fsf@HIDDEN> <87bj9pqj8v.fsf@HIDDEN>
 <wY1jVWIVHeEbm8dMN8sX5sFvmzCQgFY5fW8_GO-RKQZ9y5WRHLqd4aMISF5jAgtfilOSlDfhR3EJH4gqpCMTu2w-R4iXn57anI5zetm5qrQ=@proton.me>
OpenPGP: id=philipk@HIDDEN;
 url="https://keys.openpgp.org/vks/v1/by-email/philipk@HIDDEN";
 preference=signencrypt
Date: Wed, 23 Sep 2026 18:28:45 +0000
Message-ID: <87se2zq0tf.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 81908
Cc: 81908 <at> debbugs.gnu.org, Sean Whitton <spwhitton@HIDDEN>
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 (---)

Dan <daanturo@HIDDEN> writes:

>> Nevertheless, this patch seems to fix the specific problem for me:
>
> Awesome, I thought of swiper (redundant installs of ivy+swiper) and this
> should fix for it, too.
>
>> Note that it ignores versioning, it doesn't check if the file it found
>> is actually related to the package in a package archive (can be an issue
>> for packages that are not part of any archive) and doesn't work if the
>> name of the package doesn't match any of the files.  So if anything,
>> I think we should allow either to disable this check or require to
>> enable it.
>
> If a dependency isn't in any package archives, shouldn't the maintainer
> be responsible for informing their users anyway?  Admittedly potentially
> troublesome fix, but I can't recall/think of a plausible case where a
> package provides a file.el whose base name is exactly among its
> dependencies without messing up in load-path priorities.  Perhaps let's
> just add the fix as-is, then consider an option when someone does a bug
> report?

The point is that we can't make any specific assumptions like that,
since package-vc doesn't make any assumptions like that.  It is as much
the fault of the user as the maintainer -- the point is to try and avoid
issues that are hard to debug and handle a situation like that gracefully.

>> Related question, do you work on dash or why do you install it using
>> package-vc?
>
> I forgot the reason for (package-vc-install 'dash).  Originally the
> process of finding this problem: I have been using
> https://github.com/nix-community/emacs-overlay for installing packages,
> so they come as part of non -Q emacs, many from MELPA and are
> date-versioned.
>
> After installing a package (not dash) using package-vc for contributing,
> I found out that in package-quickstart generation & package-alist, nix
> emacs-overlay version took precedence over package-vc one because
> package-process-define-package prefers "newer" versions.  After
> manipulating package-alist to prioritize vc packages over their (M)ELPA
> counterparts, startup entered infinite recursion that vc dash was a
> culprit.

I see, thanks for the explanation.

> As a related feature request, may package-process-define-package also be
> modified so that vc version is preferred?  I think it is sensible as
> someone who uses vc for a package also wants it to be loaded rather than
> tarball version.
>
> diff --git a/lisp/emacs-lisp/package-activate.el b/lisp/emacs-lisp/package-activate.el
> index 823ce88dcd4..53ce6845b8c 100644
> --- a/lisp/emacs-lisp/package-activate.el
> +++ b/lisp/emacs-lisp/package-activate.el
> @@ -238,11 +238,15 @@ are sorted with the highest version first."
>        (if (null old-pkgs)
>            ;; If there's no old package, just add this to `package-alist'.
>            (push (list name new-pkg-desc) package-alist)
> -        ;; If there is, insert the new package at the right place in the list.
> +        ;; If there is, insert the new package at the right place in the
> +        ;; list, prefer vc packages at front.
>          (while
>              (if (and (cdr old-pkgs)
> -                     (version-list-< version
> -                                     (package-desc-version (cadr old-pkgs))))
> +                     (not (member (package-desc-kind new-pkg-desc) '(vc)))
> +                     (or
> +                      (version-list-< version
> +                                      (package-desc-version (cadr old-pkgs)))
> +                      (member (package-desc-kind (cadr pkg-pkgs)) '(vc))))
>                  (setq old-pkgs (cdr old-pkgs))
>                (push new-pkg-desc (cdr old-pkgs))
>                nil)))
>
> The above became a mess, or replace the whole 'while' block with?:
>
> (setf (cdr old-pkgs)
>       (sort (cons new-pkg-desc (cdr old-pkgs))
>             :lessp
>             (lambda (desc-a desc-b)
>               (if (equal
>                    (package-desc-kind desc-a)
>                    (package-desc-kind desc-b))
>                   (version-list-<
>                    (package-desc-version desc-a)
>                    (package-desc-version desc-b))
>                 (member (package-desc-kind desc-a) '(vc))))))

Hmm, for some reason I misremembered that something like this should
already be the case?  My suggestion would be to modify
`package--get-activatable-pkg' instead.  I am not sure the order of
packages in the alist values is actually documented to specify a
priority of what packages to load, as the docstring referrers to
`package-load-list'.




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

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


Received: (at 81908) by debbugs.gnu.org; 23 Sep 2026 07:36:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 23 03:36:33 2026
Received: from localhost ([127.0.0.1]:48115 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1x9HWp-00050Z-J5
	for submit <at> debbugs.gnu.org; Wed, 23 Sep 2026 03:36:32 -0400
Received: from mail-4325.protonmail.ch ([185.70.43.25]:30939)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <daanturo@HIDDEN>)
 id 1x9HWk-0004yc-JK
 for 81908 <at> debbugs.gnu.org; Wed, 23 Sep 2026 03:36:29 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me;
 s=protonmail; t=1790148979; x=1790408179;
 bh=xaL0/regRb/elPEeWwCY3dQ0GfDNU8KCn7bYR99SPys=;
 h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References:
 Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID:
 Message-ID:BIMI-Selector;
 b=NggkL89PmKg3C06qvrVidFToo2PrnLqYFJ1vhZLE2EeTItMmIzc7Fj/HYE2PpsGju
 t3aR3z6y8N87enqD+K/xOFhHHgi1YbVve0JeFPygaAFlX3GUoLJWtAqKZ+PFh62At5
 dXjW0QofBlQYZkqoEzX0dZ30STll1FoyzfCBJV7vgxrCGGIJeg8m1QUJdNit7fBx7c
 D3FmmtfgBpHYLtM8Zvrd/uYjLT4bVYURnR+WDhOmHJ+tSQdJSaVc4eXQE6cuC/nz5E
 hfUbQr/YYe6xElTrWt+2mhAzbXyEeuCV/CZW8WogDeA10aCpZIsaTrvuIM2lySWpov
 JSPa8i0NMZI4w==
Date: Wed, 23 Sep 2026 07:36:16 +0000
To: Philip Kaludercic <philipk@HIDDEN>
From: Dan <daanturo@HIDDEN>
Subject: Re: bug#81908: 31.1;
 Circular dependency: package-vc on a mono-repo package such as dash.el
Message-ID: <wY1jVWIVHeEbm8dMN8sX5sFvmzCQgFY5fW8_GO-RKQZ9y5WRHLqd4aMISF5jAgtfilOSlDfhR3EJH4gqpCMTu2w-R4iXn57anI5zetm5qrQ=@proton.me>
In-Reply-To: <87bj9pqj8v.fsf@HIDDEN>
References: <oTqlp8kKMCh7bahcziVIQCtTAHRD-O9D3IL80JvzXR8qx-HUjFVx5Q-V5nTvUPUdJZfMIjD4XH7ngdiB2OS7GWa6kGZfaqo_14uSGwqaYwo=@proton.me>
 <87pky5eahg.fsf@HIDDEN> <87bj9pqj8v.fsf@HIDDEN>
Feedback-ID: 101171749:user:proton
X-Pm-Message-ID: 2a7dfb8950450f42b63ea8312d146b691c6cd072
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 81908
Cc: 81908 <at> debbugs.gnu.org, Sean Whitton <spwhitton@HIDDEN>
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.7 (-)


> Nevertheless, this patch seems to fix the specific problem for me:

Awesome, I thought of swiper (redundant installs of ivy+swiper) and this
should fix for it, too.

> Note that it ignores versioning, it doesn't check if the file it found
> is actually related to the package in a package archive (can be an issue
> for packages that are not part of any archive) and doesn't work if the
> name of the package doesn't match any of the files.  So if anything,
> I think we should allow either to disable this check or require to
> enable it.

If a dependency isn't in any package archives, shouldn't the maintainer
be responsible for informing their users anyway?  Admittedly potentially
troublesome fix, but I can't recall/think of a plausible case where a
package provides a file.el whose base name is exactly among its
dependencies without messing up in load-path priorities.  Perhaps let's
just add the fix as-is, then consider an option when someone does a bug
report?

> Related question, do you work on dash or why do you install it using
> package-vc?

I forgot the reason for (package-vc-install 'dash).  Originally the
process of finding this problem: I have been using
https://github.com/nix-community/emacs-overlay for installing packages,
so they come as part of non -Q emacs, many from MELPA and are
date-versioned.

After installing a package (not dash) using package-vc for contributing,
I found out that in package-quickstart generation & package-alist, nix
emacs-overlay version took precedence over package-vc one because
package-process-define-package prefers "newer" versions.  After
manipulating package-alist to prioritize vc packages over their (M)ELPA
counterparts, startup entered infinite recursion that vc dash was a
culprit.


As a related feature request, may package-process-define-package also be
modified so that vc version is preferred?  I think it is sensible as
someone who uses vc for a package also wants it to be loaded rather than
tarball version.


diff --git a/lisp/emacs-lisp/package-activate.el b/lisp/emacs-lisp/package-=
activate.el
index 823ce88dcd4..53ce6845b8c 100644
--- a/lisp/emacs-lisp/package-activate.el
+++ b/lisp/emacs-lisp/package-activate.el
@@ -238,11 +238,15 @@ are sorted with the highest version first."
       (if (null old-pkgs)
           ;; If there's no old package, just add this to `package-alist'.
           (push (list name new-pkg-desc) package-alist)
-        ;; If there is, insert the new package at the right place in the l=
ist.
+        ;; If there is, insert the new package at the right place in the
+        ;; list, prefer vc packages at front.
         (while
             (if (and (cdr old-pkgs)
-                     (version-list-< version
-                                     (package-desc-version (cadr old-pkgs)=
)))
+                     (not (member (package-desc-kind new-pkg-desc) '(vc)))
+                     (or
+                      (version-list-< version
+                                      (package-desc-version (cadr old-pkgs=
)))
+                      (member (package-desc-kind (cadr pkg-pkgs)) '(vc))))
                 (setq old-pkgs (cdr old-pkgs))
               (push new-pkg-desc (cdr old-pkgs))
               nil)))


The above became a mess, or replace the whole 'while' block with?:

(setf (cdr old-pkgs)
      (sort (cons new-pkg-desc (cdr old-pkgs))
            :lessp
            (lambda (desc-a desc-b)
              (if (equal
                   (package-desc-kind desc-a)
                   (package-desc-kind desc-b))
                  (version-list-<
                   (package-desc-version desc-a)
                   (package-desc-version desc-b))
                (member (package-desc-kind desc-a) '(vc))))))


----Dan.






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

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


Received: (at 81908) by debbugs.gnu.org; 22 Sep 2026 17:38:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 22 13:38:40 2026
Received: from localhost ([127.0.0.1]:44621 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1x94Rx-0004Ot-Hi
	for submit <at> debbugs.gnu.org; Tue, 22 Sep 2026 13:38:40 -0400
Received: from mout02.posteo.de ([185.67.36.66]:49935)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <philipk@HIDDEN>)
 id 1x94Rt-0004No-Jd
 for 81908 <at> debbugs.gnu.org; Tue, 22 Sep 2026 13:38:35 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 4FB6D240101
 for <81908 <at> debbugs.gnu.org>; Tue, 22 Sep 2026 19:38:27 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=posteo.net;
 s=1984.8680eb; t=1790098707;
 bh=YDvD004dDEWmy3PTf9KUXQrmkrNcZ4X89iRUyUeFc8U=;
 h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version:
 Content-Type:From;
 b=PGV58ttmaNo/CVpCek+XFtS8yDd8KFpqATB4DnDcZOgX8qgN//yi67m7IcyHtmjDV
 4kxuK6qqIpurNvxq+iU9gJIL1qc7tYJmp3tGXxd/AJXsm4zDlRmk1ndaVJhf6ceX4T
 eKjhAedfplpVW8GLb5UoQ6kOEHNF/DIIBrWlo3KKFJZTLRz8J0SRl3w7nGRJdrTBEB
 fF+kKi5NilELuS9WY/FCLkh2sgw45VatI4D4r7X6wE8RfEA1TVEPHnT8cpk69NGIIr
 780pMvraMSxfxTw6vMNemuyjB8WINlpOTSQBo0nhPKuoqMQU+nVRZeJZs+lyyjiNoz
 3Xsuy8FXZxNnw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4hq6l64MHNz9rxP;
 Tue, 22 Sep 2026 19:38:26 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: Sean Whitton <spwhitton@HIDDEN>
Subject: Re: bug#81908: 31.1; Circular dependency: package-vc on a mono-repo
 package such as dash.el
In-Reply-To: <87pky5eahg.fsf@HIDDEN>
References: <oTqlp8kKMCh7bahcziVIQCtTAHRD-O9D3IL80JvzXR8qx-HUjFVx5Q-V5nTvUPUdJZfMIjD4XH7ngdiB2OS7GWa6kGZfaqo_14uSGwqaYwo=@proton.me>
 <87pky5eahg.fsf@HIDDEN>
OpenPGP: id=philipk@HIDDEN;
 url="https://keys.openpgp.org/vks/v1/by-email/philipk@HIDDEN";
 preference=signencrypt
Date: Tue, 22 Sep 2026 17:38:27 +0000
Message-ID: <87bj9pqj8v.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 81908
Cc: Dan <daanturo@HIDDEN>, 81908 <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; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Sean Whitton <spwhitton@HIDDEN> writes:

> Dan via "Bug reports for GNU Emacs, the Swiss army knife of text editors"=
 [22/Sep 11:11am GMT] wrote:
>> (Also reported at https://github.com/magnars/dash.el/issues/421)
>>
>> Reproduction from 'emacs -Q':
>> - M-x package-vc-install dash

Related question, do you work on dash or why do you install it using
package-vc?

>> The operation also installs non-vc dash in addition to vc dash.
>> package-alist will also have the non-vc version in front.
>>
>> dash.el repo also includes dash-functional.el, who requires (dash
>> "2.18.0").  Hence package-vc installs dash from ELPA.
>>
>> ((dash
>>   #s(package-desc
>>      :name dash
>>      :version (2 20 0)
>>      :summary "A modern list library for Emacs"
>>      :reqs ((emacs (24)))
>>      :kind nil
>>      :archive nil
>>      :dir "~/temp/emacs-dash-infinite-loop/elpa/dash-2.20.0"
>>      ;; ...
>>      )
>>   #s(package-desc
>>      :name dash
>>      :version (2 20 0)
>>      :summary "A modern list library for Emacs"
>>      :reqs ((emacs (24)) (dash (2 18 0)))
>>      :kind vc
>>      :archive nil
>>      :dir "~/temp/emacs-dash-infinite-loop/elpa/dash"
>>      ;; ...
>>      )))
>>
>> If I try to manipulate package-alist by putting vc before in the dash
>> entry, Emacs will enter an infinite loop (Lisp nesting exceeds
>> =E2=80=98max-lisp-eval-depth=E2=80=99) because package-activate tries to=
 activate a
>> package's dependencies first, but vc dash depends on itself,...
>>
>> From package-vc's side, I think this problem can be solved for other
>> potential similarly split packages by ignoring dependencies that are
>> exactly themselves (don't even add to :reqs).

Yes, that sounds like it could be reasonable.  Generally, I think we are
not big fans of developing multiple packages on a single branch (I think
most packages could still keep the mono-repo approach if they use git
worktrees?), because I can imagine you could run into a lot of
complications related to this.

Nevertheless, this patch seems to fix the specific problem for me:


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline

diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index bd8203a76f3..08846ec32e1 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -541,7 +541,7 @@ package-vc--unpack-1
                 (plist-get pkg-spec :ignored-files)
                 "\\|")
              regexp-unmatchable))
-          (deps '()))
+          (deps '()) (supplied '()))
       (dolist (file (directory-files lisp-dir t "\\.el\\'" t))
         (unless (string-match-p ignored-files file)
           (with-temp-buffer
@@ -552,9 +552,17 @@ package-vc--unpack-1
                 package-read-from-string
                 lm--prepare-package-dependencies
                 (nconc deps)
-                (setq deps))))))
+                (setq deps)))
+            (when (lm-version)
+              ;; Heuristic to address bug#81908: If another file in the
+              ;; checkout matches the name of a dependency, remember
+              ;; this to avoid downloading a tarball later.
+              (push (file-name-base file) supplied)))))
       (dolist (dep deps)
         (cl-callf version-to-list (cadr dep)))
+      (setq deps (seq-difference deps supplied
+                                 (lambda (file pkg)
+                                   (string= (car pkg) file))))
       (setf (package-desc-reqs pkg-desc) deps)
       (setf missing (package-vc-install-dependencies (delete-dups deps)))
       (setf missing (delq (assq (package-desc-name pkg-desc)

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


Note that it ignores versioning, it doesn't check if the file it found
is actually related to the package in a package archive (can be an issue
for packages that are not part of any archive) and doesn't work if the
name of the package doesn't match any of the files.  So if anything,
I think we should allow either to disable this check or require to
enable it.

> Thanks, adding Philip.

--=-=-=--




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

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


Received: (at 81908) by debbugs.gnu.org; 22 Sep 2026 12:28:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 22 08:28:40 2026
Received: from localhost ([127.0.0.1]:50887 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1x8zbz-0007by-FR
	for submit <at> debbugs.gnu.org; Tue, 22 Sep 2026 08:28:40 -0400
Received: from fout-b1-smtp.messagingengine.com ([202.12.124.144]:36153)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <spwhitton@HIDDEN>)
 id 1x8zbv-0007aJ-87
 for 81908 <at> debbugs.gnu.org; Tue, 22 Sep 2026 08:28:37 -0400
Received: from phl-compute-08.internal (phl-compute-08.internal [10.202.2.48])
 by mailfout.stl.internal (Postfix) with ESMTP id 2558D1D00024;
 Tue, 22 Sep 2026 08:28:29 -0400 (EDT)
Received: from phl-frontend-03 ([10.202.2.162])
 by phl-compute-08.internal (MEProxy); Tue, 22 Sep 2026 08:28:29 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name;
 h=cc:content-transfer-encoding:content-type:content-type:date
 :date:from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to; s=fm3; t=1790080109;
 x=1790166509; bh=jqdizkQvVfOt3w2tMv8LneNZ4U1ByQ7F/9wVt5XaVb8=; b=
 aQ9zre5bxONAzJMUWnzE0dXN0MZuC/qzOIpTYhtECQwPrJStwzUWGrbrr5noMGZ8
 mb82ZYMFO9Cmjlsih9t8KEaPXpXRBjMdMMUmODh0rTgbPZK9fNzRw2kfuC7aKNVg
 vePpaC8J2eG4FsR2ScyYINAk8o52ItVoIynunmOfp+xC1siMtjxAO54C1CREuWf3
 3uFR7fZ32wNmJFuzu9UK5f1EROhqXcy6/HT4bjiPqFycO2F4mSYGX1gYM2vW5Dp6
 9fy0hxNf17vxcEgAIziXpCPbYCs3QkE2TRmx/zkSohuiAdgnG2WFiYpRCKWJ1cxA
 l8wLuWSyVtPlRXEEXl3bWA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:content-type
 :content-type:date:date:feedback-id:feedback-id:from:from
 :in-reply-to:in-reply-to:message-id:mime-version:references
 :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender
 :x-me-sender:x-sasl-enc; s=fm1; t=1790080109; x=1790166509; bh=j
 qdizkQvVfOt3w2tMv8LneNZ4U1ByQ7F/9wVt5XaVb8=; b=S8midyt9c6s2FunjZ
 kpAHPXe5lS3w7uaKfjoilhhMQhriHt6EeGjHxSFmHCYPGQuEy/VjVKda+/elPqUU
 jK0iZ0ZqNf2R+x0ABcrYafy+N6WV3mkpskXidqSOgGXPo0cQTNRLVEbaWpRdOUko
 dR01SgAgPu7x2ZIKH71Qi0JZpjSLCNs2pn0ezeHZp+Tv0jpSMWTlln1Fa9B0aWNR
 oB+b5EVPMiRNCH6XQKpWFtXCjSLipxHINFLIbaDfiAuFnHcrX5t/1Dq+lGotNRmi
 LbOHh1pOXh/gAEA3xFmCWCPq1/Rjuw0zH7H+mM4ojQKs36oCbCo7Q4K9A7WdYGzf
 lr3hg==
X-ME-Sender: <xms:bHSyaonkMZv5aoYfgW_cXzRyjHOItD-AnAeWXN4b5K3t1tE-yMBZhg>
 <xme:bHSyavRbrxXSyKs3A6tI2pzahMU8TNKAx4E1cEe81qGLhOSrv9osuR84YhMSojlC1
 8_vnS0srYnGGtKoCk0XKYc7he7KVFeLoi1GMuJecN23okZ2jbTzY14Q>
X-ME-Received: <xmr:bHSyakBntVnUV-6Tvq_n3z0j4OwCHLel5R7MqPE9KS57SQE5EagCm7J-F82Qk63C3thhG4XnD3p2vZI-yMPt_jNUXnKk1jCqsQ>
X-ME-Proxy-Cause: dmFkZTFoNsujU/wI25/P1AZz5sv8dwBVbkESBLGLKMSdosZvAi/SPU3o74K528RHKJmgcY
 S1s9Yk0hXDN8+cgVjaP6KTdGC8PbDvEhT/oDQxrMQ/I6tkjUWSfTLN0g/hKgc/y9jDnsNH
 60ADO33c+K/GQKfinYNKkC0bnvozmX4U1ldyFTnSUjvKLcEMsz0+RI6Jb1kPm8g8CXFhIb
 YGXt/LfbJxqe+2/9vclB0DsA+nG3A9hfMHHDBzvieS2dpsEpgYrnjPcxnWzjMtYpnsetS7
 uoLD8cECQ4BryWcDizgfcb/3L9r4/S5hXsb9XD5c8RXoxBwbMc/qAzwTu6QIrBUZ5DEvty
 1E3ZxAFW3oMfSqnh4WVQI5/rnhNF1y6dry2NUFkAjl3/YDm/0TRjBUabPsDB1ADyPS3SpH
 qu3y1PvNeTM1D/cS5RSJ6/iWMrvXd9Mn48227QaB8zJTXgqhLuLvLKLyG7Ue3H06axseQ5
 vIC7TWUf9PTsjOZBgt/3Kho9iHLq8yJQRiws0jk8g6cg0f4A/xffa2kyZjWVAzjP1geXCc
 RVZEvfkJIND684/x8SBQ8LMWoUJsIA/TFIZx4uavA4Bt4W4uqAIg3P8jElbDzP15PJgavf
 1irhO7HN9lwnxDAMzlFP5tU7BK9Y/GBtxuUnH/tfLV+ebTrFMLzXHTvwHaVg
X-ME-Proxy: <xmx:bHSyauT5ysTuVwWDGEd6dkByQEQYX2pGaLkULt00Zw5d0s4bFheBnw>
 <xmx:bHSyaqq5gKey6X8tSbhC2fmJyfx39ERXmHTzyhTGF7uGw2ztV7StJw>
 <xmx:bHSyaoxK55cx39_eCE--twqKtyIgfLAYw-st2JnfD9BEUuGxDd6dxg>
 <xmx:bHSyanKPVwkKpNMh4Awj6SYKVDjF8LuhLX0cNtZSqO2s5BOUJRK_0g>
 <xmx:bXSyap3y-swQq-9etUqCChq16bgc2O1LnMtdraUsx8hy90K6PIBeWj8w>
Feedback-ID: i62564b17:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue,
 22 Sep 2026 08:28:28 -0400 (EDT)
Received: by athena.silentflame.com (Postfix, from userid 1000)
 id DD6BA282ADE; Tue, 22 Sep 2026 13:28:27 +0100 (BST)
From: Sean Whitton <spwhitton@HIDDEN>
To: Dan <daanturo@HIDDEN>, 81908 <at> debbugs.gnu.org, Philip Kaludercic
 <philipk@HIDDEN>
Subject: Re: bug#81908: 31.1; Circular dependency: package-vc on a mono-repo
 package such as dash.el
In-Reply-To: <oTqlp8kKMCh7bahcziVIQCtTAHRD-O9D3IL80JvzXR8qx-HUjFVx5Q-V5nTvUPUdJZfMIjD4XH7ngdiB2OS7GWa6kGZfaqo_14uSGwqaYwo=@proton.me>
References: <oTqlp8kKMCh7bahcziVIQCtTAHRD-O9D3IL80JvzXR8qx-HUjFVx5Q-V5nTvUPUdJZfMIjD4XH7ngdiB2OS7GWa6kGZfaqo_14uSGwqaYwo=@proton.me>
Date: Tue, 22 Sep 2026 13:28:27 +0100
Message-ID: <87pky5eahg.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 81908
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 (-)

Dan via "Bug reports for GNU Emacs, the Swiss army knife of text editors" [=
22/Sep 11:11am GMT] wrote:
> (Also reported at https://github.com/magnars/dash.el/issues/421)
>
> Reproduction from 'emacs -Q':
> - M-x package-vc-install dash
>
> The operation also installs non-vc dash in addition to vc dash.
> package-alist will also have the non-vc version in front.
>
> dash.el repo also includes dash-functional.el, who requires (dash
> "2.18.0").  Hence package-vc installs dash from ELPA.
>
> ((dash
>   #s(package-desc
>      :name dash
>      :version (2 20 0)
>      :summary "A modern list library for Emacs"
>      :reqs ((emacs (24)))
>      :kind nil
>      :archive nil
>      :dir "~/temp/emacs-dash-infinite-loop/elpa/dash-2.20.0"
>      ;; ...
>      )
>   #s(package-desc
>      :name dash
>      :version (2 20 0)
>      :summary "A modern list library for Emacs"
>      :reqs ((emacs (24)) (dash (2 18 0)))
>      :kind vc
>      :archive nil
>      :dir "~/temp/emacs-dash-infinite-loop/elpa/dash"
>      ;; ...
>      )))
>
> If I try to manipulate package-alist by putting vc before in the dash
> entry, Emacs will enter an infinite loop (Lisp nesting exceeds
> =E2=80=98max-lisp-eval-depth=E2=80=99) because package-activate tries to =
activate a
> package's dependencies first, but vc dash depends on itself,...
>
> From package-vc's side, I think this problem can be solved for other
> potential similarly split packages by ignoring dependencies that are
> exactly themselves (don't even add to :reqs).

Thanks, adding Philip.

--=20
Sean Whitton




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

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


Received: (at submit) by debbugs.gnu.org; 22 Sep 2026 11:11:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 22 07:11:59 2026
Received: from localhost ([127.0.0.1]:55612 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1x8yPm-0000Sr-6X
	for submit <at> debbugs.gnu.org; Tue, 22 Sep 2026 07:11:59 -0400
Received: from lists1p.gnu.org ([2001:470:142::17]:43886)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <daanturo@HIDDEN>)
 id 1x8yPg-0000RW-K5
 for submit <at> debbugs.gnu.org; Tue, 22 Sep 2026 07:11:56 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <daanturo@HIDDEN>)
 id 1x8yPa-0001vs-7Q
 for bug-gnu-emacs@HIDDEN; Tue, 22 Sep 2026 07:11:46 -0400
Received: from mail-08.mail-europe.com ([57.129.93.249])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <daanturo@HIDDEN>)
 id 1x8yPW-0006jv-37
 for bug-gnu-emacs@HIDDEN; Tue, 22 Sep 2026 07:11:45 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me;
 s=protonmail; t=1790075488; x=1790334688;
 bh=yvsu95gSGmvDNm0ZUE4Bq12DZGLzaP/hneai+swui7A=;
 h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date:
 Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector;
 b=hMdvwTBiz2EsFhMQYOzWw1zNtiZBSiwyMxgW6YgFwpoGebvie+ZCMPZZwPRXmfudW
 3PhknqzuuTtK//4yBmQMbFCdaQ+e+auklMqhwCDJRzMBDVIUJQ2mmqDI578Xu8ccvP
 7QRuPlF+lDkpu1oG+FTr4VKC2lN8HBIgi+oBcm+TwYWEZ0mALTmgMnZulMSjKZRwBn
 tnji5pTHh/Hwo3wUMYPYJ/4LivZ8RKZFSd18WyKy3kFY5cY7mVJbIxOB0wvJ/NcPs7
 pdThZs9pKkBalRzRV2K0e0nfLuryzypig6Fy4dRsLsR3VD0CCyLn50AwSndGFXdrgo
 HO2SSDU0oWN9g==
Date: Tue, 22 Sep 2026 11:11:23 +0000
To: "bug-gnu-emacs@HIDDEN" <bug-gnu-emacs@HIDDEN>
From: Dan <daanturo@HIDDEN>
Subject: 31.1; Circular dependency: package-vc on a mono-repo package such as
 dash.el
Message-ID: <oTqlp8kKMCh7bahcziVIQCtTAHRD-O9D3IL80JvzXR8qx-HUjFVx5Q-V5nTvUPUdJZfMIjD4XH7ngdiB2OS7GWa6kGZfaqo_14uSGwqaYwo=@proton.me>
Feedback-ID: 101171749:user:proton
X-Pm-Message-ID: bec50085bcb0cb6fbc586378557823a056aaf3c6
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=57.129.93.249; envelope-from=daanturo@HIDDEN;
 helo=mail-08.mail-europe.com
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.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,
 RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
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: -0.0 (/)


(Also reported at https://github.com/magnars/dash.el/issues/421)

Reproduction from 'emacs -Q':
- M-x package-vc-install dash

The operation also installs non-vc dash in addition to vc dash.
package-alist will also have the non-vc version in front.

dash.el repo also includes dash-functional.el, who requires (dash
"2.18.0").  Hence package-vc installs dash from ELPA.

((dash
  #s(package-desc
     :name dash
     :version (2 20 0)
     :summary "A modern list library for Emacs"
     :reqs ((emacs (24)))
     :kind nil
     :archive nil
     :dir "~/temp/emacs-dash-infinite-loop/elpa/dash-2.20.0"
     ;; ...
     )
  #s(package-desc
     :name dash
     :version (2 20 0)
     :summary "A modern list library for Emacs"
     :reqs ((emacs (24)) (dash (2 18 0)))
     :kind vc
     :archive nil
     :dir "~/temp/emacs-dash-infinite-loop/elpa/dash"
     ;; ...
     )))

If I try to manipulate package-alist by putting vc before in the dash
entry, Emacs will enter an infinite loop (Lisp nesting exceeds
=E2=80=98max-lisp-eval-depth=E2=80=99) because package-activate tries to ac=
tivate a
package's dependencies first, but vc dash depends on itself,...

From package-vc's side, I think this problem can be solved for other
potential similarly split packages by ignoring dependencies that are
exactly themselves (don't even add to :reqs).


Subject: [PATCH] package-vc: prevent vc packages from depending on themselv=
es

* lisp/emacs-lisp/package-vc.el (package-vc--unpack-1): ensure that a
package's dependency list doesn't contain itself
---
 lisp/emacs-lisp/package-vc.el | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index bd8203a76f3..998a51dc56b 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -553,6 +553,12 @@ building documentation and marking the package as inst=
alled."
                 lm--prepare-package-dependencies
                 (nconc deps)
                 (setq deps))))))
+      ;; especially for split packages, don't depend on themselves
+      (setq deps
+            (cl-remove-if
+             (lambda (dep)
+               (member (car dep) (list (package-desc-name pkg-desc))))
+             deps))
       (dolist (dep deps)
         (cl-callf version-to-list (cadr dep)))
       (setf (package-desc-reqs pkg-desc) deps)
--=20



---
Dan.







Acknowledgement sent to Dan <daanturo@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#81908; 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: Sat, 3 Oct 2026 11:30:09 UTC

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