diff options
author | Andrea Corallo <akrl@sdf.org> | 2020-08-16 14:33:25 +0200 |
---|---|---|
committer | Andrea Corallo <akrl@sdf.org> | 2020-08-17 18:04:23 +0200 |
commit | da54406077c5facd7187aa17c9b4f5f4ddf0e233 (patch) | |
tree | a80e0d6fa5f327cb6f61afaa38137d52e4e059a4 /lisp/emacs-lisp | |
parent | 171db3110159d95803dea13c4ee7bca4a795747b (diff) | |
download | emacs-da54406077c5facd7187aa17c9b4f5f4ddf0e233.tar.gz emacs-da54406077c5facd7187aa17c9b4f5f4ddf0e233.tar.bz2 emacs-da54406077c5facd7187aa17c9b4f5f4ddf0e233.zip |
Allow for native compiling .el.gz files
This is needed for installed instances compiled with NATIVE_FAST_BOOT
* src/comp.c (maybe_defer_native_compilation): Search for .el.gz
too as a source if the .el is not found.
(Fcomp_el_to_eln_filename): Remove the .gz in case to
generate the hash.
* lisp/emacs-lisp/comp.el (comp-valid-source-re): New defconst.
(comp-run-async-workers, native-compile-async): Make use of
`comp-valid-source-re'.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/comp.el | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index b5ab4ebdccb..85b5562f280 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -137,6 +137,9 @@ before compilation. Usable to modify the compiler environment." (defvar comp-dry-run nil "When non nil run everything but the C back-end.") +(defconst comp-valid-source-re (rx ".el" (? ".gz") eos) + "Regexp to match filename of valid input source files.") + (defconst comp-log-buffer-name "*Native-compile-Log*" "Name of the native-compiler log buffer.") @@ -2564,7 +2567,7 @@ display a message." (cl-loop for (source-file . load) = (pop comp-files-queue) while source-file - do (cl-assert (string-match-p (rx ".el" eos) source-file) nil + do (cl-assert (string-match-p comp-valid-source-re source-file) nil "`comp-files-queue' should be \".el\" files: %s" source-file) when (or comp-always-compile @@ -2724,8 +2727,8 @@ LOAD can be nil t or 'late." (dolist (path paths) (cond ((file-directory-p path) (dolist (file (if recursively - (directory-files-recursively path (rx ".el" eos)) - (directory-files path t (rx ".el" eos)))) + (directory-files-recursively path comp-valid-source-re) + (directory-files path t comp-valid-source-re))) (push file files))) ((file-exists-p path) (push path files)) (t (signal 'native-compiler-error |