From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.ciao.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: pdumper bootstrap error Date: Mon, 21 Jan 2019 22:33:22 +0200 Message-ID: <83a7jtagz1.fsf@gnu.org> References: <20190119222558.GA17535@breton.holly.idiocy.org> <20190120105743.GA18274@breton.holly.idiocy.org> <20190121165359.GA50758@breton.holly.idiocy.org> <83imyi9bfm.fsf@gnu.org> <20190121194306.GA61684@breton.holly.idiocy.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.org; posting-host="ciao.gmane.org:195.159.176.228"; logging-data="28647"; mail-complaints-to="usenet@ciao.gmane.org" Cc: eggert@cs.ucla.edu, dancol@dancol.org, emacs-devel@gnu.org To: Alan Third Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 21 21:45:29 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1glgRk-0007Mp-FZ for ged-emacs-devel@m.gmane.org; Mon, 21 Jan 2019 21:45:28 +0100 Original-Received: from localhost ([127.0.0.1]:59809 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glgRj-0004EI-Cf for ged-emacs-devel@m.gmane.org; Mon, 21 Jan 2019 15:45:27 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59134) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glgGK-0003AE-Fu for emacs-devel@gnu.org; Mon, 21 Jan 2019 15:33:41 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:44485) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glgGJ-0000Nw-4O; Mon, 21 Jan 2019 15:33:39 -0500 Original-Received: from [176.228.60.248] (port=1454 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1glgGG-00069H-3V; Mon, 21 Jan 2019 15:33:37 -0500 In-reply-to: <20190121194306.GA61684@breton.holly.idiocy.org> (message from Alan Third on Mon, 21 Jan 2019 19:43:06 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:232577 Archived-At: > Date: Mon, 21 Jan 2019 19:43:06 +0000 > From: Alan Third > Cc: eggert@cs.ucla.edu, dancol@dancol.org, emacs-devel@gnu.org > > > Anyway, is this really TRT? Both emacs$(EXEEXT) and > > bootstrap-emacs$(EXEEXT) are (or should be) identical, so why do you > > need to copy one over the other? It should be a no-op. > > The existing code copies the pdmp file. In Makefile.in, just above the > code I added is the comment: > > ## The dumped Emacs is as functional and more efficient than > ## bootstrap-emacs, so we replace the latter with the former. > > I can see the unexec code path replacing bootstrap-emacs, but the > pdumper code doesn’t. That's expected: with unexec, the dumped Emacs executable is different from bootstrap-emacs, but with pdumper they are identical. That comment is only correct for the unexec case. > Then below that is this: > > ifeq ($(DUMPING),pdumper) > $(pdmp): emacs$(EXEEXT) > LC_ALL=C $(RUN_TEMACS) -batch $(BUILD_DETAILS) -l loadup --temacs=pdump > cp -f $@ $(bootstrap_pdmp) > endif > > which looks very much to me like bootstrap-emacs.pdmp is being replaced > with the new one, which was built using the new temacs. Here’s the output: > > Dumping under the name emacs.pdmp > dumping fingerprint: bc058dbc261d383930761d6e2df83fee5bba2b36bab3d69333b2f5c09c6bfc64 > Dump complete > Byte counts: header=80 hot=10523232 discardable=117216 cold=4485912 > Reloc counts: hot=587886 discardable=4552 > Adding name emacs-27.0.50.71 > Adding name emacs-27.0.50.71.pdmp > cp -f emacs.pdmp bootstrap-emacs.pdmp > > There is no corresponding copy of (t)emacs over bootstrap-emacs, even > though bootstrap-emacs.pdmp has now been built by temacs. Right, because they are (or should be) identical, so the copy would be a waste of cycles. > > I guess I'm saying we should step back and understand better why you > > have a mismatch of the fingerprint. Can you show the last part of the > > build, starting from "CCLD temacs" and all the way till the end, > > without this change? I'd like to understand better how the > > fingerprints come out different (they are identical on my system). > > Here’s the output (the whole thing is in the attachment in the first email > I sent): Thanks. I think I see the problem. Your build lacks one crucial step: > CCLD temacs > [ld warnings elided] > ../build-aux/install-sh -c -d ../etc > rm -f emacs && cp -f temacs emacs > LC_ALL=C ./temacs -batch -l loadup --temacs=pdump > Loading loadup.el (source)... > dump mode: pdump What is missing here is invocation of temacs with --temacs=pbootstrap. Here's how it looks on my system: CCLD temacs.exe /bin/mkdir -p ../etc cp -f temacs.exe bootstrap-emacs.exe rm -f bootstrap-emacs.pdmp ./temacs --batch -l loadup --temacs=pbootstrap Loading loadup.el (source)... dump mode: pbootstrap [...] Finding pointers to doc strings... Finding pointers to doc strings...done Dumping under the name bootstrap-emacs.pdmp dumping fingerprint: 2b248756260d5de08810b0b41d60e6f7411fb4ae16995fa3f7fcfb49907a3a9e Dump complete Byte counts: header=80 hot=6817180 discardable=107200 cold=4235996 Reloc counts: hot=399276 discardable=4862 [...] rm -f emacs.exe && cp -f temacs.exe emacs.exe LC_ALL=C ./temacs -batch -l loadup --temacs=pdump Loading loadup.el (source)... dump mode: pdump The "cp -f temacs.exe bootstrap-emacs.exe" part comes from this rule in src/Makefile: bootstrap-emacs$(EXEEXT): temacs$(EXEEXT) $(MAKE) -C ../lisp update-subdirs ifeq ($(DUMPING),unexec) $(RUN_TEMACS) --batch $(BUILD_DETAILS) -l loadup --temacs=bootstrap ifneq ($(PAXCTL_dumped),) $(PAXCTL_dumped) emacs$(EXEEXT) endif mv -f emacs$(EXEEXT) bootstrap-emacs$(EXEEXT) @: Compile some files earlier to speed up further compilation. $(MAKE) -C ../lisp compile-first EMACS="$(bootstrap_exe)" else @: In the pdumper case, make compile-first after the dump cp -f temacs$(EXEEXT) bootstrap-emacs$(EXEEXT) <<<<<<<<<<<<<<<<< endif and since we have just produced a new temacs, this rule is expected to fire, and produce a new bootstrap-emacs. But on your system, it doesn't. My first suspicion is that this has something to do with time granularity of the filesystem on which you run this: Make doesn't notice that temacs is newer than bootstrap-emacs, so it doesn't remake the latter. Is it possible that the time stamps of temacs and bootstrap-emacs are such that this happens? If so, what kind of filesystem is that? > make[3]: Circular bootstrap-emacs <- temacs dependency dropped. This warning is also worrisome: I don't get it, and I fail to see any such circular dependency in my Makefile. Maybe it's because macuvs.h depends on bootstrap-emacs, and on macOS macuvs.h is indeed used? > Perhaps successful builds are simply ones where it doesn’t need to use > bootstrap-emacs? _Every_ build that rebuilds temacs should also rebuild bootstrap-emacs. That this doesn't happen for you is IMO part of the problem.