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: Mon, 05 Jun 2023 07:55:46 +0000 Message-ID: <87ttvmbawt.fsf@posteo.net> References: <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> <83a5xf5k65.fsf@gnu.org> <87cz2bxkz5.fsf@posteo.net> <87v8g3t6k4.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37798"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 63757@debbugs.gnu.org, artscan@list.ru To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 05 09:56:16 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 1q654X-0009az-Du for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 05 Jun 2023 09:56:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q654O-0003t1-UV; Mon, 05 Jun 2023 03:56: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 1q654M-0003rV-QA for bug-gnu-emacs@gnu.org; Mon, 05 Jun 2023 03:56: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 1q654M-0000XZ-GU for bug-gnu-emacs@gnu.org; Mon, 05 Jun 2023 03:56:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q654L-0001df-TL for bug-gnu-emacs@gnu.org; Mon, 05 Jun 2023 03:56: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: Mon, 05 Jun 2023 07:56: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.16859517576288 (code B ref 63757); Mon, 05 Jun 2023 07:56:01 +0000 Original-Received: (at 63757) by debbugs.gnu.org; 5 Jun 2023 07:55:57 +0000 Original-Received: from localhost ([127.0.0.1]:48004 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q654G-0001dM-RQ for submit@debbugs.gnu.org; Mon, 05 Jun 2023 03:55:57 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:34937) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q654E-0001d7-Et for 63757@debbugs.gnu.org; Mon, 05 Jun 2023 03:55:55 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 50854240028 for <63757@debbugs.gnu.org>; Mon, 5 Jun 2023 09:55:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1685951748; bh=nzHiTDI+GKP3s+U5t5DM8zg2S/6/EIGlZGO64DFzPN0=; h=From:To:Cc:Subject:Autocrypt:Date:Message-ID:MIME-Version:From; b=U00pBtUib2en7Jq9Pi1c+/as/FeqmgXxOeKpZ4P64C9r8zv1eopIcK4RhvvuTqH+F /Ahby4WujjmqFdj8ti/w/zI3TBuSX06Kihm/f9BqHCBLKcRDtmHBqA9xW2b9PjL2wc HC0c9XLEY/zKGnTKl3NxZDvZNu2VYqAwVgNUkVqa5Ve9S2csqJ515iuyI+WhOF2owN 3nATGUXKwN2j70/R6u5SSXFTEa9l0HkaHto1QiNmQMLct48KOprjoEBXHbPANBvQIg TOH218qqqbwIc/TV0e9EjHEPAEwxiD8jLCIO9b53ds83rcliTnaL3O4nVlPEmS4Iel MJ30gBG+fE0uw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QZQrz2HJCz6ty2; Mon, 5 Jun 2023 09:55:47 +0200 (CEST) In-Reply-To: (Stefan Monnier's message of "Sun, 04 Jun 2023 15:38:07 -0400") 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:262997 Archived-At: Stefan Monnier writes: >> Just to make sure I am not missing something in that case: >> package-load-all-descriptors reads package descriptors either in >> alphabetical order or in the order the operating system will list them >> in the elpa/ directory. Via package-load-descriptor, the descriptor >> expression is passed to the package-process-define-package, which will >> insert them into package-alist according to the version number. > > That's right. > >> If this is so, then if the package developer does not bump the commit to >> something else after releasing the package on GNU ELPA, then order of >> the VC package vs. the tarball package would depend on order in which >> they are returned from via `directory-files', since their version >> according to `version-list-=' would be the same? > > If two installed packages have the same version, then indeed the sort > order between them is "arbitrary" (it currently happens to put in first > position the first package encountered, which may depend on the > directory-files sort order but also on the order the packages are found > along `package-directory-list` if they're not in the same dir). Ok. > So, to better handle the scenario you describe, we'd need/want something > like the 100% untested patch below. > > > Stefan > > > diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el > index ba0e3618f28..01936a4fe0a 100644 > --- a/lisp/emacs-lisp/package.el > +++ b/lisp/emacs-lisp/package.el > @@ -698,8 +698,10 @@ package-process-define-package > ;; If there is, insert the new package at the right place in the list. > (while > (if (and (cdr old-pkgs) > - (version-list-< version > - (package-desc-version (cadr old-pkgs)))) > + (let ((oversion (package-desc-version (cadr old-pkgs))))) > + (or (version-list-< version oversion) > + (and (equal version oversion) > + (package-vc-p new-pkg-desc)))) But in this case, if a regular package is upgraded, and a VC package weren't (even though the user might have written some patch they are relying on), it would be suddenly switch when starting up Emacs at some point. > (setq old-pkgs (cdr old-pkgs)) > (push new-pkg-desc (cdr old-pkgs)) > nil)))