From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?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?= 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, 4 Jun 2023 17:52:57 +1000 Message-ID: References: <83y1l7gzqw.fsf@gnu.org> <87ilcb2p1l.fsf@posteo.net> <87sfb8g85v.fsf@posteo.net> <83a5xf7pi5.fsf@gnu.org> 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?= Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000bf40a205fd491307" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2180"; mail-complaints-to="usenet@ciao.gmane.io" Cc: philipk@posteo.net, 63757@debbugs.gnu.org, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 04 10:10:44 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 1q5ip1-0000Q9-Cf for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 04 Jun 2023 10:10:43 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q5ioV-0005Wa-Au; Sun, 04 Jun 2023 04:10:11 -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 1q5ioQ-0005VT-M7 for bug-gnu-emacs@gnu.org; Sun, 04 Jun 2023 04:10:06 -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 1q5ioQ-0007uv-Dd for bug-gnu-emacs@gnu.org; Sun, 04 Jun 2023 04:10:06 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q5ioQ-0001cV-8B for bug-gnu-emacs@gnu.org; Sun, 04 Jun 2023 04:10:06 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?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-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Jun 2023 08:10:06 +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.16858661796086 (code B ref 63757); Sun, 04 Jun 2023 08:10:06 +0000 Original-Received: (at 63757) by debbugs.gnu.org; 4 Jun 2023 08:09:39 +0000 Original-Received: from localhost ([127.0.0.1]:44864 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5iny-0001a0-MH for submit@debbugs.gnu.org; Sun, 04 Jun 2023 04:09:39 -0400 Original-Received: from smtp31.i.mail.ru ([95.163.41.72]:50774) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5iY8-000705-Lh for 63757@debbugs.gnu.org; Sun, 04 Jun 2023 03:53:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=list.ru; s=mail4; h=Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version:From:Subject:Content-Type:Content-Transfer-Encoding:To:Cc; bh=evgl2c1G34YXxo/OGt7wokCU5NIzpycQnmY+ngMECrA=; t=1685865196;x=1685955196; b=AJRTP5vkU/EwgvCI8tCdjXDp/6oy6hKPSfO91pC7dX/Ow11Hf+k6bq7hqESr/lpLkZwqv7ytL3VgiB0HRxwmUgonYuAUs6wj8wUxPN4da7ebSp5w8lCAWSimw6qF6Ew2FhpxAWcESFjl46JZLfZcTmXoxzIlFAexlA8M2avZQKopyW3d5l4lmbpC+u2LO9S0EHBq/9s5fFvCbCEQiaDV6glFqzUzNo9HAd+b7D0eJp14LXrTIrtVo/cboXIyHsZTG1fLHtdUnWf2chIh9LoseoV7zjEFlNsqMEsVOygYnOpamzKhIqmB3ohqBlF8OkF6Qc8Pfr5yOBSPRISv7JXqQQ==; Original-Received: by smtp31.i.mail.ru with esmtpa (envelope-from ) id 1q5iY1-00Ck8X-UR for 63757@debbugs.gnu.org; Sun, 04 Jun 2023 10:53:10 +0300 Original-Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-3f60e536250so34588355e9.1 for <63757@debbugs.gnu.org>; Sun, 04 Jun 2023 00:53:09 -0700 (PDT) X-Gm-Message-State: AC+VfDwBp5yz8i0HVHqbI/LEHQgI+ug2LbXnQJTxC1K45gtac7/1QeSC f4EBdxngtGzhzvu4S4txWoL8hzWwCxB2+PscrtQ= X-Google-Smtp-Source: ACHHUZ5m9ugffdteoLqgig0xHen0sj8ieI7N1K0dfG3+oqFQhRVtxjDFF8UJZlhpMlMDHmqmcqVR/bRMarKNQaMhsns= X-Received: by 2002:a5d:5915:0:b0:30a:e70d:8022 with SMTP id v21-20020a5d5915000000b0030ae70d8022mr3170107wrd.26.1685865189292; Sun, 04 Jun 2023 00:53:09 -0700 (PDT) In-Reply-To: <83a5xf7pi5.fsf@gnu.org> X-Gmail-Original-Message-ID: Authentication-Results: smtp31.i.mail.ru; auth=pass smtp.auth=artscan@list.ru smtp.mailfrom=artscan@list.ru X-Mailru-Src: smtp X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD988F25420CCA9469AC4C4DE6D3AF0D4F65E8FFE5E098C4BB3182A05F53808504061F6A975E0DE13B2367DE8EC09A7F5CA1D24B09D4FE8ACFEFCE06C3B1BA5C586 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7E50C24D7D7C3118AC2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE782A779A89F7D69B28F08D7030A58E5AD1A62830130A00468AEEEE3FBA3A834EE7353EFBB5533756623CF8930FFDAD90E0254D2766D32262942EB224651E9F6821DF9E95F17B0083B26EA987F6312C9EC1E561CDFBCA1751FF04B652EEC242312D2E47CDBA5A9658378DA827A17800CE70BDB714E04167E929FA2833FD35BB23DF004C90652538430302FCEF25BFAB3454AD6D5ED66289B5278DA827A17800CE771359D2E0B7A7F88D32BA5DBAC0009BE395957E7521B51C20BC6067A898B09E4090A508E0FED6299176DF2183F8FC7C042D756B78D1B4510CD04E86FAF290E2DB606B96278B59C421DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6300D3B61E77C8D3B089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A588D7D9E46B640FC9527EF430174C1A69BFA63935FED7E0C0F87CCE6106E1FC07E67D4AC08A07B9B06A1CB4668A9CA5FACB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF77DD89D51EBB7742D3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF34F54077B9DE610938EF5C6AB0F5B6EAA8AB9466D3AB09EF70CAFFD60D886B40711F655CCE117FA3F4BC53521BD43B012896707385E77140A412F9E077BF6FC8CAACD699CDC6F98202C26D483E81D6BE1362B2BFE906F14DEF4373B74A18CF49CC2E138FFB4ACBED X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojZIfw4O47JkIORhA6y9jMUw== X-Mailru-Sender: 4C235FE2E5D2D890FBEF37A2DB6DABE6E24F5B71E64468CE15DF78AF435920B93C7394056920479DA3C36B4D8423ABA5C77752E0C033A69EC36ED9D1848BBC3A06988B367FA93C37B4A721A3011E896F X-Mras: Ok X-Mailman-Approved-At: Sun, 04 Jun 2023 04:09:27 -0400 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:262913 Archived-At: --000000000000bf40a205fd491307 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sort didn't exist before fb87d500 - (let ((pkg-descs (cdr (assq pkg-name package-alist)))) + (let ((pkg-descs (sort (cdr (assq pkg-name package-alist)) We can fix incorrect sorting diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index ba0e3618f28..228d77b54e7 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -916,17 +916,18 @@ correspond to previously loaded files." (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 + ;; Prefer VC packages + (apply 'append + (cl-reduce + (lambda (p1 p2) + (if (package-vc-p p1) + (push p1 (cl-first p2)) + (push p1 (cl-second p2))) + p2) + (cdr (assq pkg-name package-alist)) + :initial-value (list nil nil) + :from-end t)))) ;; Check if PACKAGE is available in `package-alist'. (while (when pkg-descs or just revert fb87d500 On Sun, Jun 4, 2023 at 3:41=E2=80=AFPM Eli Zaretskii wrote: > > From: =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 > > Date: Sun, 4 Jun 2023 15:37:31 +1000 > > Cc: Philip Kaludercic , Eli Zaretskii , > 63757@debbugs.gnu.org > > > > Excuse me for extra messages, I've already found a bug in the previous > patch. > > I need a review, especially with in-place operations. > > > > move "Prefer VC packages" to `package-process-define-package` > > drop `package-disabled-p` and "Prefer builtin packages" comment > > Thanks, but I'm not really comfortable with such non-trivial changes > in package.el at this late stage of the pretest. > > Is this problem new in Emacs 29, or did it exist in Emacs 28 as well? > If it is new, which change(s) caused the incorrect ordering of > versions in Emacs 29? > --=20 __________________________ =D0=A1 =D1=83=D0=B2=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5=D0=BC, =D0=91=D0=BE=D0=B9=D0=BA=D0=BE=D0=B2 =D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8= =D0=B9 =D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B5=D0=B2=D0=B8=D1=87 =D1=81=D0=BE=D1=82. 8-924-202-25-65 e-mail: artscan@list.ru --000000000000bf40a205fd491307 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Sort didn't exist before fb87d500

- = =C2=A0(let ((pkg-descs (cdr (assq pkg-name package-alist))))
+ =C2=A0(le= t ((pkg-descs (sort (cdr (assq pkg-name package-alist))

We can fix = incorrect sorting

diff --git a/lisp/emacs-lisp/package.el b/lisp/em= acs-lisp/package.el
index ba0e3618f28..228d77b54e7 100644
--- a/lisp/= emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -916,17 +91= 6,18 @@ correspond to previously loaded files."
=C2=A0
=C2=A0(de= fun package--get-activatable-pkg (pkg-name)
=C2=A0 =C2=A0;; Is "act= ivatable" a word?
- =C2=A0(let ((pkg-descs (sort (cdr (assq pkg-nam= e package-alist))
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (lambda (p1 p2)
- =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (let = ((v1 (package-desc-version p1))
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (= v2 (package-desc-version p2)))
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (or
- =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0;; Prefer VC packages.
- =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(package-vc-p p1)
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(package-vc-p= p2)
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; Prefer builtin packages.
- = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(package-disabled-p p1 v1)
- =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0(not (package-disabled-p p2 v2))))))))
+ =C2=A0(let = ((pkg-descs
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; Prefer VC packages
+ =C2= =A0 =C2=A0 =C2=A0 =C2=A0 (apply 'append
+ =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(cl-reduce
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 (lambda (p1 p2)
+ =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (package-vc-p p1)
+ =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (push= p1 (cl-first p2))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 (push p1 (cl-second p2)))
+ =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 p2)
+ =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (cdr (assq pkg-name package-alist))
+ = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 :initial-value (lis= t nil nil)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 :fr= om-end t))))
=C2=A0 =C2=A0 =C2=A0;; Check if PACKAGE is available in `pa= ckage-alist'.
=C2=A0 =C2=A0 =C2=A0(while
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(when pkg-descs

or just revert fb87d500

On Sun, Jun 4= , 2023 at 3:41=E2=80=AFPM Eli Zaretskii <eliz@gnu.org> wrote:
> From: =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 <artscan@list.ru>
> Date: Sun, 4 Jun 2023 15:37:31 +1000
> Cc: Philip Kaludercic <philipk@posteo.net>, Eli Zaretskii <eliz@gnu.org>, 63757@debbugs.gnu.org
>
> Excuse me for extra messages, I've already found a bug in the prev= ious patch.
> I need a review, especially with in-place operations.
>
> move "Prefer VC packages" to `package-process-define-package= `
> drop `package-disabled-p` and "Prefer builtin packages" comm= ent

Thanks, but I'm not really comfortable with such non-trivial changes in package.el at this late stage of the pretest.

Is this problem new in Emacs 29, or did it exist in Emacs 28 as well?
If it is new, which change(s) caused the incorrect ordering of
versions in Emacs 29?


--
__________________________

=D0=A1 =D1=83=D0=B2=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5=D0=BC,
=D0=91=D0=BE=D0=B9=D0=BA=D0=BE=D0=B2 =D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8= =D0=B9 =D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B5=D0=B2=D0=B8=D1=87
=D1=81=D0=BE=D1=82. 8-924-202-25-65
e-mail: artscan@list.r= u
--000000000000bf40a205fd491307--