[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/native-comp da54406 08/12: Allow for native compiling .el.gz fil
From: |
Andrea Corallo |
Subject: |
feature/native-comp da54406 08/12: Allow for native compiling .el.gz files |
Date: |
Mon, 17 Aug 2020 13:12:11 -0400 (EDT) |
branch: feature/native-comp
commit da54406077c5facd7187aa17c9b4f5f4ddf0e233
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>
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'.
---
lisp/emacs-lisp/comp.el | 9 ++++++---
src/comp.c | 8 +++++++-
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index b5ab4eb..85b5562 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
diff --git a/src/comp.c b/src/comp.c
index d42bb4f..f4111e2 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -3867,6 +3867,8 @@ If BASE-DIR is nil use the first entry in
`comp-eln-load-path'. */)
(Lisp_Object file_name, Lisp_Object base_dir)
{
CHECK_STRING (file_name);
+ if (suffix_p (file_name, ".gz"))
+ file_name = Fsubstring (file_name, Qnil, make_fixnum (-3));
file_name = Fexpand_file_name (file_name, Qnil);
Lisp_Object hashed = Fsubstring (comp_hash_string (file_name), Qnil,
make_fixnum (ELN_FILENAME_HASH_LEN));
@@ -4494,7 +4496,11 @@ maybe_defer_native_compilation (Lisp_Object
function_name,
concat2 (CALL1I (file-name-sans-extension, Vload_true_file_name),
build_pure_c_string (".el"));
if (NILP (Ffile_exists_p (src)))
- return;
+ {
+ src = concat2 (src, build_pure_c_string (".gz"));
+ if (NILP (Ffile_exists_p (src)))
+ return;
+ }
/* This is to have deferred compilaiton able to compile comp
dependecies breaking circularity. */
- feature/native-comp updated (f2e6168 -> 76faab2), Andrea Corallo, 2020/08/17
- feature/native-comp 88b860e 02/12: Make comp-deferred-compilation a simple global and set it on by default, Andrea Corallo, 2020/08/17
- feature/native-comp df774c4 04/12: * Prevent recursive load, Andrea Corallo, 2020/08/17
- feature/native-comp 3224a44 01/12: Move eln files into dedicated cache directories, Andrea Corallo, 2020/08/17
- feature/native-comp 377ffdb 05/12: * Do not fail if more then one level of directories has to be created, Andrea Corallo, 2020/08/17
- feature/native-comp b6238d8 06/12: * Deferred compilation must always compile despite source file timestamp, Andrea Corallo, 2020/08/17
- feature/native-comp 40de063 09/12: * Remove a false permission related error while native compiling, Andrea Corallo, 2020/08/17
- feature/native-comp dbeafd3 03/12: Some Makefile updates and clean-up, Andrea Corallo, 2020/08/17
- feature/native-comp 171db31 07/12: Make install target functional for new eln-cache directory arrangement, Andrea Corallo, 2020/08/17
- feature/native-comp da54406 08/12: Allow for native compiling .el.gz files,
Andrea Corallo <=
- feature/native-comp 142cfe9 10/12: * Introduce `load-no-native', Andrea Corallo, 2020/08/17
- feature/native-comp 114b1d8 11/12: * test/src/comp-tests.el (comp-tests-bootstrap): Fix test for new eln setup., Andrea Corallo, 2020/08/17
- feature/native-comp 76faab2 12/12: * Improve eln filename hashing, Andrea Corallo, 2020/08/17