Warn about pdumper not working together with Native Compilation (#14730)

Co-authored-by: Lucius Hu <lebensterben@users.noreply.github.com>
This commit is contained in:
Codruț Constantin Gușoi 2022-02-03 19:36:00 +00:00 committed by GitHub
parent 5ad5c6ef83
commit 3cff14b086
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 7 deletions

View File

@ -23,6 +23,10 @@ The portable dumper is a feature that will be available with Emacs 27. This new
dumper should theoretically work on all the three major OSes: GNU/Linux, macOS
and Windows.
WARNING: pdumper does not work with Native Compilation, so if you get an error
like: =emacs: Trying to load incoherent dumped eln file=, make sure you disable
this.
** Setup
To test the portable dumper with Spacemacs, follow these steps:

View File

@ -104,17 +104,26 @@ the end of the loading of the dump file."
(declare (indent defun))
(if (eq 'dumping spacemacs-dump-mode)
(let ((funcname2 (intern (format "spacemacs//after-dump-%S" funcname))))
`(progn
(defun ,funcname2 nil ,@body)
(add-to-list 'spacemacs-dump-delayed-functions ',funcname2)))
`(progn
(defun ,funcname2 nil ,@body)
(add-to-list 'spacemacs-dump-delayed-functions ',funcname2)))
`(progn ,@body)))
(defun spacemacs/emacs-with-pdumper-set-p ()
"Return non-nil if a portable dumper capable emacs executable is set."
"Return non-nil if a portable dumper capable Emacs executable is set and
native compilation is not in effect."
(and dotspacemacs-enable-emacs-pdumper
(file-exists-p
(locate-file (or dotspacemacs-emacs-pdumper-executable-file "emacs")
exec-path exec-suffixes 'file-executable-p))))
exec-path exec-suffixes 'file-executable-p))
(not (spacemacs/emacs-with-native-compilation-enabled-p))))
(defun spacemacs/emacs-with-native-compilation-enabled-p ()
"Return non-nill if native compilation is enabled."
(and (featurep 'native-compile)
(fboundp 'native-compile-available-p)
(native-compile-available-p)
(not (eql comp-speed -1))))
(defun spacemacs/dump-modes (modes)
"Load given MODES in order to be dumped."

View File

@ -89,9 +89,13 @@ It should only modify the values of Spacemacs settings."
;; This setq-default sexp is an exhaustive list of all the supported
;; spacemacs settings.
(setq-default
;; If non-nil then enable support for the portable dumper. You'll need
;; to compile Emacs 27 from source following the instructions in file
;; If non-nil then enable support for the portable dumper. You'll need to
;; compile Emacs 27 from source following the instructions in file
;; EXPERIMENTAL.org at to root of the git repository.
;;
;; WARNING: pdumper does not work with Native Compilation, so it's disabled
;; regardless of the following setting when native compilation is in effect.
;;
;; (default nil)
dotspacemacs-enable-emacs-pdumper nil