GNU bug report logs - #64985
29.1; [PATCH] Byte-compilation of packages via package-vc doesn't correctly handle .elpaignore wildcards

Previous Next

Package: emacs;

Reported by: Jim Porter <jporterbugs <at> gmail.com>

Date: Tue, 1 Aug 2023 06:21:02 UTC

Severity: normal

Tags: patch

Found in version 29.1

Done: Jim Porter <jporterbugs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #32 received at 64985 <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: 64985 <at> debbugs.gnu.org,
 Mattias EngdegÄrd <mattias.engdegard <at> gmail.com>
Subject: Re: bug#64985: 29.1; [PATCH] Byte-compilation of packages via
 package-vc doesn't correctly handle .elpaignore wildcards
Date: Tue, 01 Aug 2023 19:21:42 +0000
Jim Porter <jporterbugs <at> 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 <at> 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)




This bug report was last modified 1 year and 286 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.