]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid having the async compile log saying it's compiling loaddefs
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 17 Oct 2022 08:48:12 +0000 (10:48 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 17 Oct 2022 08:48:20 +0000 (10:48 +0200)
* lisp/loadup.el (featurep): Define the hash table in nativecomp
builds (but not otherwise).  A more natural place to define this
would be in comp.el, but comp.el isn't loaded yet when we load the
.elc file that updates comp--no-native-compile.  We could change
the load order and move the definition to comp.el, though.

* lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Allow
inhibiting nativecomp earlier (bug#57627).

* lisp/emacs-lisp/comp.el (native-compile-async-skip-p): Use the data.

lisp/emacs-lisp/bytecomp.el
lisp/emacs-lisp/comp.el
lisp/loadup.el

index 3ceb5da804ff9d68402a6ddc9956ab27d181512e..692a87f6d570b0ab601d286df746a479ec97a019 100644 (file)
@@ -2323,9 +2323,15 @@ With argument ARG, insert value in current buffer after the form."
        (setq case-fold-search nil))
      (displaying-byte-compile-warnings
       (with-current-buffer inbuffer
-       (and byte-compile-current-file
-            (byte-compile-insert-header byte-compile-current-file
-                                         byte-compile--outbuffer))
+       (when byte-compile-current-file
+         (byte-compile-insert-header byte-compile-current-file
+                                      byte-compile--outbuffer)
+          ;; Instruct native-comp to ignore this file.
+          (when (bound-and-true-p no-native-compile)
+            (with-current-buffer byte-compile--outbuffer
+              (insert
+               "(when (boundp 'comp--no-native-compile)
+  (puthash load-file-name t comp--no-native-compile))\n\n"))))
        (goto-char (point-min))
        ;; Should we always do this?  When calling multiple files, it
        ;; would be useful to delay this warning until all have been
index 889bffa3f5c27b1aaf9ee382296e7ae0563c2ba2..c300c44a8d72db280a2f92e19b621b4dd0fa5db2 100644 (file)
@@ -4119,6 +4119,7 @@ the deferred compilation mechanism."
 LOAD and SELECTOR work as described in `native--compile-async'."
   ;; Make sure we are not already compiling `file' (bug#40838).
   (or (gethash file comp-async-compilations)
+      (gethash (file-name-with-extension file "elc") comp--no-native-compile)
       (cond
        ((null selector) nil)
        ((functionp selector) (not (funcall selector file)))
index c01c827a75e05251422b54b7abd9acee29614c77..e940a32100c63a6e5b0c89c97fe0fe209acde541 100644 (file)
@@ -501,7 +501,10 @@ lost after dumping")))
                                          bin-dest-dir)
                      ;; Relative filename from the built uninstalled binary.
                      (file-relative-name file invocation-directory)))))
-              comp-loaded-comp-units-h))))
+              comp-loaded-comp-units-h)))
+  ;; Set up the mechanism to allow inhibiting native-comp via
+  ;; file-local variables.
+  (defvar comp--no-native-compile (make-hash-table :test #'equal)))
 
 (when (hash-table-p purify-flag)
   (let ((strings 0)