all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#64985: 29.1; [PATCH] Byte-compilation of packages via package-vc doesn't correctly handle .elpaignore wildcards
@ 2023-08-01  6:20 Jim Porter
  2023-08-01 11:21 ` Eli Zaretskii
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Jim Porter @ 2023-08-01  6:20 UTC (permalink / raw)
  To: 64985

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

When using the various package-vc installation functions, Emacs 
byte-compiles the source (good). However, it doesn't ignore sources that 
match wildcards in ".elpaignore" (bad). That's because, even though 
'byte-compile-ignore-files' is documented to be a list of regexps, 
'byte-recompile-directory' treats it as a list of strings.

To reproduce this, install a package via VC, for example via M-x 
package-vc-install RET https://github.com/jimporter/urgrep.git RET. Then 
notice how "urgrep-tests.el" got compiled, even though it matches a 
wildcard in ".elpaignore".

Patch attached to fix this. Eli, would this be safe enough for 29.2? 
'byte-compile-ignore-files' is a new feature in 29.1, so hopefully no 
one else is relying on its current semantics just yet.

[-- Attachment #2: 0001-Fix-handling-of-.elpaignore-file-when-compiling-pack.patch --]
[-- Type: text/plain, Size: 2083 bytes --]

From ec4e198fb9c87653d1e65288969bed1ff548683c Mon Sep 17 00:00:00 2001
From: Jim Porter <jporterbugs@gmail.com>
Date: Mon, 31 Jul 2023 23:10:03 -0700
Subject: [PATCH] Fix handling of ".elpaignore" file when compiling packages

* lisp/emacs-lisp/bytecomp.el (byte-recompile-directory): Treat
'byte-compile-ignore-files' as a list of regexps per its docstring.
---
 lisp/emacs-lisp/bytecomp.el | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 5b1d958e6c2..d123e68a088 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1995,9 +1995,8 @@ byte-recompile-directory
 		      (or (null arg) (eq 0 arg)
 			  (y-or-n-p (concat "Check " source "? ")))
                       ;; Directory is requested to be ignored
-                      (not (string-match-p
-                            (regexp-opt byte-compile-ignore-files)
-                            source))
+                      (not (seq-some (lambda (ex) (string-match-p ex source))
+                                     byte-compile-ignore-files))
                       (setq directories (nconc directories (list source))))
                ;; It is an ordinary file.  Decide whether to compile it.
                (if (and (string-match emacs-lisp-file-regexp source)
@@ -2007,9 +2006,8 @@ byte-recompile-directory
                         (not (auto-save-file-name-p source))
                         (not (member source (dir-locals--all-files directory)))
                         ;; File is requested to be ignored
-                        (not (string-match-p
-                              (regexp-opt byte-compile-ignore-files)
-                              source)))
+                        (not (seq-some (lambda (ex) (string-match-p ex source))
+                                       byte-compile-ignore-files)))
                    (progn (cl-incf
                            (pcase (byte-recompile-file source force arg)
                              ('no-byte-compile skip-count)
-- 
2.25.1


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

* bug#64985: 29.1; [PATCH] Byte-compilation of packages via package-vc doesn't correctly handle .elpaignore wildcards
  2023-08-01  6:20 bug#64985: 29.1; [PATCH] Byte-compilation of packages via package-vc doesn't correctly handle .elpaignore wildcards Jim Porter
@ 2023-08-01 11:21 ` Eli Zaretskii
  2023-08-01 19:22   ` Jim Porter
  2023-08-01 12:20 ` Philip Kaludercic
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2023-08-01 11:21 UTC (permalink / raw)
  To: Jim Porter, Philip Kaludercic, Stefan Monnier; +Cc: 64985

> Date: Mon, 31 Jul 2023 23:20:21 -0700
> From: Jim Porter <jporterbugs@gmail.com>
> 
> When using the various package-vc installation functions, Emacs 
> byte-compiles the source (good). However, it doesn't ignore sources that 
> match wildcards in ".elpaignore" (bad). That's because, even though 
> 'byte-compile-ignore-files' is documented to be a list of regexps, 
> 'byte-recompile-directory' treats it as a list of strings.
> 
> To reproduce this, install a package via VC, for example via M-x 
> package-vc-install RET https://github.com/jimporter/urgrep.git RET. Then 
> notice how "urgrep-tests.el" got compiled, even though it matches a 
> wildcard in ".elpaignore".
> 
> Patch attached to fix this. Eli, would this be safe enough for 29.2? 
> 'byte-compile-ignore-files' is a new feature in 29.1, so hopefully no 
> one else is relying on its current semantics just yet.

If Philip and Stefan agree with the patch, I don't mind installing it
on the release branch.  byte-compile-ignore-files is (a) not
documented anywhere except in its doc string, and (b) is a defvar, so
kind-of internal.  So who will tell us whether the doc string is right
and the code wrong, or the other way around?

Btw, do we have somewhere the documentation of all those features,
including the .elpaignore file and what it can include?  I don't see
this documented anywhere, so it's a small wonder people make such
mistakes (if they are mistakes).





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

* bug#64985: 29.1; [PATCH] Byte-compilation of packages via package-vc doesn't correctly handle .elpaignore wildcards
  2023-08-01  6:20 bug#64985: 29.1; [PATCH] Byte-compilation of packages via package-vc doesn't correctly handle .elpaignore wildcards Jim Porter
  2023-08-01 11:21 ` Eli Zaretskii
@ 2023-08-01 12:20 ` Philip Kaludercic
  2023-08-01 16:10   ` Jim Porter
  2023-08-01 17:29 ` Mattias Engdegård
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 16+ messages in thread
From: Philip Kaludercic @ 2023-08-01 12:20 UTC (permalink / raw)
  To: Jim Porter; +Cc: 64985

Jim Porter <jporterbugs@gmail.com> writes:

> When using the various package-vc installation functions, Emacs
> byte-compiles the source (good). However, it doesn't ignore sources
> that match wildcards in ".elpaignore" (bad). That's because, even
> though 'byte-compile-ignore-files' is documented to be a list of
> regexps, 'byte-recompile-directory' treats it as a list of strings.

I am a bit confused about this point.  Why do you think that
`byte-recompile-directory' treads `byte-compile-ignore-files' as a list
of non-regexp strings?

> To reproduce this, install a package via VC, for example via M-x
> package-vc-install RET https://github.com/jimporter/urgrep.git
> RET. Then notice how "urgrep-tests.el" got compiled, even though it
> matches a wildcard in ".elpaignore".
>
> Patch attached to fix this. Eli, would this be safe enough for 29.2?
> 'byte-compile-ignore-files' is a new feature in 29.1, so hopefully no
> one else is relying on its current semantics just yet.
>
> From ec4e198fb9c87653d1e65288969bed1ff548683c Mon Sep 17 00:00:00 2001
> From: Jim Porter <jporterbugs@gmail.com>
> Date: Mon, 31 Jul 2023 23:10:03 -0700
> Subject: [PATCH] Fix handling of ".elpaignore" file when compiling packages
>
> * lisp/emacs-lisp/bytecomp.el (byte-recompile-directory): Treat
> 'byte-compile-ignore-files' as a list of regexps per its docstring.
> ---
>  lisp/emacs-lisp/bytecomp.el | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
> index 5b1d958e6c2..d123e68a088 100644
> --- a/lisp/emacs-lisp/bytecomp.el
> +++ b/lisp/emacs-lisp/bytecomp.el
> @@ -1995,9 +1995,8 @@ byte-recompile-directory
>  		      (or (null arg) (eq 0 arg)
>  			  (y-or-n-p (concat "Check " source "? ")))
>                        ;; Directory is requested to be ignored
> -                      (not (string-match-p
> -                            (regexp-opt byte-compile-ignore-files)
> -                            source))
> +                      (not (seq-some (lambda (ex) (string-match-p ex source))
> +                                     byte-compile-ignore-files))

Here also, instead of merging a list of regular expressions into a
disjunctive one, you match each individually.  Am I missing something,
or what does this change?

(string-match-p (regexp-opt '("foo" "bar" "baz")) "foo") ;=> 0
(seq-some (lambda (ex) (string-match-p ex "foo")) '("foo" "bar" "baz")) ;=> 0

(string-match-p (regexp-opt '("foo" "bar" "baz")) "quux") ;=> nil
(seq-some (lambda (ex) (string-match-p ex "quux")) '("foo" "bar" "baz")) ;=> nil

>                        (setq directories (nconc directories (list source))))
>                 ;; It is an ordinary file.  Decide whether to compile it.
>                 (if (and (string-match emacs-lisp-file-regexp source)
> @@ -2007,9 +2006,8 @@ byte-recompile-directory
>                          (not (auto-save-file-name-p source))
>                          (not (member source (dir-locals--all-files directory)))
>                          ;; File is requested to be ignored
> -                        (not (string-match-p
> -                              (regexp-opt byte-compile-ignore-files)
> -                              source)))
> +                        (not (seq-some (lambda (ex) (string-match-p ex source))
> +                                       byte-compile-ignore-files)))
>                     (progn (cl-incf
>                             (pcase (byte-recompile-file source force arg)
>                               ('no-byte-compile skip-count)





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

* bug#64985: 29.1; [PATCH] Byte-compilation of packages via package-vc doesn't correctly handle .elpaignore wildcards
  2023-08-01 12:20 ` Philip Kaludercic
@ 2023-08-01 16:10   ` Jim Porter
  2023-08-01 16:18     ` Jim Porter
  0 siblings, 1 reply; 16+ messages in thread
From: Jim Porter @ 2023-08-01 16:10 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 64985

On 8/1/2023 5:20 AM, Philip Kaludercic wrote:
> Jim Porter <jporterbugs@gmail.com> writes:
> 
>> When using the various package-vc installation functions, Emacs
>> byte-compiles the source (good). However, it doesn't ignore sources
>> that match wildcards in ".elpaignore" (bad). That's because, even
>> though 'byte-compile-ignore-files' is documented to be a list of
>> regexps, 'byte-recompile-directory' treats it as a list of strings.
> 
> I am a bit confused about this point.  Why do you think that
> `byte-recompile-directory' treads `byte-compile-ignore-files' as a list
> of non-regexp strings?

The docstring for 'regexp-opt' (which is what 'byte-recompile-directory' 
uses to combine 'byte-compile-ignore-files') says this:

   Return a regexp to match a string in the list STRINGS.
   Each member of STRINGS is treated as a fixed string, not as a regexp.

> Here also, instead of merging a list of regular expressions into a
> disjunctive one, you match each individually.  Am I missing something,
> or what does this change?
> 
> (string-match-p (regexp-opt '("foo" "bar" "baz")) "foo") ;=> 0
> (seq-some (lambda (ex) (string-match-p ex "foo")) '("foo" "bar" "baz")) ;=> 0

Consider this case:

   (string-match-p (regexp-opt '("fo+" "bar")) "foo") ;=> nil
   (seq-some (lambda (ex) (string-match-p ex "foo")) '("fo+" "bar")) ;=> 0

There might be another way to do this, e.g. so that we could optimize 
the regexp, but I'm not sure if Emacs has anything to optimize a list of 
*regexp* alternatives (rather than a list of *string* alternatives). I 
tested out 'rx' too, but no luck there either. This seemed like the best 
I could do without more extensive changes, which I wanted to avoid for 
the 29 branch.





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

* bug#64985: 29.1; [PATCH] Byte-compilation of packages via package-vc doesn't correctly handle .elpaignore wildcards
  2023-08-01 16:10   ` Jim Porter
@ 2023-08-01 16:18     ` Jim Porter
  0 siblings, 0 replies; 16+ messages in thread
From: Jim Porter @ 2023-08-01 16:18 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 64985

On 8/1/2023 9:10 AM, Jim Porter wrote:
> There might be another way to do this, e.g. so that we could optimize 
> the regexp, but I'm not sure if Emacs has anything to optimize a list of 
> *regexp* alternatives (rather than a list of *string* alternatives). I 
> tested out 'rx' too, but no luck there either. This seemed like the best 
> I could do without more extensive changes, which I wanted to avoid for 
> the 29 branch.

Note: 'rx' (well, 'rx-to-string') would work here too, but it didn't 
optimize the list of regexp alternatives, and I found the code to be 
harder to read (though I could just be doing it in a clumsy way).






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

* bug#64985: 29.1; [PATCH] Byte-compilation of packages via package-vc doesn't correctly handle .elpaignore wildcards
  2023-08-01  6:20 bug#64985: 29.1; [PATCH] Byte-compilation of packages via package-vc doesn't correctly handle .elpaignore wildcards Jim Porter
  2023-08-01 11:21 ` Eli Zaretskii
  2023-08-01 12:20 ` Philip Kaludercic
@ 2023-08-01 17:29 ` Mattias Engdegård
  2023-08-01 18:10   ` Jim Porter
  2023-08-04 19:37 ` bug#64985: 30.0.50; package-recompile-all and package-recompile do not recompile anything, seems related to the patch associated with bug #64985 Vincenzo Pupillo
  2023-08-05 17:12 ` Mattias Engdegård
  4 siblings, 1 reply; 16+ messages in thread
From: Mattias Engdegård @ 2023-08-01 17:29 UTC (permalink / raw)
  To: Jim Porter; +Cc: 64985, Philip Kaludercic

>> There might be another way to do this, e.g. so that we could optimize 
>> the regexp, but I'm not sure if Emacs has anything to optimize a list of 
>> *regexp* alternatives (rather than a list of *string* alternatives). I 
>> tested out 'rx' too, but no luck there either. This seemed like the best 
>> I could do without more extensive changes, which I wanted to avoid for 
>> the 29 branch.
>> 
> Note: 'rx' (well, 'rx-to-string') would work here too, but it didn't 
> optimize the list of regexp alternatives, and I found the code to be 
> harder to read (though I could just be doing it in a clumsy way).

rx doesn't attempt to left-factorise disjunctive patterns unless they are all literal strings or characters. I have considered a generalisation, but it would be done on the rx level and so wouldn't solve your immediate problem here.

An alternative would be to match against

(mapconcat #'identity byte-compile-ignore-files "\\|") ...)







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

* bug#64985: 29.1; [PATCH] Byte-compilation of packages via package-vc doesn't correctly handle .elpaignore wildcards
  2023-08-01 17:29 ` Mattias Engdegård
@ 2023-08-01 18:10   ` Jim Porter
  2023-08-01 18:32     ` Philip Kaludercic
  0 siblings, 1 reply; 16+ messages in thread
From: Jim Porter @ 2023-08-01 18:10 UTC (permalink / raw)
  To: Mattias Engdegård; +Cc: 64985, Philip Kaludercic

On 8/1/2023 10:29 AM, Mattias Engdegård wrote:
> An alternative would be to match against
> 
> (mapconcat #'identity byte-compile-ignore-files "\\|") ...)

Yeah, I thought about that too. I'm not sure if this would be better 
than using 'seq-some' though; if anyone else has strong opinions on 
this, I'm happy to change the code to whatever the preferred 
implementation is. (I'm also not sure the specific implementation 
matters too much since I doubt this bit is a performance bottleneck.)





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

* bug#64985: 29.1; [PATCH] Byte-compilation of packages via package-vc doesn't correctly handle .elpaignore wildcards
  2023-08-01 18:10   ` Jim Porter
@ 2023-08-01 18:32     ` Philip Kaludercic
  2023-08-01 19:18       ` Jim Porter
  0 siblings, 1 reply; 16+ messages in thread
From: Philip Kaludercic @ 2023-08-01 18:32 UTC (permalink / raw)
  To: Jim Porter; +Cc: 64985, Mattias Engdegård

Jim Porter <jporterbugs@gmail.com> writes:

> On 8/1/2023 10:29 AM, Mattias Engdegård wrote:
>> An alternative would be to match against
>> (mapconcat #'identity byte-compile-ignore-files "\\|") ...)
>
> Yeah, I thought about that too. I'm not sure if this would be better
> than using 'seq-some' though; if anyone else has strong opinions on
> this, I'm happy to change the code to whatever the preferred
> implementation is. (I'm also not sure the specific implementation
> matters too much since I doubt this bit is a performance bottleneck.)

The mistake in my previous message was, that I was under the false
assumption that regexp-opt did what Mattias mentioned above (I guess the
reason is that I faintly remembered that the docstring of regexp-opt
mentions (mapconcat 'regexp-quote strings "\\|"), and for some reason I
belive the 'regexp-quote was an 'identity).

In that case we should certainly apply a patch along the lines of what
you suggested, but I would prefer the mapconcat approach, if anything
because of the micro-optimisation of avoiding the overhead for the
generic seq call and having the create and apply closure over and over
again.  Not sure if this counts as a strong preference, but it certainly
is a preference.





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

* bug#64985: 29.1; [PATCH] Byte-compilation of packages via package-vc doesn't correctly handle .elpaignore wildcards
  2023-08-01 18:32     ` Philip Kaludercic
@ 2023-08-01 19:18       ` Jim Porter
  2023-08-01 19:21         ` Philip Kaludercic
  0 siblings, 1 reply; 16+ messages in thread
From: Jim Porter @ 2023-08-01 19:18 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 64985, Mattias Engdegård

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

On 8/1/2023 11:32 AM, Philip Kaludercic wrote:
> In that case we should certainly apply a patch along the lines of what
> you suggested, but I would prefer the mapconcat approach, if anything
> because of the micro-optimisation of avoiding the overhead for the
> generic seq call and having the create and apply closure over and over
> again.  Not sure if this counts as a strong preference, but it certainly
> is a preference.

How about this? For extra micro-optimization, I put the 'mapconcat' call 
outside of the loop. Now we won't concat the same list of strings for 
every file/dir that we look at.

[-- Attachment #2: 0001-Fix-handling-of-.elpaignore-file-when-compiling-pack.patch --]
[-- Type: text/plain, Size: 2283 bytes --]

From b530de0f6393dbb516ec0e5601ca9c26dbbce710 Mon Sep 17 00:00:00 2001
From: Jim Porter <jporterbugs@gmail.com>
Date: Mon, 31 Jul 2023 23:10:03 -0700
Subject: [PATCH] Fix handling of ".elpaignore" file when compiling packages

* lisp/emacs-lisp/bytecomp.el (byte-recompile-directory): Treat
'byte-compile-ignore-files' as a list of regexps per its docstring
(bug#64985).
---
 lisp/emacs-lisp/bytecomp.el | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 5b1d958e6c2..f0656628236 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1975,6 +1975,8 @@ byte-recompile-directory
       (emacs-lisp-compilation-mode))
     (let ((directories (list default-directory))
 	  (default-directory default-directory)
+          (ignore-files-regexp
+           (mapconcat #'identity byte-compile-ignore-files "\\|"))
 	  (skip-count 0)
 	  (fail-count 0)
 	  (file-count 0)
@@ -1995,9 +1997,7 @@ byte-recompile-directory
 		      (or (null arg) (eq 0 arg)
 			  (y-or-n-p (concat "Check " source "? ")))
                       ;; Directory is requested to be ignored
-                      (not (string-match-p
-                            (regexp-opt byte-compile-ignore-files)
-                            source))
+                      (not (string-match-p ignore-files-regexp source))
                       (setq directories (nconc directories (list source))))
                ;; It is an ordinary file.  Decide whether to compile it.
                (if (and (string-match emacs-lisp-file-regexp source)
@@ -2007,9 +2007,7 @@ byte-recompile-directory
                         (not (auto-save-file-name-p source))
                         (not (member source (dir-locals--all-files directory)))
                         ;; File is requested to be ignored
-                        (not (string-match-p
-                              (regexp-opt byte-compile-ignore-files)
-                              source)))
+                        (not (string-match-p ignore-files-regexp source)))
                    (progn (cl-incf
                            (pcase (byte-recompile-file source force arg)
                              ('no-byte-compile skip-count)
-- 
2.25.1


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

* bug#64985: 29.1; [PATCH] Byte-compilation of packages via package-vc doesn't correctly handle .elpaignore wildcards
  2023-08-01 19:18       ` Jim Porter
@ 2023-08-01 19:21         ` Philip Kaludercic
  2023-08-02 18:08           ` Jim Porter
  0 siblings, 1 reply; 16+ messages in thread
From: Philip Kaludercic @ 2023-08-01 19:21 UTC (permalink / raw)
  To: Jim Porter; +Cc: 64985, Mattias Engdegård

Jim Porter <jporterbugs@gmail.com> writes:

> On 8/1/2023 11:32 AM, Philip Kaludercic wrote:
>> In that case we should certainly apply a patch along the lines of what
>> you suggested, but I would prefer the mapconcat approach, if anything
>> because of the micro-optimisation of avoiding the overhead for the
>> generic seq call and having the create and apply closure over and over
>> again.  Not sure if this counts as a strong preference, but it certainly
>> is a preference.
>
> How about this? For extra micro-optimization, I put the 'mapconcat'
> call outside of the loop. Now we won't concat the same list of strings
> for every file/dir that we look at.

I like this a lot more, thanks.

> From b530de0f6393dbb516ec0e5601ca9c26dbbce710 Mon Sep 17 00:00:00 2001
> From: Jim Porter <jporterbugs@gmail.com>
> Date: Mon, 31 Jul 2023 23:10:03 -0700
> Subject: [PATCH] Fix handling of ".elpaignore" file when compiling packages
>
> * lisp/emacs-lisp/bytecomp.el (byte-recompile-directory): Treat
> 'byte-compile-ignore-files' as a list of regexps per its docstring
> (bug#64985).
> ---
>  lisp/emacs-lisp/bytecomp.el | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
> index 5b1d958e6c2..f0656628236 100644
> --- a/lisp/emacs-lisp/bytecomp.el
> +++ b/lisp/emacs-lisp/bytecomp.el
> @@ -1975,6 +1975,8 @@ byte-recompile-directory
>        (emacs-lisp-compilation-mode))
>      (let ((directories (list default-directory))
>  	  (default-directory default-directory)
> +          (ignore-files-regexp
> +           (mapconcat #'identity byte-compile-ignore-files "\\|"))
>  	  (skip-count 0)
>  	  (fail-count 0)
>  	  (file-count 0)
> @@ -1995,9 +1997,7 @@ byte-recompile-directory
>  		      (or (null arg) (eq 0 arg)
>  			  (y-or-n-p (concat "Check " source "? ")))
>                        ;; Directory is requested to be ignored
> -                      (not (string-match-p
> -                            (regexp-opt byte-compile-ignore-files)
> -                            source))
> +                      (not (string-match-p ignore-files-regexp source))
>                        (setq directories (nconc directories (list source))))
>                 ;; It is an ordinary file.  Decide whether to compile it.
>                 (if (and (string-match emacs-lisp-file-regexp source)
> @@ -2007,9 +2007,7 @@ byte-recompile-directory
>                          (not (auto-save-file-name-p source))
>                          (not (member source (dir-locals--all-files directory)))
>                          ;; File is requested to be ignored
> -                        (not (string-match-p
> -                              (regexp-opt byte-compile-ignore-files)
> -                              source)))
> +                        (not (string-match-p ignore-files-regexp source)))
>                     (progn (cl-incf
>                             (pcase (byte-recompile-file source force arg)
>                               ('no-byte-compile skip-count)





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

* bug#64985: 29.1; [PATCH] Byte-compilation of packages via package-vc doesn't correctly handle .elpaignore wildcards
  2023-08-01 11:21 ` Eli Zaretskii
@ 2023-08-01 19:22   ` Jim Porter
  0 siblings, 0 replies; 16+ messages in thread
From: Jim Porter @ 2023-08-01 19:22 UTC (permalink / raw)
  To: Eli Zaretskii, Philip Kaludercic, Stefan Monnier; +Cc: 64985

On 8/1/2023 4:21 AM, Eli Zaretskii wrote:
> Btw, do we have somewhere the documentation of all those features,
> including the .elpaignore file and what it can include?  I don't see
> this documented anywhere, so it's a small wonder people make such
> mistakes (if they are mistakes).

I'll look into this. I was already looking for a good place to put the 
documentation I had discussed on emacs-devel about how to choose a good 
name for an ELPA package, so it would probably make sense for 
documentation about .elpaignore to live alongside that.





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

* bug#64985: 29.1; [PATCH] Byte-compilation of packages via package-vc doesn't correctly handle .elpaignore wildcards
  2023-08-01 19:21         ` Philip Kaludercic
@ 2023-08-02 18:08           ` Jim Porter
  0 siblings, 0 replies; 16+ messages in thread
From: Jim Porter @ 2023-08-02 18:08 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: Mattias Engdegård, 64985-done

On 8/1/2023 12:21 PM, Philip Kaludercic wrote:
> Jim Porter <jporterbugs@gmail.com> writes:
> 
>> How about this? For extra micro-optimization, I put the 'mapconcat'
>> call outside of the loop. Now we won't concat the same list of strings
>> for every file/dir that we look at.
> 
> I like this a lot more, thanks.

Thanks. Now merged to the release branch as da5e05a50e8. Marking this 
bug closed.






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

* bug#64985: 30.0.50; package-recompile-all and package-recompile do not recompile anything, seems related to the patch associated with bug #64985
  2023-08-01  6:20 bug#64985: 29.1; [PATCH] Byte-compilation of packages via package-vc doesn't correctly handle .elpaignore wildcards Jim Porter
                   ` (2 preceding siblings ...)
  2023-08-01 17:29 ` Mattias Engdegård
@ 2023-08-04 19:37 ` Vincenzo Pupillo
  2023-08-04 20:05   ` Jim Porter
  2023-08-05 17:12 ` Mattias Engdegård
  4 siblings, 1 reply; 16+ messages in thread
From: Vincenzo Pupillo @ 2023-08-04 19:37 UTC (permalink / raw)
  To: 64985

Hi,
today, after a git pull from master and rebuilding emacs (I removed all .elc 
files, make clean && make bootstrap as usual), I tried to recompile all 
installed packages, but without success.
Emacs says:
Checking /home/vincenzo/.emacs.d/elpa/zig-mode-20230722.2023...
Done (Total of 0 files compiled)
Checking /home/vincenzo/.emacs.d/elpa/yasnippet-20200604.246...
Done (Total of 0 files compiled)
Checking /home/vincenzo/.emacs.d/elpa/yaml-20230714.154...
Done (Total of 0 files compiled)
Checking /home/vincenzo/.emacs.d/elpa/xterm-color-20230321.3...
Done (Total of 0 files compiled)
Checking /home/vincenzo/.emacs.d/elpa/xcscope-20230626.2109...
Done (Total of 0 files compiled)
Checking /home/vincenzo/.emacs.d/elpa/xclip-1.11...
Done (Total of 0 files compiled)
Checking /home/vincenzo/.emacs.d/elpa/with-editor-20230711.1217...
Done (Total of 0 files compiled)
Checking /home/vincenzo/.emacs.d/elpa/which-key-20230712.2151...
Done (Total of 0 files compiled)
Checking /home/vincenzo/.emacs.d/elpa/web-completion-data-20160318.848...
Done (Total of 0 files compiled)
Checking /home/vincenzo/.emacs.d/elpa/w3m-20230801.18...
Done (Total of 0 files compiled)
Checking /home/vincenzo/.emacs.d/elpa/vterm-20230417.424...
Done (Total of 0 files compiled)
Checking /home/vincenzo/.emacs.d/elpa/vertico-1.4...

It seems to be a problem related to the patch attached to the bug #64985
My byte-compile-ignore-files is nil as a result, If I've made no mistake, 
(mapconcat #'identity byte-compile-ignore-files "\\|") is an empty string.
Could this be the problem?

Thanks.
Vincenzo

In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.38, cairo version 1.17.8) of 2023-08-04 built on fedora
Repository revision: 60e5f212182ca2f41f89a4315075e38433bc8ac0
Repository branch: master
System Description: Fedora Linux 38 (KDE Plasma)

Configured using:
 'configure --with-native-compilation=aot --with-tree-sitter
 --with-cairo --with-x-toolkit=gtk3 --without-pop --with-xwidgets
 --without-imagemagick --prefix=/opt/emacs_pgtk
 --with-file-notification=inotify --enable-link-time-optimization
 --with-native-compilation --with-xinput2 --with-pgtk
 'CFLAGS=-DMAIL_USE_LOCKF -O2 -funroll-loops -fno-strict-aliasing
 -march=native -mtune=native -D_FORTIFY_SOURCE=2
 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong
 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fstack-clash-protection
 -fcf-protection''

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY
INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM XWIDGETS GTK3 ZLIB

Important settings:
  value of $LANG: it_IT.UTF-8
  value of $XMODIFIERS: @im=none
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  global-git-gutter-mode: t
  editorconfig-mode: t
  xclip-mode: t
  which-key-mode: t
  global-flycheck-mode: t
  flycheck-mode: t
  projectile-mode: t
  server-mode: t
  yas-minor-mode: t
  company-quickhelp-mode: t
  company-quickhelp-local-mode: t
  global-company-mode: t
  company-mode: t
  persp-mode: t
  vertico-mode: t
  override-global-mode: t
  electric-pair-mode: t
  which-function-mode: t
  save-place-mode: t
  winner-mode: t
  minibuffer-electric-default-mode: t
  global-hl-line-mode: t
  savehist-mode: t
  delete-selection-mode: t
  recentf-mode: t
  xterm-mouse-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  context-menu-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  column-number-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  temp-buffer-resize-mode: t

Load-path shadows:
/home/vincenzo/.emacs.d/elpa/transient-20230723.1411/transient hides /opt/
emacs_pgtk/share/emacs/30.0.50/lisp/transient

Features:
(shadow sort mail-extr emacsbug message yank-media puny rfc822 mml
mml-sec epa epg rfc6068 epg-config gnus-util mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils debug backtrace
cl-print vc-git diff-mode vc-dispatcher citre citre-global
vertico-directory ediff ediff-merg ediff-mult ediff-wind ediff-diff
ediff-help ediff-init ediff-util git-gutter editorconfig
editorconfig-core editorconfig-core-handle editorconfig-fnmatch shortdoc
help-fns radix-tree cus-start cus-load mvn vterm face-remap term
disp-table ehelp vterm-module term/xterm xterm expand-region
text-mode-expansions cc-mode-expansions er-basic-expansions
expand-region-core expand-region-custom dired-launch xclip which-key
consult-imenu consult-flycheck flycheck find-func dash jka-compr
let-alist projectile-speedbar sr-speedbar speedbar ezimage dframe
projectile skeleton find-dired citre-lang-fileref dired-x dired
dired-loaddefs lisp-mnt grep ibuf-ext ibuffer ibuffer-loaddefs add-log
compile server yasnippet derived init custom-skeleton custom-rust
custom-dart custom-java custom-go custom-php custom-c cuda-mode cc-langs
cl citre-lang-c citre-tags citre-ctags citre-readtags
citre-readtags-tables citre-backend-interface citre-ui-peek color
citre-ui-jump citre-common-tag citre-common-util cc-mode cc-fonts
cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
custom-sql custom-clojure custom-web custom-ruby custom-markup
citre-config company-quickhelp pos-tip company-dabbrev-code
company-dabbrev company-files company-capf company consult-xref xref
project consult bookmark text-property-search pp perspective ibuf-macs
comp comp-cstr warnings icons advice ido vertico compat edmacro kmacro
json-ts-mode cmake-ts-mode yaml-ts-mode treesit standard-dark-theme
standard-themes cl-extra use-package use-package-ensure
use-package-delight use-package-diminish use-package-bind-key bind-key
easy-mmode use-package-core ffap thingatpt elec-pair which-func imenu
saveplace tramp-sh tramp rx trampver tramp-integration files-x
tramp-message help-mode tramp-compat xdg shell pcomplete comint ansi-osc
parse-time iso8601 time-date format-spec ansi-color tramp-loaddefs
winner ring minibuf-eldef hl-line savehist delsel recentf tree-widget
wid-edit xt-mouse custom-function custom-variable fonts cargo-autoloads
citre-autoloads clj-refactor-autoloads cider-autoloads
clojure-mode-autoloads cmake-project-autoloads company-glsl-autoloads
company-quickhelp-autoloads company-web-autoloads company-autoloads
consult-dir-autoloads consult-flycheck-autoloads consult-lsp-autoloads
consult-autoloads cuda-mode-autoloads dired-launch-autoloads
dired-rsync-autoloads docker-autoloads aio-autoloads
editorconfig-autoloads expand-region-autoloads flutter-autoloads
flycheck-autoloads git-gutter-autoloads glsl-mode-autoloads
go-mode-autoloads google-translate-autoloads gotest-autoloads
hover-autoloads iedit-autoloads inflections-autoloads lsp-dart-autoloads
dart-mode-autoloads lsp-java-autoloads dap-mode-autoloads
lsp-docker-autoloads bui-autoloads lsp-treemacs-autoloads
lsp-ui-autoloads lsp-mode-autoloads lua-mode-autoloads magit-autoloads
pcase git-commit-autoloads magit-section-autoloads meson-mode-autoloads
multiple-cursors-autoloads mvn-autoloads nexus-autoloads
paredit-autoloads parseedn-autoloads parseclj-autoloads
perspective-autoloads php-mode-autoloads pkg-info-autoloads
epl-autoloads plantuml-mode-autoloads popup-autoloads pos-tip-autoloads
projectile-speedbar-autoloads projectile-autoloads queue-autoloads
request-autoloads restclient-autoloads rustic-autoloads
markdown-mode-autoloads f-autoloads rust-mode-autoloads rvm-autoloads
sesman-autoloads spinner-autoloads sr-speedbar-autoloads
standard-themes-autoloads tablist-autoloads transient-autoloads
treemacs-autoloads cfrs-autoloads posframe-autoloads ht-autoloads
hydra-autoloads lv-autoloads pfuture-autoloads ace-window-autoloads
avy-autoloads s-autoloads dash-autoloads vertico-autoloads
vterm-autoloads w3m-load w3m-autoloads web-completion-data-autoloads
which-key-autoloads with-editor-autoloads info compat-autoloads
xclip-autoloads xcscope-autoloads xterm-color-autoloads yaml-autoloads
zig-mode-autoloads reformatter-autoloads package browse-url url
url-proxy url-privacy url-expand url-methods url-history url-cookie
generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x
map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc
iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win
term/common-win pgtk-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads xwidget-internal dbusbind inotify dynamic-setting
system-font-setting font-render-setting cairo gtk pgtk lcms2 multi-tty
move-toolbar make-network-process native-compile emacs)

Memory information:
((conses 16 674043 157766) (symbols 48 33121 1) (strings 32 157317 5061)
 (string-bytes 1 6516168) (vectors 16 45685) (vector-slots 8 853703 46616)
 (floats 8 319 390) (intervals 56 1552 635) (buffers 984 19))










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

* bug#64985: 30.0.50; package-recompile-all and package-recompile do not recompile anything, seems related to the patch associated with bug #64985
  2023-08-04 19:37 ` bug#64985: 30.0.50; package-recompile-all and package-recompile do not recompile anything, seems related to the patch associated with bug #64985 Vincenzo Pupillo
@ 2023-08-04 20:05   ` Jim Porter
  0 siblings, 0 replies; 16+ messages in thread
From: Jim Porter @ 2023-08-04 20:05 UTC (permalink / raw)
  To: Vincenzo Pupillo, 64985

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

On 8/4/2023 12:37 PM, Vincenzo Pupillo wrote:
> It seems to be a problem related to the patch attached to the bug #64985
> My byte-compile-ignore-files is nil as a result, If I've made no mistake,
> (mapconcat #'identity byte-compile-ignore-files "\\|") is an empty string.
> Could this be the problem?

Oops. Does this patch fix things?

[-- Attachment #2: 0001-Fix-handling-of-byte-compile-ignore-files-when-nil.patch --]
[-- Type: text/plain, Size: 1179 bytes --]

From 1ca1492a15eb97e7ab7929fd2166f1bf53e8dbbb Mon Sep 17 00:00:00 2001
From: Jim Porter <jporterbugs@gmail.com>
Date: Fri, 4 Aug 2023 13:01:35 -0700
Subject: [PATCH] Fix handling of 'byte-compile-ignore-files' when nil

Before this fix, when 'byte-compile-ignore-files' was nil,
'byte-recompile-directory' would ignore every file (bug#64985).

* lisp/emacs-lisp/bytecomp.el (byte-recompile-directory): Handle case
when 'byte-compile-ignore-files' is nil.
---
 lisp/emacs-lisp/bytecomp.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 65ccb60726f..d093d95a775 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1923,7 +1923,9 @@ byte-recompile-directory
     (let ((directories (list default-directory))
 	  (default-directory default-directory)
           (ignore-files-regexp
-           (mapconcat #'identity byte-compile-ignore-files "\\|"))
+           (if byte-compile-ignore-files
+               (mapconcat #'identity byte-compile-ignore-files "\\|")
+             regexp-unmatchable))
 	  (skip-count 0)
 	  (fail-count 0)
 	  (file-count 0)
-- 
2.25.1


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

* bug#64985: 30.0.50; package-recompile-all and package-recompile do not recompile anything, seems related to the patch associated with bug #64985
  2023-08-01  6:20 bug#64985: 29.1; [PATCH] Byte-compilation of packages via package-vc doesn't correctly handle .elpaignore wildcards Jim Porter
                   ` (3 preceding siblings ...)
  2023-08-04 19:37 ` bug#64985: 30.0.50; package-recompile-all and package-recompile do not recompile anything, seems related to the patch associated with bug #64985 Vincenzo Pupillo
@ 2023-08-05 17:12 ` Mattias Engdegård
  2023-08-05 17:16   ` Jim Porter
  4 siblings, 1 reply; 16+ messages in thread
From: Mattias Engdegård @ 2023-08-05 17:12 UTC (permalink / raw)
  To: Jim Porter; +Cc: 64985, Vincenzo Pupillo

> Oops. Does this patch fix things?

It's obviously the right thing to do (and make package-tests work again). Please apply!






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

* bug#64985: 30.0.50; package-recompile-all and package-recompile do not recompile anything, seems related to the patch associated with bug #64985
  2023-08-05 17:12 ` Mattias Engdegård
@ 2023-08-05 17:16   ` Jim Porter
  0 siblings, 0 replies; 16+ messages in thread
From: Jim Porter @ 2023-08-05 17:16 UTC (permalink / raw)
  To: Mattias Engdegård; +Cc: 64985, Vincenzo Pupillo

On 8/5/2023 10:12 AM, Mattias Engdegård wrote:
>> Oops. Does this patch fix things?
> 
> It's obviously the right thing to do (and make package-tests work again). Please apply!

Merged to the release branch as 1e8322bb26e.





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

end of thread, other threads:[~2023-08-05 17:16 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-01  6:20 bug#64985: 29.1; [PATCH] Byte-compilation of packages via package-vc doesn't correctly handle .elpaignore wildcards Jim Porter
2023-08-01 11:21 ` Eli Zaretskii
2023-08-01 19:22   ` Jim Porter
2023-08-01 12:20 ` Philip Kaludercic
2023-08-01 16:10   ` Jim Porter
2023-08-01 16:18     ` Jim Porter
2023-08-01 17:29 ` Mattias Engdegård
2023-08-01 18:10   ` Jim Porter
2023-08-01 18:32     ` Philip Kaludercic
2023-08-01 19:18       ` Jim Porter
2023-08-01 19:21         ` Philip Kaludercic
2023-08-02 18:08           ` Jim Porter
2023-08-04 19:37 ` bug#64985: 30.0.50; package-recompile-all and package-recompile do not recompile anything, seems related to the patch associated with bug #64985 Vincenzo Pupillo
2023-08-04 20:05   ` Jim Porter
2023-08-05 17:12 ` Mattias Engdegård
2023-08-05 17:16   ` Jim Porter

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.