From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic 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 14:24:12 +0000 Message-ID: <87v8g3mhkj.fsf@posteo.net> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7584"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 63757@debbugs.gnu.org, monnier@iro.umontreal.ca 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 16:25:24 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 1q5ofc-0001kV-4c for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 04 Jun 2023 16:25:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q5ofI-0000pW-NQ; Sun, 04 Jun 2023 10:25:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q5ofG-0000p3-J2 for bug-gnu-emacs@gnu.org; Sun, 04 Jun 2023 10:25: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 1q5ofG-0002TB-97 for bug-gnu-emacs@gnu.org; Sun, 04 Jun 2023 10:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q5ofF-0003In-Qp for bug-gnu-emacs@gnu.org; Sun, 04 Jun 2023 10:25:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Jun 2023 14:25: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.168588866312636 (code B ref 63757); Sun, 04 Jun 2023 14:25:01 +0000 Original-Received: (at 63757) by debbugs.gnu.org; 4 Jun 2023 14:24:23 +0000 Original-Received: from localhost ([127.0.0.1]:46835 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5oed-0003Hk-4L for submit@debbugs.gnu.org; Sun, 04 Jun 2023 10:24:23 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:60119) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5oea-0003HV-94 for 63757@debbugs.gnu.org; Sun, 04 Jun 2023 10:24:21 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 0D90B240103 for <63757@debbugs.gnu.org>; Sun, 4 Jun 2023 16:24:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1685888654; bh=n4hViH501KXuhsf4xxNBrnhwZi+RLlOQavm6jUP8NCk=; h=From:To:Cc:Subject:Autocrypt:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=DAe966oCJVIpCnTwxZ8XKqdPIS5aaEf2UWFTjxAw/0LuevJKeDzHxgAHZQIfKlSPt SYcLIVQWZpj8BEZa6koEiQi12Df63NciOGUJzorO1OFI62O1Gea4YUQKVrzK4OBt8R P+HDI0wgdHcTGkitB5QvL2f61wnRI3Jw7VvJ52YMOCG3IBKD+6kCmHR7L8OmwSSe9k wqttU8uc8PeK0N42BlRKhrNieBmTEmHypTiri8Oe0AyCZ35q3CV8WUHXWCvbkNR/Fn s3hitBNcFnKLFZiU8v5gCZoyx4Xjc08aKwFpq7OFWGhtf9Jg0Cst4K67YXEro1iFOP dJSPJ7lNbq3Tg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QYzWd0tnVz6tvx; Sun, 4 Jun 2023 16:24:13 +0200 (CEST) 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") Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM 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:262954 Archived-At: =D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9 =D0=91=D0=BE=D0=B9=D0=BA=D0=BE= =D0=B2 writes: >> Done. Should we close the issue then, or wait for more feedback? > > fa8135f8916 * emacs-29 origin/emacs-29 Revert changes to the order in whi= ch > package descs are loaded > - (dolist (pkg-dir (directory-files dir t "\\`[^.]" t)) > + (dolist (pkg-dir (directory-files dir t "\\`[^.]")) > > it doesn't fix the initial problem: `load-path` and `package-alist` are > still broken in my test. What does "broken" mean in this case? I fear that your patch just changes what is necessary to resolve the issue in your case, but the underlying problem (the destructive modification of `package-list') still persists? > Test: > To reproduce the case we need emacs 29.0.91 + fa8135f8916 fix and > ~/.emacs.d/elpa/go-mode-20170726.555/... > ~/.emacs.d/elpa/go-mode-20220114.2239/... > Run `emacs -Q` and `M-x package-initialize`. After that `package-alist` a= nd > `load-path` contain the 2017 version as the first item in the list (inste= ad > of 2022). > > 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 > > But if we leave it until 29.2, I will not insist :) > > > On Sun, Jun 4, 2023 at 11:21=E2=80=AFPM Philip Kaludercic > wrote: > >> Eli Zaretskii writes: >> >> >> From: Philip Kaludercic >> >> Cc: artscan@list.ru, monnier@iro.umontreal.ca, 63757@debbugs.gnu.org >> >> Date: Sun, 04 Jun 2023 12:32:17 +0000 >> >> >> >> Eli Zaretskii writes: >> >> >> >> >> - (dolist (pkg-dir (directory-files dir t "\\`[^.]" t)) >> >> >> + (dolist (pkg-dir (directory-files dir t "\\`[^.]")) >> >> >> (when (file-directory-p pkg-dir) >> >> >> (package-load-descriptor pkg-dir)))))) >> >> >> >> >> >> (I attached the *vc-diff* buffer, but before sending the message I >> >> >> invoked vc-diff again which modified the buffer contents. Should >> have >> >> >> just copied the diff manually...) >> >> > >> >> > Thanks, now it at least makes sense. >> >> > >> >> > But why does it matter whether the package directory names are sort= ed >> >> > or not? Is sorting package versions the same as sorting the names = of >> >> > their directories? >> >> >> >> No, because directories are sorted by their names and by that metric, >> >> "foo-10" is less than "foo-9". But since package archives like MELPA >> >> use ISO 8601-like release-dates as version numbers, the order "works". >> >> If we disable sorting, the files returned in any order the operating >> >> system might have arbitrary stored the directory entries in which mig= ht >> >> even change depending on the file system. So at the very least we can >> >> argue that while sorting does not solve the issue, it provides a quick >> >> hack to prevent sudden breakage from Emacs 28 to Emacs 29, due to use= rs >> >> relying on this kind of behaviour. A proper solution, that takes >> >> version numbers into account should be prepared on the master branch. >> > >> > OK, thanks. Please install on emacs-29, and let's hope this doesn't >> > cause new problems. >> >> Done. Should we close the issue then, or wait for more feedback? >>