From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#63757: 29.0.91 order of package paths changed: random old versions of packages in load-path Date: Sun, 04 Jun 2023 11:12:31 -0400 Message-ID: References: <83y1l7gzqw.fsf@gnu.org> <87ilcb2p1l.fsf@posteo.net> <87sfb8g85v.fsf@posteo.net> <83a5xf7pi5.fsf@gnu.org> <87ttvnoehl.fsf@posteo.net> <8335377iyo.fsf@gnu.org> <87h6rnoa8v.fsf@posteo.net> <83v8g35ybo.fsf@gnu.org> <87cz2bo3qu.fsf@posteo.net> <83pm6b5t1i.fsf@gnu.org> <878rczo28v.fsf@posteo.net> <83o7lv5sjc.fsf@gnu.org> <874jnno1bi.fsf@posteo.net> <83mt1f5rab.fsf@gnu.org> <87zg5fmkgk.fsf@posteo.net> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32762"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Philip Kaludercic , 63757@debbugs.gnu.org, Eli Zaretskii To: =?UTF-8?Q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9_?= =?UTF-8?Q?=D0=91=D0=BE=D0=B9=D0=BA=D0=BE=D0=B2?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 04 17:13:19 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q5pPy-0008Mw-L3 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 04 Jun 2023 17:13:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q5pPj-0000M2-65; Sun, 04 Jun 2023 11:13:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q5pPi-0000Lq-9F for bug-gnu-emacs@gnu.org; Sun, 04 Jun 2023 11:13:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q5pPh-00069k-Vc for bug-gnu-emacs@gnu.org; Sun, 04 Jun 2023 11:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q5pPh-0004bJ-Og for bug-gnu-emacs@gnu.org; Sun, 04 Jun 2023 11:13:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Jun 2023 15:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63757 X-GNU-PR-Package: emacs Original-Received: via spool by 63757-submit@debbugs.gnu.org id=B63757.168589156117654 (code B ref 63757); Sun, 04 Jun 2023 15:13:01 +0000 Original-Received: (at 63757) by debbugs.gnu.org; 4 Jun 2023 15:12:41 +0000 Original-Received: from localhost ([127.0.0.1]:46912 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5pPN-0004ag-7D for submit@debbugs.gnu.org; Sun, 04 Jun 2023 11:12:41 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:46321) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5pPL-0004aT-2q for 63757@debbugs.gnu.org; Sun, 04 Jun 2023 11:12:39 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id CB4434409DE; Sun, 4 Jun 2023 11:12:33 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 7976C440536; Sun, 4 Jun 2023 11:12:32 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1685891552; bh=OnHmqziBmW2pU0P3izKqtgfOcohnYPUMtL5uBWzi+Ps=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=RlG6x5Ol8ZAlXJ6tAKCr5qSczw844ISbBTbMb4uPFrzhHN3sapuiZECdirt7VINEO 8FkpYelLTsItpaQ10iuwN/z0qXOkyzmVnLjLTXW9Dvvt3Po3/d15Hcb1iNS9zICP0D Lt78N54JHcdnfOTx4H3LxTzKOON+XVMWa1I4OQDHd/xwsHruWa71zMRYDt3UNdKoMZ UWnpvl4M48B5CLChAslkFRK6Qe9eW7j+E9ryKxgFA2zgV23MPNXxPTfPO7ctg1CBka tt0koPus7D71xu2s1mtTa7YAikG1aa9cN6I77ntevONqi62FtbvLC2En6OL4NPzS2i Cp9V2xY5HSQZA== Original-Received: from pastel (76-10-180-239.dsl.teksavvy.com [76.10.180.239]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 4A99D1204DC; Sun, 4 Jun 2023 11:12:32 -0400 (EDT) In-Reply-To: ("=?UTF-8?Q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9_?= =?UTF-8?Q?=D0=91=D0=BE=D0=B9=D0=BA=D0=BE=D0=B2?="'s message of "Mon, 5 Jun 2023 00:03:48 +1000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:262964 Archived-At: > It can be fixed like this: > > diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el > index ba0e3618f28..6eaf261f5f4 100644 > --- a/lisp/emacs-lisp/package.el > +++ b/lisp/emacs-lisp/package.el > @@ -922,11 +922,13 @@ correspond to previously loaded files." > (v2 (package-desc-version p2))) > (or > ;; Prefer VC packages. > - (package-vc-p p1) > - (package-vc-p p2) > + (and > + (package-vc-p p1) > + (not (package-vc-p p2))) > ;; Prefer builtin packages. > - (package-disabled-p p1 v1) > - (not (package-disabled-p p2 v2)))))))) > + (and > + (package-built-in-p p1 v1) > + (not (package-built-in-p p2 v2))))))))) > ;; Check if PACKAGE is available in `package-alist'. > (while > (when pkg-descs Sounds about right. Except: - We still need a `copy-sequence` to avoid `sort` side-effecting the `package-alist` contents. - I'm not sure the change of `package-disabled-p` => `package-built-in-p` is right: it makes the code obey the comment, but I don't think we want to prefer built-in packages. With these two tweaks, I suspect it might actually really fix the bug in a way that should be safe enough for `emacs-29`. Stefan