all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: 9106@debbugs.gnu.org, bug-gnulib@gnu.org
Subject: bug#9106: 24.0.50; ./configure causes massive recompilation
Date: Wed, 20 Jul 2011 01:24:44 -0400	[thread overview]
Message-ID: <E1QjPH2-0000Dw-03__8956.30936506695$1311139543$gmane$org@fencepost.gnu.org> (raw)
In-Reply-To: <4E2623CA.8090805@cs.ucla.edu> (message from Paul Eggert on Tue,  19 Jul 2011 17:39:38 -0700)

> Date: Tue, 19 Jul 2011 17:39:38 -0700
> From: Paul Eggert <eggert@cs.ucla.edu>
> Cc: bug-gnulib <bug-gnulib@gnu.org>
> 
> [cc'ing bug-gnulib as it's related; see <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9106>]
> 
> > It used to be the case that if the results of running `configure'
> > didn't change anything of essence, "make" would do nothing.  This
> > worked by producing the generated files under temporary names and by
> > using move-if-change to overwrite the old files if the new ones were
> > different.
> 
> If memory serves, that process is pretty error-prone.  One can't
> simply use move-if-change: one needs a separate time stamp file for
> each file that one is doing the move-if-change trick with.  Otherwise,
> when you run 'make' again, it will cheerfully regenerate all the .h
> files again.

Sorry, I don't see the difficulty.  Perhaps I'm missing something.

The current recipe for producing, e.g., unistd.h from unistd.in.h is
this:

  unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
	  $(AM_V_GEN)rm -f $@-t $@ && \
	  { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
	    sed -e 's|@''GUARD_PREFIX''@|GL|g' \
	    [...]
		-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
	  } > $@-t && \
	  mv $@-t $@

What I'm suggesting is to replace the last command ("mv $@-t $@") with
this:

    move-if-change $@-t $@

That's it.  Make will indeed cheerfully regenerate unistd.h-t, but as
long as that file isn't copied over unistd.h, the source files that
include unistd.h won't be recompiled.  Regeneration of unistd.h-t is
very fast; it's the needless recompilation of the plethora of source
files that include unistd.h that is the problem addressed by this bug
report.

It could be the case that some configure.in wizardry would resolve
this even nicer, by doing a similar move-if-change trick with
config.status (whose being a prerequisite of these header files is the
trigger for their regeneration, IIUC).  That will prevent even the
regeneration itself.  But I don't know if this is possible without too
much effort, so the suggested simpler "band-aid" is good enough for
me.

> Part of the problem is deciding automatically whether a change is
> one "of essence".

I think comparing the old file with the new one, like move-if-change
does, is all that's needed.  There's no requirement to detect changes
that are non-essential, like comments etc. -- if any change is
detected, let the files be recompiled.  Am I missing something?





  parent reply	other threads:[~2011-07-20  5:24 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-17  5:30 bug#9106: 24.0.50; ./configure causes massive recompilation Eli Zaretskii
2011-07-18 17:48 ` Glenn Morris
2011-07-18 18:20   ` Jan Djärv
2011-07-18 18:37     ` Glenn Morris
2011-07-18 18:58       ` Eli Zaretskii
2011-07-18 18:37   ` Eli Zaretskii
2011-07-20  0:39 ` Paul Eggert
     [not found] ` <4E2623CA.8090805@cs.ucla.edu>
2011-07-20  5:24   ` Eli Zaretskii [this message]
     [not found]   ` <E1QjPH2-0000Dw-03@fencepost.gnu.org>
2011-07-20  5:58     ` Paul Eggert
     [not found]     ` <4E266E98.4010901@cs.ucla.edu>
2011-07-20  6:29       ` Eli Zaretskii
     [not found]       ` <E1QjQHq-0003DH-6Q@fencepost.gnu.org>
2011-07-20  6:38         ` Eli Zaretskii
2011-07-20  6:44         ` Ralf Wildenhues
     [not found]         ` <E1QjQQK-0003x0-Db@fencepost.gnu.org>
2011-07-20  6:46           ` Ralf Wildenhues
     [not found]           ` <20110720064623.40890@gmx.net>
2011-07-20  8:48             ` Eli Zaretskii
     [not found] ` <83k4bcvo1f.fsf@gnu.org>
     [not found]   ` <20110720210417.270150@gmx.net>
     [not found]     ` <201107211257.44586.bruno@clisp.org>
2011-07-21 20:59       ` Paul Eggert
     [not found]       ` <4E289329.1020204@cs.ucla.edu>
2011-07-21 21:27         ` Bruno Haible
     [not found]         ` <201107212327.27095.bruno@clisp.org>
2011-07-21 22:00           ` Paul Eggert
     [not found]           ` <4E28A192.6010702@cs.ucla.edu>
2011-07-22  6:14             ` Eli Zaretskii
     [not found]             ` <83zkk6u9ja.fsf@gnu.org>
2011-07-22  8:06               ` Paul Eggert
2011-07-21 22:27       ` Jim Meyering
2022-04-25 10:40 ` Lars Ingebrigtsen
2022-04-25 11:34   ` Eli Zaretskii
2022-04-25 12:10     ` Lars Ingebrigtsen
2022-04-25 13:42       ` Robert Pluim
2022-04-25 14:29         ` Lars Ingebrigtsen
2022-04-25 15:49           ` Robert Pluim
2022-04-25 16:13             ` Eli Zaretskii
2022-04-26 15:43               ` Robert Pluim
2022-05-05  8:33                 ` Robert Pluim

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

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

  git send-email \
    --in-reply-to='E1QjPH2-0000Dw-03__8956.30936506695$1311139543$gmane$org@fencepost.gnu.org' \
    --to=eliz@gnu.org \
    --cc=9106@debbugs.gnu.org \
    --cc=bug-gnulib@gnu.org \
    --cc=eggert@cs.ucla.edu \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.