From b93107c20b2899612c5c7a15187fc69866905e47 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Wed, 9 Aug 2023 15:13:48 +0200 Subject: Fix emacs-lisp-native-compile-and-load eln target directory (bug#64226) * lisp/emacs-lisp/comp.el (comp-spill-lap-function): Don't use `byte+native-compile' to select output directory but always axpect it explicit through `native-compile-target-directory'. (batch-byte+native-compile): Set `native-compile-target-directory'. * test/src/comp-tests.el (comp-tests-bootstrap): Set `native-compile-target-directory'. --- lisp/emacs-lisp/comp.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 322df0e86a1..bdce4254bf5 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -1392,11 +1392,8 @@ clashes." (unless byte-to-native-top-level-forms (signal 'native-compiler-error-empty-byte filename)) (unless (comp-ctxt-output comp-ctxt) - (setf (comp-ctxt-output comp-ctxt) (comp-el-to-eln-filename - filename - (or native-compile-target-directory - (when byte+native-compile - (car (last native-comp-eln-load-path))))))) + (setf (comp-ctxt-output comp-ctxt) + (comp-el-to-eln-filename filename native-compile-target-directory))) (setf (comp-ctxt-speed comp-ctxt) (alist-get 'native-comp-speed byte-native-qualities) (comp-ctxt-debug comp-ctxt) (alist-get 'native-comp-debug @@ -4351,6 +4348,8 @@ variable \"NATIVE_DISABLED\" is set, only byte compile." (batch-byte-compile) (cl-assert (length= command-line-args-left 1)) (let* ((byte+native-compile t) + (native-compile-target-directory + (car (last native-comp-eln-load-path))) (byte-to-native-output-buffer-file nil) (eln-file (car (batch-native-compile)))) (comp-write-bytecode-file eln-file) -- cgit v1.2.3 From 842dbf500e0fcf44d686d480f39d067b19ff38a9 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Sat, 12 Aug 2023 18:42:33 +0200 Subject: * Fix `batch-byte+native-compile' target directory. * lisp/emacs-lisp/comp.el (batch-native-compile): Don't shadow `native-compile-target-directory' unless necessary. --- lisp/emacs-lisp/comp.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index bdce4254bf5..0c70789be71 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -4305,8 +4305,9 @@ last directory in `native-comp-eln-load-path')." (comp-ensure-native-compiler) (let ((comp-running-batch-compilation t) (native-compile-target-directory - (if for-tarball - (car (last native-comp-eln-load-path))))) + (if for-tarball + (car (last native-comp-eln-load-path)) + native-compile-target-directory))) (cl-loop for file in command-line-args-left if (or (null byte+native-compile) (cl-notany (lambda (re) (string-match re file)) -- cgit v1.2.3