From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Philip Kaludercic <philipk@posteo.net>
Newsgroups: gmane.emacs.bugs
Subject: bug#68678: 29.1; package-recompile-all should skip system packages in
 package-directory-list
Date: Tue, 06 Feb 2024 19:13:14 +0000
Message-ID: <877cjhs8xh.fsf@posteo.net>
References: <CADbSrJyYvAiO-dmFK-uhp39gwubf5SzDeP1TtrLEOvZc3SgLLQ@mail.gmail.com>
 <87jznyfkas.fsf@posteo.net>
 <CADbSrJyPvX-w8tq=zKXAcR7PyKjVcFkrhn=EaLihf_XtDtNqiQ@mail.gmail.com>
 <87ttmx16ib.fsf@posteo.net>
 <CADbSrJx4=vtoTPSeZB+k5iLrQxx75Nu2ED6EXFu+kqh2EUHokg@mail.gmail.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="10542"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: 68678@debbugs.gnu.org
To: Allen Li <darkfeline@felesatra.moe>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 06 20:14:20 2024
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>
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 <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1rXQtf-0002XS-WE
	for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 06 Feb 2024 20:14:20 +0100
Original-Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <bug-gnu-emacs-bounces@gnu.org>)
	id 1rXQtE-0006VU-4G; Tue, 06 Feb 2024 14:13:52 -0500
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 <Debian-debbugs@debbugs.gnu.org>)
 id 1rXQtB-0006Tk-Bc
 for bug-gnu-emacs@gnu.org; Tue, 06 Feb 2024 14:13:49 -0500
Original-Received: from debbugs.gnu.org ([2001:470:142:5::43])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1rXQtB-00025h-3N
 for bug-gnu-emacs@gnu.org; Tue, 06 Feb 2024 14:13:49 -0500
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1rXQtO-0000rH-Bx
 for bug-gnu-emacs@gnu.org; Tue, 06 Feb 2024 14:14:02 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: Philip Kaludercic <philipk@posteo.net>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Tue, 06 Feb 2024 19:14:02 +0000
Resent-Message-ID: <handler.68678.B68678.17072468173248@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 68678
X-GNU-PR-Package: emacs
Original-Received: via spool by 68678-submit@debbugs.gnu.org id=B68678.17072468173248
 (code B ref 68678); Tue, 06 Feb 2024 19:14:02 +0000
Original-Received: (at 68678) by debbugs.gnu.org; 6 Feb 2024 19:13:37 +0000
Original-Received: from localhost ([127.0.0.1]:55124 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1rXQsy-0000qJ-Ov
 for submit@debbugs.gnu.org; Tue, 06 Feb 2024 14:13:37 -0500
Original-Received: from mout02.posteo.de ([185.67.36.66]:49831)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@posteo.net>) id 1rXQsw-0000q0-Qh
 for 68678@debbugs.gnu.org; Tue, 06 Feb 2024 14:13:35 -0500
Original-Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id D6BF5240105
 for <68678@debbugs.gnu.org>; Tue,  6 Feb 2024 20:13:15 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1707246795; bh=ERnxxgKGbZZgVnk8dnwfSNCoAT2OgyWbe2vUDX6qBpw=;
 h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version:
 Content-Type:From;
 b=Dr7wRenkrd8wxskGYFAOUQ9BmYiaO1UwcPY1oCaxNlq+LaBgmsfjLYbJKQzaIVBdm
 1qFGRGeeDJONk4KgqPhTlnQ3jFKAe6nnQRVaM7XEXLKM14ZT5dc/Qj2BVp+KzqCbfF
 ASqSgP1HxE7/V/7lXx5eyhgvsqbmfcNcgOJ6F0SRSIaewAoRB+QcFMuR+CnG8DdPPJ
 LCgh/EDY9PtTBlHZjsteYJupuaa9lu9NnTfaRJCkYSriiEvO1oEKEKKXokFiLCKS57
 nD/HrpyENttmOJhQWNfUCmRO7jcDXO+MG2p9Dltj6hirwTWDLiecFQkWHUBzWMAHFj
 E8/ypR8OSWukg==
Original-Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4TTtF732cQz6txm;
 Tue,  6 Feb 2024 20:13:15 +0100 (CET)
In-Reply-To: <CADbSrJx4=vtoTPSeZB+k5iLrQxx75Nu2ED6EXFu+kqh2EUHokg@mail.gmail.com>
 (Allen Li's message of "Fri, 2 Feb 2024 00:10:24 -0800")
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
OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66;
 url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66";
 preference=signencrypt
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" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=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:279511
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/279511>

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Allen Li <darkfeline@felesatra.moe> writes:

> On Sun, Jan 28, 2024 at 1:40=E2=80=AFPM Philip Kaludercic <philipk@posteo=
.net>
> wrote:
>>
>> Allen Li <darkfeline@felesatra.moe> writes:
>> >
>> > That works for me, though it's possible that someone may want errors
>> > recompiling user packages surfaced directly.
>>
>> That is why I used `with-demoted-errors', which propagates errors if
>> `debug-on-error' is non-nil.  Or do you mean permanently and
>> specifically related to this issue, e.g. in form of a user option.
>
> My bad, yes, `with-demoted-errors' sounds fine to me.  At the risk of
> repeating myself,
> I don't have a use case for surfacing the errors, but I think some
> other users might.

OK, then this is the patch I propse:


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=0001-Tolerate-errors-while-recompiling-all-packages.patch

>From a6c1e5259d413f3ca488e32f2c38d51353494fc6 Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <philipk@posteo.net>
Date: Tue, 6 Feb 2024 20:12:15 +0100
Subject: [PATCH] Tolerate errors while recompiling all packages

* lisp/emacs-lisp/package.el (package-recompile-all): Demote errors
raised by 'package-recompile'.  (Bug#68678)
---
 lisp/emacs-lisp/package.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 868373f46c2..fe7b10f569a 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -2610,7 +2610,8 @@ package-recompile-all
 are invalid due to changed byte-code, macros or the like."
   (interactive)
   (pcase-dolist (`(_ ,pkg-desc) package-alist)
-    (package-recompile pkg-desc)))
+    (with-demoted-errors "Error while recompiling: %S"
+      (package-recompile pkg-desc))))
 
 ;;;###autoload
 (defun package-autoremove ()
-- 
2.39.2


--=-=-=
Content-Type: text/plain


Any objections?

--=-=-=--