From 856f8b6aeb3d9d699963f26765ca12fc5a2a511e Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 8 May 2021 14:19:53 -0400 Subject: [PATCH] Fix #4995: adapt to renamed comp-* symbols Adapting to native-comp changes on Emacs HEAD. --- core/autoload/sandbox.el | 8 +++++--- core/core.el | 27 +++++++++++++++++++++++---- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/core/autoload/sandbox.el b/core/autoload/sandbox.el index 412e2b8db..ea673fc3d 100644 --- a/core/autoload/sandbox.el +++ b/core/autoload/sandbox.el @@ -83,9 +83,11 @@ package-archives ',package-archives) ;; comp.el (setq comp-deferred-compilation nil - comp-eln-load-path ',(bound-and-true-p comp-eln-load-path) - comp-async-env-modifier-form ',(bound-and-true-p comp-async-env-modifier-form) - comp-deferred-compilation-black-list ',(bound-and-true-p comp-deferred-compilation-black-list)) + native-comp-eln-load-path ',(bound-and-true-p native-comp-eln-load-path) + native-comp-async-env-modifier-form ',(bound-and-true-p comp-async-env-modifier-form) + comp-deferred-compilation-black-list ',(bound-and-true-p comp-deferred-compilation-black-list) + ;; REVIEW Remove me after a couple weeks + comp-eln-load-path ',(bound-and-true-p native-comp-eln-load-path)) ;; (add-hook 'kill-emacs-hook ;; (lambda () ;; (delete-file user-init-file) diff --git a/core/core.el b/core/core.el index 156e4f6c2..a5f7664db 100644 --- a/core/core.el +++ b/core/core.el @@ -153,10 +153,29 @@ users).") ;; ;;; Native Compilation support (http://akrl.sdf.org/gccemacs.html) +;; REVIEW Remove me after a couple weeks. +(when (boundp 'comp-eln-load-path) + (defvaralias 'native-comp-eln-load-path 'comp-eln-load-path) + (defvaralias 'native-comp-warning-on-missing-source 'comp-warning-on-missing-source) + (defvaralias 'native-comp-driver-options 'comp-native-driver-options) + (defvaralias 'native-comp-async-query-on-exit 'comp-async-query-on-exit) + (defvaralias 'native-comp-async-report-warnings-errors 'comp-async-report-warnings-errors) + (defvaralias 'native-comp-async-env-modifier-form 'comp-async-env-modifier-form) + (defvaralias 'native-comp-async-all-done-hook 'comp-async-all-done-hook) + (defvaralias 'native-comp-async-cu-done-functions 'comp-async-cu-done-functions) + (defvaralias 'native-comp-async-jobs-number 'comp-async-jobs-number) + (defvaralias 'native-comp-never-optimize-functions 'comp-never-optimize-functions) + (defvaralias 'native-comp-bootstrap-deny-list 'comp-bootstrap-deny-list) + (defvaralias 'native-comp-always-compile 'comp-always-compile) + (defvaralias 'native-comp-verbose 'comp-verbose) + (defvaralias 'native-comp-debug 'comp-debug) + (defvaralias 'native-comp-speed 'comp-speed) + (defalias 'native-comp-limple-mode #'comp-limple-mode)) + ;; Don't store eln files in ~/.emacs.d/eln-cache (they are likely to be purged ;; when upgrading Doom). -(when (boundp 'comp-eln-load-path) - (add-to-list 'comp-eln-load-path (concat doom-cache-dir "eln/"))) +(when (boundp 'native-comp-eln-load-path) + (add-to-list 'native-comp-eln-load-path (concat doom-cache-dir "eln/"))) (with-eval-after-load 'comp ;; HACK Disable native-compilation for some troublesome packages @@ -170,9 +189,9 @@ users).") ;; Default to using all cores, rather than half of them, since we compile ;; things ahead-of-time in a non-interactive session. (defun doom--comp-use-all-cores-a () - (if (zerop comp-async-jobs-number) + (if (zerop native-comp-async-jobs-number) (setq comp-num-cpus (doom-system-cpus)) - comp-async-jobs-number)) + native-comp-async-jobs-number)) (advice-add #'comp-effective-async-max-jobs :override #'doom--comp-use-all-cores-a))