From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Skipping unexec via a big .elc file Date: Sat, 07 Jan 2017 11:40:49 +0200 Message-ID: <83tw9bb42m.fsf@gnu.org> References: <871szqwu51.fsf@users.sourceforge.net> <831szqhbc2.fsf@gnu.org> <87d1itt79z.fsf_-_@users.sourceforge.net> <7baa18d4-2b09-caa8-005e-29008a383ad1@cs.ucla.edu> <83mvhwrgd5.fsf@gnu.org> <8539f38f-9a11-44c3-4de7-bb974c96206c@cs.ucla.edu> <8360ojpndr.fsf@gnu.org> <83shrnm0k1.fsf@gnu.org> <075B0922-F07A-4FBA-AE71-027E964A5ED4@raeburn.org> <54AAC13A-CF56-4393-A932-DC6CBBF51259@raeburn.org> <3CC6BB36-1794-4202-8243-132E0345B236@raeburn.org> <52BDCC33-546C-4F47-A230-00EBC813B038@raeburn.org> <15CF14CC-C7DE-44BA-AC7D-F0BF1F160979@raeburn.org> <9463F91F-DB82-48E1-BE01-1E2BC8DA0766@raeburn.org> <831swxzbw8.fsf@gnu.org> <83y3z2wphb.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1483782088 2569 195.159.176.226 (7 Jan 2017 09:41:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 7 Jan 2017 09:41:28 +0000 (UTC) Cc: emacs-devel@gnu.org To: raeburn@raeburn.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 07 10:41:17 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cPnUm-0006JV-Jn for ged-emacs-devel@m.gmane.org; Sat, 07 Jan 2017 10:41:04 +0100 Original-Received: from localhost ([::1]:56597 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cPnUq-0002cC-Jk for ged-emacs-devel@m.gmane.org; Sat, 07 Jan 2017 04:41:08 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38163) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cPnUG-0002c6-BC for emacs-devel@gnu.org; Sat, 07 Jan 2017 04:40:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cPnUD-0006no-3x for emacs-devel@gnu.org; Sat, 07 Jan 2017 04:40:32 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45480) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cPnUD-0006nk-0L; Sat, 07 Jan 2017 04:40:29 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2124 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cPnUC-0007Qi-9b; Sat, 07 Jan 2017 04:40:28 -0500 In-reply-to: <83y3z2wphb.fsf@gnu.org> (message from Eli Zaretskii on Mon, 26 Dec 2016 19:48:48 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:211150 Archived-At: 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 ";ELC\^W\^@\^@\^@\n;;; Compiled\n;;; in Emacs version " emacs-version "\n") (let ((print-circle t)