From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: bug#2151: 23.0.90; Building the 23.0.90 pretest recompiles Lisp files Date: Mon, 02 Feb 2009 11:02:49 -0500 Message-ID: References: Reply-To: Stefan Monnier , 2151@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1233593575 20364 80.91.229.12 (2 Feb 2009 16:52:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 2 Feb 2009 16:52:55 +0000 (UTC) Cc: 2151@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 02 17:54:08 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LU23R-00031s-2Q for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Feb 2009 17:53:49 +0100 Original-Received: from localhost ([127.0.0.1]:56023 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LU228-0002gz-EM for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Feb 2009 11:52:28 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LU1aF-0003fi-21 for bug-gnu-emacs@gnu.org; Mon, 02 Feb 2009 11:23:39 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LU1aB-0003eP-Cq for bug-gnu-emacs@gnu.org; Mon, 02 Feb 2009 11:23:37 -0500 Original-Received: from [199.232.76.173] (port=39992 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LU1aA-0003ds-Ru for bug-gnu-emacs@gnu.org; Mon, 02 Feb 2009 11:23:35 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:39207) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LU1aA-0002kv-6H for bug-gnu-emacs@gnu.org; Mon, 02 Feb 2009 11:23:34 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n12GNVtl022880; Mon, 2 Feb 2009 08:23:31 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n12GA4gH019446; Mon, 2 Feb 2009 08:10:04 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Stefan Monnier Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Mon, 02 Feb 2009 16:10:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 2151 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 2151-submit@emacsbugs.donarmstrong.com id=B2151.123359057917205 (code B ref 2151); Mon, 02 Feb 2009 16:10:04 +0000 Original-Received: (at 2151) by emacsbugs.donarmstrong.com; 2 Feb 2009 16:02:59 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from ironport2-out.teksavvy.com (ironport2-out.pppoe.ca [206.248.154.182]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n12G2tge017196 for <2151@emacsbugs.donarmstrong.com>; Mon, 2 Feb 2009 08:02:56 -0800 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AswEAByohknO+IQk/2dsb2JhbACBbslChBQGgmw X-IronPort-AV: E=Sophos;i="4.37,365,1231131600"; d="scan'208";a="33203468" Original-Received: from 206-248-132-36.dsl.teksavvy.com (HELO pastel.home) ([206.248.132.36]) by ironport2-out.teksavvy.com with ESMTP; 02 Feb 2009 11:02:50 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id B111A8229; Mon, 2 Feb 2009 11:02:49 -0500 (EST) In-Reply-To: (Eli Zaretskii's message of "Mon, 02 Feb 2009 01:03:52 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Mon, 02 Feb 2009 11:23:37 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:24834 gmane.emacs.pretest.bugs:23825 Archived-At: > Building the pretest recompiles many Lisp files, which it shouldn't IMO. > Looking at the Makefile's, I think the problem is in this snippet from > src/Makefile.in (near the end): > /* Since the .el.elc rule cannot specify an extra dependency, we do it here. */ > ${lisp} ${SOME_MACHINE_LISP}: $(BOOTSTRAPEMACS) > ${lispsource}loaddefs.el: $(BOOTSTRAPEMACS) > cd ../lisp; $(MAKE) $(MFLAGS) autoloads EMACS=../src/bootstrap-emacs${EXEEXT} > /* Dump an Emacs executable named bootstrap-emacs containing the > files from loadup.el in source form. */ > bootstrap-emacs${EXEEXT}: temacs${EXEEXT} > cd ../lisp; $(MAKE) $(MFLAGS) update-subdirs > #ifdef CANNOT_DUMP > ln -f temacs${EXEEXT} bootstrap-emacs${EXEEXT} > #else > $(RUN_TEMACS) --batch --load loadup bootstrap > mv -f emacs${EXEEXT} bootstrap-emacs${EXEEXT} > #endif /* ! defined (CANNOT_DUMP) */ > @: Compile some files earlier to speed up further compilation. > cd ../lisp; $(MAKE) $(MFLAGS) compile-first EMACS=../src/bootstrap-emacs${EXEEXT} > It goes like this: since temacs is built, the last rule says to > produce bootstrap-emacs${EXEEXT}. The new bootstrap-emacs then > triggers the 2 rules before it, which rebuild loaddefs.el and > recompile the Lisp files in ${lisp} and ${SOME_MACHINE_LISP}. I think we have to live with this for now. Getting make to understand the nature of the dependencies here is pretty tricky, so you can get it to work right for the tarball or you can get it to work right for the "cvs update" case, but it's pretty painful to get it to work right in both cases. I'd be tempted to remove the .elc files that get rebuilt anyway. This will bring the two cases closer to each other, which can only help us waste less time on this. Stefan PS: Part of the problem, as far as I understand it, is that we need the .elc files to depend on bootstrap-emacs so as to tell `make' to build bootstrap-emacs when needed, but we don't actually need the .elc files to be newer than bootstrap-emacs (in some rare cases a newer bootstrap-emacs will compile the .el differently, but in general it's not the case). But `make' doesn't have such a concept of a dependency that "needs to exist, but doesn't need to be older". PPS: I guess we could get it to work better if the toplevel Makefile.in were changed so as to call "cd src; make bootstrap-emacs" first and then "cd src; make" as a separate step. E.g. along the lines of the barely tested patch below. === modified file 'Makefile.in' --- Makefile.in 2009-01-09 16:56:04 +0000 +++ Makefile.in 2009-02-02 16:01:10 +0000 @@ -320,6 +320,12 @@ # We need to build `emacs' in `src' to compile the *.elc files in `lisp'. lisp: src +# These targets should be "${SUBDIR} without `src'". +lib-src lisp: Makefile FRC + cd $@; $(MAKE) all $(MFLAGS) \ + CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \ + LDFLAGS='${LDFLAGS}' MAKE='${MAKE}' + # Pass to src/Makefile.in an additional BOOTSTRAPEMACS variable which # is either set to bootstrap-emacs (in case bootstrap-emacs has not been # constructed yet) or the empty string (otherwise). @@ -329,12 +335,16 @@ # file src/foo.c forces dumping a new bootstrap-emacs, then re-byte-compiling # all preloaded elisp files, and only then dump the actual src/emacs, which # is not wrong, but is overkill in 99.99% of the cases. -${SUBDIR}: Makefile FRC +src: Makefile FRC boot=bootstrap-emacs$(EXEEXT); \ - if [ -x "src/$$boot" ]; then boot=""; fi; \ + if [ ! -x "src/$$boot" ]; then \ + cd $@; $(MAKE) all $(MFLAGS) \ + CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \ + LDFLAGS='${LDFLAGS}' MAKE='${MAKE}' BOOTSTRAPEMACS="$$boot"; \ + fi; \ cd $@; $(MAKE) all $(MFLAGS) \ CC='${CC}' CFLAGS='${CFLAGS}' CPPFLAGS='${CPPFLAGS}' \ - LDFLAGS='${LDFLAGS}' MAKE='${MAKE}' BOOTSTRAPEMACS="$$boot" + LDFLAGS='${LDFLAGS}' MAKE='${MAKE}' BOOTSTRAPEMACS="" blessmail: Makefile src FRC cd lib-src; $(MAKE) maybe-blessmail $(MFLAGS) \