]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix emacs-lisp-native-compile-and-load eln target directory (bug#64226)
authorAndrea Corallo <acorallo@gnu.org>
Wed, 9 Aug 2023 13:13:48 +0000 (15:13 +0200)
committerAndrea Corallo <acorallo@gnu.org>
Wed, 9 Aug 2023 13:19:26 +0000 (15:19 +0200)
* 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
test/src/comp-tests.el

index 322df0e86a19f7307175f98c69315ff236e50772..bdce4254bf5e6c17fb98fa73e953c7b2fe04e915 100644 (file)
@@ -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)
index b0d865292b7cd7115b9b4dad158da8a67d8bbd35..0e36a3c91901b09b312a6ce158358560267df8a2 100644 (file)
@@ -70,9 +70,11 @@ Check that the resulting binaries do not differ."
     :suffix "-comp-stage1.el"
     (ert-with-temp-file comp2-src
       :suffix "-comp-stage2.el"
-      (let* ((byte+native-compile t)     ; FIXME HACK
+      (let* ((byte+native-compile t)
+             (native-compile-target-directory
+              (car (last native-comp-eln-load-path)))
              (comp-src (expand-file-name "../../../lisp/emacs-lisp/comp.el"
-                                     (ert-resource-directory)))
+                                         (ert-resource-directory)))
              ;; Can't use debug symbols.
              (native-comp-debug 0))
         (copy-file comp-src comp1-src t)