git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] build: do not automatically reconfigure unless configure.ac changed

From
Stefano Lattarini <stefano.lattarini@gmail.com>
Date
Jan 2, 2013, 19:35 UTC
Message-ID
<50E48BF6.2020900@gmail.com>
In-Reply-To
<7va9sr4jgu.fsf@alter.siamese.dyndns.org>
On 01/02/2013 05:50 PM, Junio C Hamano wrote:
Show 57 quoted lines
> Stefano Lattarini <stefano.lattarini@gmail.com> writes:
> 
>> On 01/02/2013 09:48 AM, Jonathan Nieder wrote:
>>> Jeff King wrote:
>>>
>>>> It seems I am late to the party. But FWIW, this looks the most sane to
>>>> me of the patches posted in this thread.
>>> ...
>> FYI, this seems a sane approach to me....
>> The only nit I have to offer is that I'd like to see more comments in
>> the git Makefile about why this "semi-hack" is needed.
> 
> Thanks, everybody.
> 
> Please eyeball the below for (hopefully) the last time, to be
> eventually merged to maint-1.7.12, maint-1.8.0 and maint (aka
> maint-1.8.1) branches.
> 
> -- >8 --
> From: Jonathan Nieder <jrnieder@gmail.com>
> Date: Wed, 2 Jan 2013 00:25:44 -0800
> Subject: [PATCH] build: do not automatically reconfigure unless configure.ac changed
> 
> Starting with v1.7.12-rc0~4^2 (build: reconfigure automatically if
> configure.ac changes, 2012-07-19), "config.status --recheck" is
> automatically run every time the "configure" script changes.  In
> particular, that means the configuration procedure repeats whenever
> the version number changes (since the configure script changes to
> support "./configure --version" and "./configure --help"), making
> bisecting painfully slow.
> 
> The intent was to make the reconfiguration process only trigger for
> changes to configure.ac's logic.  Tweak the Makefile rule to match
> that intent by depending on configure.ac instead of configure.
> 
> Reported-by: Martin von Zweigbergk <martinvonz@gmail.com>
> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
> Reviewed-by: Jeff King <peff@peff.net>
> Reviewed-by: Stefano Lattarini <stefano.lattarini@gmail.com>
> ---
>  Makefile | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 26b697d..2f5e2ab 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -2167,8 +2167,14 @@ configure: configure.ac GIT-VERSION-FILE
>  	$(RM) $<+
>  
>  ifdef AUTOCONFIGURED
> -config.status: configure
> -	$(QUIET_GEN)if test -f config.status; then \
> +# We avoid depending on 'configure' here, because it gets rebuilt
> +# every time GIT-VERSION-FILE is modified, only to update the embedded
> +# version number string, which config.status does not care about.
>

Alas, config.status *do* care about it, in that the '@PACKAGE_VERSION@', '@PACKAGE_STRING@' and '@DEFS@' substitutions are affected by what is hard-coded in configure as the version number [1]. But if we do not use those substitutions in any of our files (and I believe we don't), then *we* can happily not care about the configure embedded version number string, and thus avoid the extra configure runs. Phew.

 [1] Yes, this is a mess.  We know.  Sorry!
Show 9 quoted lines
> +# We
> +# do want to recheck when the platform/environment detection logic
> +# changes, hence this depends on configure.ac.
> +config.status: configure.ac
> +	$(QUIET_GEN)$(MAKE) configure && \
> +	if test -f config.status; then \
>  	  ./config.status --recheck; \
>  	else \
>  	  ./configure; \
HTH,
  Stefano
Previous: Martin von ZweigbergkNext: Junio C Hamano
Message 10 of 13 in “Makefile dependency from 'configure' to 'GIT-VERSION-FILE'”
  1. Martin von ZweigbergkJan 2, 2013
  2. Jonathan NiederJan 2, 2013
  3. Martin von ZweigbergkJan 2, 2013
  4. build: do not automatically reconfigure unless configure.ac changedJonathan Nieder, Jan 2, 2013
  5. Jeff KingJan 2, 2013
  6. Jonathan NiederJan 2, 2013
  7. Stefano LattariniJan 2, 2013
  8. Junio C HamanoJan 2, 2013
  9. Martin von ZweigbergkJan 2, 2013
  10. Stefano LattariniJan 2, 2013
  11. Junio C HamanoJan 2, 2013
  12. Stefano LattariniJan 2, 2013
  13. Jonathan NiederJan 2, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.