all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#68678: 29.1; package-recompile-all should skip system packages in package-directory-list
@ 2024-01-23 23:48 Allen Li
  2024-01-24 22:17 ` Philip Kaludercic
  0 siblings, 1 reply; 7+ messages in thread
From: Allen Li @ 2024-01-23 23:48 UTC (permalink / raw)
  To: 68678

[-- Attachment #1: Type: text/plain, Size: 722 bytes --]

package-recompile-all currently attempts to recompile all packages,
including the system packages listed in package-directory-list.

System packages are generally byte compiled as part of installation, and
are not writeable by normal users.

package-recompile-all attempts to recompile these, which will almost
certainly error out due to this.

It would be better if package-recompile-all only tries user installed
packages (in package-user-dir), which are more likely to need
recompilation.  Perhaps as a prefix arg option?

In GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.37,
 cairo version 1.16.0) of 2023-09-03, modified by Debian built on
 kokoro-ubuntu
System Description: Debian GNU/Linux rodete

[-- Attachment #2: Type: text/html, Size: 806 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#68678: 29.1; package-recompile-all should skip system packages in package-directory-list
  2024-01-23 23:48 bug#68678: 29.1; package-recompile-all should skip system packages in package-directory-list Allen Li
@ 2024-01-24 22:17 ` Philip Kaludercic
  2024-01-25 22:58   ` Allen Li
  0 siblings, 1 reply; 7+ messages in thread
From: Philip Kaludercic @ 2024-01-24 22:17 UTC (permalink / raw)
  To: Allen Li; +Cc: 68678

[-- Attachment #1: Type: text/plain, Size: 637 bytes --]

Allen Li <darkfeline@felesatra.moe> writes:

> package-recompile-all currently attempts to recompile all packages,
> including the system packages listed in package-directory-list.
>
> System packages are generally byte compiled as part of installation, and
> are not writeable by normal users.
>
> package-recompile-all attempts to recompile these, which will almost
> certainly error out due to this.
>
> It would be better if package-recompile-all only tries user installed
> packages (in package-user-dir), which are more likely to need
> recompilation.  Perhaps as a prefix arg option?

Would this patch resolve the issue for you:


[-- Attachment #2: Type: text/plain, Size: 521 bytes --]

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 ()

[-- Attachment #3: Type: text/plain, Size: 205 bytes --]


> In GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.37,
>  cairo version 1.16.0) of 2023-09-03, modified by Debian built on
>  kokoro-ubuntu
> System Description: Debian GNU/Linux rodete

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#68678: 29.1; package-recompile-all should skip system packages in package-directory-list
  2024-01-24 22:17 ` Philip Kaludercic
@ 2024-01-25 22:58   ` Allen Li
  2024-01-28 21:40     ` Philip Kaludercic
  0 siblings, 1 reply; 7+ messages in thread
From: Allen Li @ 2024-01-25 22:58 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 68678

On Wed, Jan 24, 2024 at 2:17 PM Philip Kaludercic <philipk@posteo.net> wrote:
>
> Would this patch resolve the issue for you:
>
> 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 ()

That works for me, though it's possible that someone may want errors
recompiling user packages surfaced directly.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#68678: 29.1; package-recompile-all should skip system packages in package-directory-list
  2024-01-25 22:58   ` Allen Li
@ 2024-01-28 21:40     ` Philip Kaludercic
  2024-02-02  8:10       ` Allen Li
  0 siblings, 1 reply; 7+ messages in thread
From: Philip Kaludercic @ 2024-01-28 21:40 UTC (permalink / raw)
  To: Allen Li; +Cc: 68678

Allen Li <darkfeline@felesatra.moe> writes:

> On Wed, Jan 24, 2024 at 2:17 PM Philip Kaludercic <philipk@posteo.net> wrote:
>>
>> Would this patch resolve the issue for you:
>>
>> 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 ()
>
> 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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#68678: 29.1; package-recompile-all should skip system packages in package-directory-list
  2024-01-28 21:40     ` Philip Kaludercic
@ 2024-02-02  8:10       ` Allen Li
  2024-02-06 19:13         ` Philip Kaludercic
  0 siblings, 1 reply; 7+ messages in thread
From: Allen Li @ 2024-02-02  8:10 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 68678

On Sun, Jan 28, 2024 at 1:40 PM 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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#68678: 29.1; package-recompile-all should skip system packages in package-directory-list
  2024-02-02  8:10       ` Allen Li
@ 2024-02-06 19:13         ` Philip Kaludercic
  2024-02-11 21:52           ` Philip Kaludercic
  0 siblings, 1 reply; 7+ messages in thread
From: Philip Kaludercic @ 2024-02-06 19:13 UTC (permalink / raw)
  To: Allen Li; +Cc: 68678

[-- Attachment #1: Type: text/plain, Size: 761 bytes --]

Allen Li <darkfeline@felesatra.moe> writes:

> On Sun, Jan 28, 2024 at 1:40 PM 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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Tolerate-errors-while-recompiling-all-packages.patch --]
[-- Type: text/x-diff, Size: 952 bytes --]

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


[-- Attachment #3: Type: text/plain, Size: 17 bytes --]


Any objections?

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#68678: 29.1; package-recompile-all should skip system packages in package-directory-list
  2024-02-06 19:13         ` Philip Kaludercic
@ 2024-02-11 21:52           ` Philip Kaludercic
  0 siblings, 0 replies; 7+ messages in thread
From: Philip Kaludercic @ 2024-02-11 21:52 UTC (permalink / raw)
  To: Allen Li; +Cc: 68678-done

Philip Kaludercic <philipk@posteo.net> writes:

> Allen Li <darkfeline@felesatra.moe> writes:
>
>> On Sun, Jan 28, 2024 at 1:40 PM 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:
>
>
>
> Any objections?

As there haven't been any comment, I have pushed the patch to master.  Thanks!





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-02-11 21:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-23 23:48 bug#68678: 29.1; package-recompile-all should skip system packages in package-directory-list Allen Li
2024-01-24 22:17 ` Philip Kaludercic
2024-01-25 22:58   ` Allen Li
2024-01-28 21:40     ` Philip Kaludercic
2024-02-02  8:10       ` Allen Li
2024-02-06 19:13         ` Philip Kaludercic
2024-02-11 21:52           ` Philip Kaludercic

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.