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?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#62720: 29.0.60; Not easy at all to upgrade :core packages like Eglot Date: Sat, 15 Apr 2023 09:35:37 +0100 Message-ID: <87a5z935ly.fsf@gmail.com> References: <87a5zj2vfo.fsf@gmail.com> <83mt3b4yfc.fsf@gnu.org> <87edonlsxi.fsf@posteo.net> <83jzyf4vzb.fsf@gnu.org> <871qknllkj.fsf@posteo.net> <83fs934pjf.fsf@gnu.org> <87wn2fk47y.fsf@posteo.net> <83sfd2g2ek.fsf@gnu.org> <875y9yfxrr.fsf@gmail.com> <87y1muefks.fsf@gmail.com> <834jpifizy.fsf@gnu.org> <83y1mue1qi.fsf@gnu.org> <83sfd2e01f.fsf@gnu.org> <87v8hynsbu.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="14285"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 62720@debbugs.gnu.org, rpluim@gmail.com, dmitry@gutov.dev, monnier@iro.umontreal.ca, Eli Zaretskii , larsi@gnus.org To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 15 10:34:23 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 1pnbMV-0003Uo-CP for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Apr 2023 10:34:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pnbMH-0004Dy-Dj; Sat, 15 Apr 2023 04:34:09 -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 1pnbMA-0004DN-NN for bug-gnu-emacs@gnu.org; Sat, 15 Apr 2023 04:34:07 -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 1pnbMA-0007nr-FH for bug-gnu-emacs@gnu.org; Sat, 15 Apr 2023 04:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pnbM9-0002hr-TJ for bug-gnu-emacs@gnu.org; Sat, 15 Apr 2023 04:34:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Apr 2023 08:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62720 X-GNU-PR-Package: emacs Original-Received: via spool by 62720-submit@debbugs.gnu.org id=B62720.168154762610380 (code B ref 62720); Sat, 15 Apr 2023 08:34:01 +0000 Original-Received: (at 62720) by debbugs.gnu.org; 15 Apr 2023 08:33:46 +0000 Original-Received: from localhost ([127.0.0.1]:48186 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pnbLt-0002hL-Ke for submit@debbugs.gnu.org; Sat, 15 Apr 2023 04:33:46 -0400 Original-Received: from mail-wm1-f51.google.com ([209.85.128.51]:53488) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pnbLr-0002h5-N0 for 62720@debbugs.gnu.org; Sat, 15 Apr 2023 04:33:44 -0400 Original-Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-3f0915c64a3so3058495e9.2 for <62720@debbugs.gnu.org>; Sat, 15 Apr 2023 01:33:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681547618; x=1684139618; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GCJCkqKKsv0jwvDWdxih1dIeDmehUGC1DJvTzphrweQ=; b=Lf4OeQ7YvYCAjYdHvj7+I7EcPcnfnGV1d6TB/R1ilr4CuIvNEMXbQSJKkpdfODPkfm f53rufxZVb+Uwp5bCGdtC4xROz9amhYwOdx5UZqzYCinwTvpfu6aS4pO7wDk1xZ2SWFs nf/DRA7ZRSWGd3KnaSLTvyNAUQRFD6IKVpspMjIED1p/qADtyuGEoBfy/TfTwcHLhvyk FePA6TGoItNo7euwM5L841sNbx7P/+jD0sxZBiCWZqqL0dbSzXSIlSA3VykpqP66nuWO 1/XlYJ9nwUG3+fEHHFpobMBTjv49auG92WZxpuLZmpYp16gA/HXKmUnjjDOZ8NUCOhWt Xf1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681547618; x=1684139618; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=GCJCkqKKsv0jwvDWdxih1dIeDmehUGC1DJvTzphrweQ=; b=DdCnerc7EuRijDmoADkjdmSjzML7jVcs6pCFsfBIdziWGhjUUzvO/rE5n/cbV/WK6b FBo6CTovlcNULm6RNhCPgWn2PPtd7hwhXzZ5TiCqTEi6qmM6AkQNiLZ+sbcxBnl4p+fZ 1QGVcDHbWiX0yJGf5TKFRrbUkN2Zy5j5hSaj/JaGqtoNkgH+5JPZd/g/dggyisHNP50c LFjyRIkMOHJhG/ip0VEKYterzLZuiKxsNXhB1ye5e4pU3VzDRXcQiU6pjcATEtyzKIer rYT9KRpLAYnXQ+Eot55/o/mCI7OHjRTOi9WEsS8zJWKFoXPUb2UzEkPY3z/XAuWIJAev 8i5w== X-Gm-Message-State: AAQBX9d0H6grrzvvlOOQfEEIJPxkGhk3o8duz4FAzUFjmoh3PoaQ7B37 4S0P6EVdFyPfDloc5DdJTYA= X-Google-Smtp-Source: AKy350b+kZQvwJgeNkGXueevadE8p8Fhipw0JeA+TxuxWt3RUikVMpwCyu1+gTZsAbRseeysNbGDKQ== X-Received: by 2002:a5d:4bc9:0:b0:2ce:a34b:2b0b with SMTP id l9-20020a5d4bc9000000b002cea34b2b0bmr903227wrt.28.1681547617771; Sat, 15 Apr 2023 01:33:37 -0700 (PDT) Original-Received: from krug ([87.196.73.56]) by smtp.gmail.com with ESMTPSA id n16-20020a05600c3b9000b003dd1bd0b915sm9882761wms.22.2023.04.15.01.33.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Apr 2023 01:33:37 -0700 (PDT) In-Reply-To: <87v8hynsbu.fsf@posteo.net> (Philip Kaludercic's message of "Fri, 14 Apr 2023 20:04:37 +0000") 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:260002 Archived-At: Philip Kaludercic writes: > Jo=C3=A3o T=C3=A1vora writes: >>> Philip presented such a safe modification, and we are in the final >>> stages of discussing its details, before it will be installed. So >>> yes, it is possible. > > I might have missed a message, what was the last state here? Eli is talking about an interaction between you two, so you should be able to figure out. >> As I've explained to Philip, the big drawback of that -- undoubtedly >> safe -- modification is that it is not compatible to user's >> configurations that have a (use-package 'eglot) or a >> (package-install 'eglot) in them. > > Again: Are we sure about this? After all, the package is installed > (which I think is the main thing), it just might not have the most > recent version. Calling this "not compatible" seems excessive. I don't think we should look at this in legalese and disguise the fact that the same form in Emacs 26, 27 and 28 has very different results. In those versions (use-package 'eglot :ensure t) brings you always the latest and greatest. In Emacs 29, supposedly the more advanced version, it will bring you a different, older, less powerful, and one that might even be incompatible with the remainder of your configuration if you aren't aware of this obscure quirk. Furthermore the problem continues to worsen with time as packages evolve. This is incompatibility if there ever was such a thing. So the "package 'eglot' is already installed" shown to the user, while technically correct, is completely misleading. The patch you're preparing, last I looked at it, doesn't solve this. It does makes Eglot slightly easier to upgrade, at least if the user is aware of this quirky situation. But it still doesn't fix the use-package case, for example or the non-interactive config case. Eli said something like this patch could be acceptable for master and maybe 29.2.=20=20 ----------8<----------8<----------8<----------8<----------8<----------8< --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -652,6 +652,9 @@ package--builtins name (a symbol) and DESC is a `package--bi-desc' structure.") (put 'package--builtins 'risky-local-variable t) =20 +(defvar package--safely-upgradeable-builtins '(eglot use-package) + "See bug#62720 for longest docstring ever.") + (defvar package-alist nil "Alist of all packages available for activation. Each element has the form (PKG . DESCS), where PKG is a package @@ -2201,14 +2204,19 @@ package-install (package--archives-initialize) (list (intern (completing-read "Install package: " + (append (delq nil (mapcar (lambda (elt) (unless (package-installed-p (car elt= )) (symbol-name (car elt)))) package-archive-contents)) + package--safely-upgradeable-builtins) nil t)) nil))) (package--archives-initialize) + (when-let ((desc (and (memq pkg package--safely-upgradeable-builtins) + (cadr (assoc pkg package-archive-contents))))) + (setq pkg desc)) (add-hook 'post-command-hook #'package-menu--post-refresh) (let ((name (if (package-desc-p pkg) (package-desc-name pkg) ---------->8---------->8---------->8---------->8---------->8---------->8 1. Node code complexity. It's 6 lines of trivial code. 2. Absolutely no risk of "silent installation of software that wasn't ever installed before" 3. Fixes all the aforementioned issues Doesn't fix package-update, but that's minor in comparison, I didn't want to add bloat this enormous patch with 2 more lines. It is based on a hardcoded list. Dmitry has suggested other ways to whitelist. There are infinite ways, of course. Other have suggested blacklists. Jo=C3=A3o