unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 2151@emacsbugs.donarmstrong.com, emacs-pretest-bug@gnu.org
Subject: bug#2151: 23.0.90; Building the 23.0.90 pretest recompiles Lisp files
Date: Mon, 02 Feb 2009 11:02:49 -0500	[thread overview]
Message-ID: <jwvbptk7skr.fsf-monnier+emacsbugreports@gnu.org> (raw)
In-Reply-To: <E1LTruS-0007aY-4Y@fencepost.gnu.org> (Eli Zaretskii's message of "Mon, 02 Feb 2009 01:03:52 -0500")

> 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) \








  reply	other threads:[~2009-02-02 16:02 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-02  6:03 bug#2151: 23.0.90; Building the 23.0.90 pretest recompiles Lisp files Eli Zaretskii
2009-02-02 16:02 ` Stefan Monnier [this message]
2009-02-02 20:42   ` Eli Zaretskii
2009-02-03 21:24     ` Stefan Monnier
2009-02-04  4:25       ` Eli Zaretskii
2009-02-04 19:51         ` Stefan Monnier
2009-02-21 16:10           ` Eli Zaretskii
2009-02-21 20:54             ` Stefan Monnier
2009-02-21 22:33               ` Eli Zaretskii
2009-02-21 22:49                 ` Stefan Monnier
2009-02-22  4:07                   ` Eli Zaretskii
2009-02-27 15:02                     ` Eli Zaretskii
2009-02-27 22:18                       ` Eli Zaretskii
2009-02-27 23:21                         ` Glenn Morris
2009-02-28 11:12                           ` Eli Zaretskii
2009-02-28  4:48                       ` Stefan Monnier
2009-02-28 10:41                         ` Eli Zaretskii
2009-02-28 22:06                           ` Stefan Monnier
2009-02-28 22:11                             ` Eli Zaretskii
2009-05-01 19:07                             ` Eli Zaretskii
2011-09-11 21:12                               ` Lars Magne Ingebrigtsen
2011-09-11 21:50                                 ` Chong Yidong
2014-06-27  0:42                                   ` Glenn Morris
2014-06-27  5:55                                     ` Eli Zaretskii
2009-02-22 18:19               ` Kevin Rodgers
2009-02-02 21:25   ` Magnus Henoch
2009-02-02 21:55     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvbptk7skr.fsf-monnier+emacsbugreports@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=2151@emacsbugs.donarmstrong.com \
    --cc=eliz@gnu.org \
    --cc=emacs-pretest-bug@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).