[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Skipping unexec via a big .elc file
From: |
Eli Zaretskii |
Subject: |
Re: Skipping unexec via a big .elc file |
Date: |
Sat, 07 Jan 2017 11:40:49 +0200 |
Ken,
I tried to get rid of calling dump-emacs in the raeburn-startup
branch, see the changes below. The resulting code builds and produces
dumped.elc, but then fails to compile the *.el files:
...
Loading d:/gnu/git/emacs/no-unexec/lisp/leim/leim-list.el (source)...
Finding pointers to doc strings...
Finding pointers to doc strings...done
Dumping under the name emacs
Dumping into dumped.elc...preparing...
Dumping into dumped.elc...generating...
Dumping into dumped.elc...printing...
Dumping into dumped.elc...saving...
Dumping into dumped.elc...done
mv -f emacs.exe bootstrap-emacs.exe
make -C ../lisp compile-first EMACS="../src/bootstrap-emacs.exe"
make[2]: Entering directory `/d/gnu/git/emacs/no-unexec/lisp'
ELC emacs-lisp/macroexp.elc
Loading ../src/dumped.elc...
Multiple args to , are not supported: ((\, (quote set-window-parameter)) temp
(\, (quote set-window-parameter)) end)
ELC emacs-lisp/cconv.elc
Loading ../src/dumped.elc...
Multiple args to , are not supported: ((\, (quote set-window-parameter)) temp
(\, (quote set-window-parameter)) end)
This could be related to the fact that the original code produced the
first dumped.elc in the top-level directory, not in src/, and I needed
to fix that, since otherwise bootstrap-emacs would exit immediately
(see the changes below). In the original version, src/dumped.elc was
only produced after all the necessary Lisp files were byte-compiled
already.
So it seems like the current build process on this branch still
somehow depends on a dumped emacs executable, until it byte-compiles
all the preloaded Lisp files, and produces dumped.elc from that. IOW,
the first dumped.elc produced before byte-compiling those files is not
up to the job of running Emacs for byte-compiling Lisp files. How can
we fix that, so that unexec and its call can be really removed from
the sources? Or did I miss something?
Thanks.
diff --git a/lisp/loadup.el b/lisp/loadup.el
index 54d19c1..873d804 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -453,27 +453,30 @@
;; confused people installing Emacs (they'd install the file
;; under the name `xemacs'), and it's inconsistent with every
;; other GNU program's build process.
- (dump-emacs "emacs" "temacs")
- (message "%d pure bytes used" pure-bytes-used)
- ;; Recompute NAME now, so that it isn't set when we dump.
- (if (not (or (eq system-type 'ms-dos)
- ;; Don't bother adding another name if we're just
- ;; building bootstrap-emacs.
- (equal (last command-line-args) '("bootstrap"))))
- (let ((name (concat "emacs-" emacs-version))
- (exe (if (eq system-type 'windows-nt) ".exe" "")))
- (while (string-match "[^-+_.a-zA-Z0-9]+" name)
- (setq name (concat (downcase (substring name 0 (match-beginning
0)))
+ ;; (dump-emacs "emacs" "temacs")
+ ;; (message "%d pure bytes used" pure-bytes-used)
+ (let ((exe (if (memq system-type '(windows-nt ms-dos)) ".exe" "")))
+ (copy-file (expand-file-name (concat "temacs" exe)
invocation-directory)
+ (expand-file-name (concat "emacs" exe) invocation-directory)
+ t)
+ ;; Recompute NAME now, so that it isn't set when we dump.
+ (if (not (or (eq system-type 'ms-dos)
+ ;; Don't bother adding another name if we're just
+ ;; building bootstrap-emacs.
+ (equal (last command-line-args) '("bootstrap"))))
+ (let ((name (concat "emacs-" emacs-version)))
+ (while (string-match "[^-+_.a-zA-Z0-9]+" name)
+ (setq name (concat (downcase (substring name 0
(match-beginning 0)))
"-"
(substring name (match-end 0)))))
- (setq name (concat name exe))
- (message "Adding name %s" name)
- ;; When this runs on Windows, invocation-directory is not
- ;; necessarily the current directory.
- (add-name-to-file (expand-file-name (concat "emacs" exe)
- invocation-directory)
- (expand-file-name name invocation-directory)
- t)))
+ (setq name (concat name exe))
+ (message "Adding name %s" name)
+ ;; When this runs on Windows, invocation-directory is not
+ ;; necessarily the current directory.
+ (add-name-to-file (expand-file-name (concat "emacs" exe)
+ invocation-directory)
+ (expand-file-name name invocation-directory)
+ t))))
(message "Dumping into dumped.elc...preparing...")
;; Dump the current state into a file so we can reload it!
@@ -555,6 +558,7 @@
obarray)
(message "Dumping into dumped.elc...printing...")
(with-current-buffer (generate-new-buffer "dumped.elc")
+ (setq default-directory invocation-directory)
(insert ";address@hidden@address@hidden;;; Compiled\n;;; in Emacs
version "
emacs-version "\n")
(let ((print-circle t)
- Re: Skipping unexec via a big .elc file,
Eli Zaretskii <=
- Re: Skipping unexec via a big .elc file, Ken Raeburn, 2017/01/09
- Re: Skipping unexec via a big .elc file, Stefan Monnier, 2017/01/09
- Re: Skipping unexec via a big .elc file, Andreas Schwab, 2017/01/10
- Re: Skipping unexec via a big .elc file, Eli Zaretskii, 2017/01/10
- Re: Skipping unexec via a big .elc file, Ken Raeburn, 2017/01/11
- Re: Skipping unexec via a big .elc file, Ken Raeburn, 2017/01/12
- Re: Skipping unexec via a big .elc file, Eli Zaretskii, 2017/01/14
- Re: Skipping unexec via a big .elc file, Andreas Schwab, 2017/01/14
- Re: Skipping unexec via a big .elc file, Eli Zaretskii, 2017/01/14
- Re: Skipping unexec via a big .elc file, Alan Mackenzie, 2017/01/14