{"thread":{"id":"32507","subject":"Makefile dependency from 'configure' to 'GIT-VERSION-FILE'","startedAt":"2013-01-02T01:11:37Z","lastAt":"2013-01-02T20:53:40Z","messageCount":13,"participants":["Martin von Zweigbergk","Jonathan Nieder","Jeff King","Stefano Lattarini","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"205821","messageId":"CANiSa6jt7_ixi7L6U9sfpV2mvT_7zgYV+m+sLiXjkDsFehAuwA@mail.gmail.com","threadId":"32507","inReplyTo":null,"subject":"Makefile dependency from 'configure' to 'GIT-VERSION-FILE'","fromName":"Martin von Zweigbergk","fromEmail":"martinvonz@gmail.com","sentAt":"2013-01-02T01:11:37Z","receivedAt":"2013-01-02T01:11:37Z","isPatch":false,"sender":{"key":"martinvonz@gmail.com","avatar":"https://avatars.githubusercontent.com/u/891642?v=4"},"body":"Hi,\n\nI use autoconf with git.git. I have noticed lately, especially when\ndoing things like \"git rebase -i --exec make\", that ./configure is run\nevery time. If I understand correctly, this is because of 8242ff4\n(build: reconfigure automatically if configure.ac changes,\n2012-07-19). Just a few days before that commit, on 2012-07-15, the\nbranch jn/makefile-cleanup including 520a6cd (Makefile: move\nGIT-VERSION-FILE dependencies closer to use, 2012-06-20) was merged\n(to next?). I wonder if these two subjects were aware of each other.\n\nThe reason 'configure' depends on GIT-VERSION-FILE is because it\ninserts the version into the call to AC_INIT. I have close to no\nexperience with autoconf or even make and it's not at all clear to me\nwhy we need to pass the verison to AC_INIT. It seems like it's just\nfor messages printed by ./configure. If that's the case, we shouldn't\nneed to generate a new 'configure' file ever time. At the very least,\nwe shouldn't need to run it.\n\nDo you think we should simply remove the dependency from 'configure'\nto 'GIT-VERSION-FILE' and leave a comment there instead? Or should we\ninstead somehow make 'reconfigure' depend only on 'configure.ac'? Both\nof these feel a little wrong to me, because they would remove real\ndependencies. Maybe the (probably mangled) patch at the end of this\nmessage is better?\n\nMartin\n\n\ndiff --git a/Makefile b/Makefile\nindex 736ecd4..ec5d7ca 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2267,12 +2267,9 @@ $(patsubst %.py,%,$(SCRIPT_PYTHON)): % : unimplemented.sh\n        mv $@+ $@\n endif # NO_PYTHON\n\n-configure: configure.ac GIT-VERSION-FILE\n-       $(QUIET_GEN)$(RM) $@ $<+ && \\\n-       sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \\\n-           $< > $<+ && \\\n-       autoconf -o $@ $<+ && \\\n-       $(RM) $<+\n+configure: configure.ac\n+       $(QUIET_GEN)$(RM) $@ && \\\n+       autoconf -o $@ $<\n\n ifdef AUTOCONFIGURED\n config.status: configure\ndiff --git a/configure.ac b/configure.ac\nindex ad215cc..00c3e38 100644\n--- a/configure.ac\n+++ b/configure.ac\n@@ -142,7 +142,10 @@ fi\n ## Configure body starts here.\n\n AC_PREREQ(2.59)\n-AC_INIT([git], [@@GIT_VERSION@@], [git@vger.kernel.org])\n+AC_INIT([git],\n+       m4_esyscmd([ ./GIT-VERSION-GEN &&\n+                    { sed -ne 's/GIT_VERSION = //p' GIT-VERSION-FILE\n| xargs echo -n; } ]),\n+       [git@vger.kernel.org])\n\n AC_CONFIG_SRCDIR([git.c])\n"},{"id":"205838","messageId":"20130102072141.GB18974@elie.Belkin","threadId":"32507","inReplyTo":"CANiSa6jt7_ixi7L6U9sfpV2mvT_7zgYV+m+sLiXjkDsFehAuwA@mail.gmail.com","subject":"Re: Makefile dependency from 'configure' to 'GIT-VERSION-FILE'","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2013-01-02T07:21:41Z","receivedAt":"2013-01-02T07:21:41Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi Martin,\n\nMartin von Zweigbergk wrote:\n\n> I use autoconf with git.git. I have noticed lately, especially when\n> doing things like \"git rebase -i --exec make\", that ./configure is run\n> every time. If I understand correctly, this is because of 8242ff4\n> (build: reconfigure automatically if configure.ac changes,\n> 2012-07-19).\n\nHow about this patch (untested)?\n\n-- >8 --\nSubject: build: do not automatically reconfigure unless configure.ac changed\n\nStarting with v1.7.12-rc0~4^2 (build: reconfigure automatically if\nconfigure.ac changes, 2012-07-19), \"config.status --recheck\" is\nautomatically run every time the \"configure\" script changes.  In\nparticular, that means the configuration procedure repeats whenever\nthe version number changes (since the configure script changes to\nsupport \"./configure --version\" and \"./configure --help\"), making\nbisecting painfully slow.\n\nThe intent was to make the reconfiguration process only trigger for\nchanges to configure.ac's logic.  Tweak the Makefile rule to match\nthat intent by depending on configure.ac instead of configure.\n\nReported-by: Martin von Zweigbergk <martinvonz@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n[...]\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -2267,12 +2267,9 @@ $(patsubst %.py,%,$(SCRIPT_PYTHON)): % : unimplemented.sh\n>         mv $@+ $@\n>  endif # NO_PYTHON\n> \n> -configure: configure.ac GIT-VERSION-FILE\n> +configure: configure.ac\n[...]\n> --- a/configure.ac\n> +++ b/configure.ac\n> @@ -142,7 +142,10 @@ fi\n>  ## Configure body starts here.\n> \n>  AC_PREREQ(2.59)\n> -AC_INIT([git], [@@GIT_VERSION@@], [git@vger.kernel.org])\n> +AC_INIT([git],\n> +       m4_esyscmd([ ./GIT-VERSION-GEN &&\n> +                    { sed -ne 's/GIT_VERSION = //p' GIT-VERSION-FILE | xargs echo -n; } ]),\n> +       [git@vger.kernel.org])\n\nI don't think that would warrant dropping the GIT-VERSION-FILE\ndependency, since the resulting configure script still hard-codes the\nversion number.\n\nSane?\n\n Makefile | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Makefile b/Makefile\nindex 736ecd45..2a22041f 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2275,7 +2275,7 @@ configure: configure.ac GIT-VERSION-FILE\n \t$(RM) $<+\n \n ifdef AUTOCONFIGURED\n-config.status: configure\n+config.status: configure.ac\n \t$(QUIET_GEN)if test -f config.status; then \\\n \t  ./config.status --recheck; \\\n \telse \\\n-- \n1.8.1\n"},{"id":"205840","messageId":"CANiSa6iMea95ELqS3-w01bL=LTgE9Cx6+8sXK=s-pPPFwjGCCA@mail.gmail.com","threadId":"32507","inReplyTo":"20130102072141.GB18974@elie.Belkin","subject":"Re: Makefile dependency from 'configure' to 'GIT-VERSION-FILE'","fromName":"Martin von Zweigbergk","fromEmail":"martinvonz@gmail.com","sentAt":"2013-01-02T07:47:19Z","receivedAt":"2013-01-02T07:47:19Z","isPatch":false,"sender":{"key":"martinvonz@gmail.com","avatar":"https://avatars.githubusercontent.com/u/891642?v=4"},"body":"On Tue, Jan 1, 2013 at 11:21 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n>\n> How about this patch (untested)?\n\nLooks good. Thanks!\n\n>> --- a/Makefile\n>> +++ b/Makefile\n>> @@ -2267,12 +2267,9 @@ $(patsubst %.py,%,$(SCRIPT_PYTHON)): % : unimplemented.sh\n>>         mv $@+ $@\n>>  endif # NO_PYTHON\n>>\n>> -configure: configure.ac GIT-VERSION-FILE\n>> +configure: configure.ac\n> [...]\n>> --- a/configure.ac\n>> +++ b/configure.ac\n>> @@ -142,7 +142,10 @@ fi\n>>  ## Configure body starts here.\n>>\n>>  AC_PREREQ(2.59)\n>> -AC_INIT([git], [@@GIT_VERSION@@], [git@vger.kernel.org])\n>> +AC_INIT([git],\n>> +       m4_esyscmd([ ./GIT-VERSION-GEN &&\n>> +                    { sed -ne 's/GIT_VERSION = //p' GIT-VERSION-FILE | xargs echo -n; } ]),\n>> +       [git@vger.kernel.org])\n>\n> I don't think that would warrant dropping the GIT-VERSION-FILE\n> dependency, since the resulting configure script still hard-codes the\n> version number.\n\nYeah, you're right. I was merely sweeping the dependency under the rug :-(\n\n>\n> diff --git a/Makefile b/Makefile\n> index 736ecd45..2a22041f 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -2275,7 +2275,7 @@ configure: configure.ac GIT-VERSION-FILE\n>         $(RM) $<+\n>\n>  ifdef AUTOCONFIGURED\n> -config.status: configure\n> +config.status: configure.ac\n>         $(QUIET_GEN)if test -f config.status; then \\\n>           ./config.status --recheck; \\\n>         else \\\n\nThe next line just outside the context here does depend on\n'configure', which is why I thought this would not be right. But it\nseems impossible to get away from that, and AUTOCONFIGURED should only\nbe set when ./configure has been run (IIUC), so it's not even\nrealistic to have \"git reconfigure\" fail to find \"./configure\". So,\nagain, looks good.\n"},{"id":"205844","messageId":"20130102082544.GD18974@elie.Belkin","threadId":"32507","inReplyTo":"CANiSa6iMea95ELqS3-w01bL=LTgE9Cx6+8sXK=s-pPPFwjGCCA@mail.gmail.com","subject":"[PATCH v2] build: do not automatically reconfigure unless configure.ac changed","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2013-01-02T08:25:44Z","receivedAt":"2013-01-02T08:25:44Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Starting with v1.7.12-rc0~4^2 (build: reconfigure automatically if\nconfigure.ac changes, 2012-07-19), configure is automatically run\nevery time the \"configure\" script changes.  In particular, that\nmeans configure is automatically rerun whenever the version number\nchanges (which changes the configure script to support \"./configure\n--helpe\"), which makes bisecting painfully slow.\n\nThe intent was to make the reconfiguration process only trigger for\nchanges to configure.ac's logic.  Tweak the Makefile rule to match\nthat intent by depending on configure.ac instead of configure.\n\nReported-by: Martin von Zweigbergk <martinvonz@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\nMartin von Zweigbergk wrote:\n\n> The next line just outside the context here does depend on\n> 'configure', which is why I thought this would not be right.\n\nYes, the 'configure' script that is run needs to reflect the changes\nto configure.ac.  Hopefully this version will work better.\n\n Makefile | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/Makefile b/Makefile\nindex 736ecd45..be3bbcd4 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2275,10 +2275,11 @@ configure: configure.ac GIT-VERSION-FILE\n \t$(RM) $<+\n \n ifdef AUTOCONFIGURED\n-config.status: configure\n+config.status: configure.ac\n \t$(QUIET_GEN)if test -f config.status; then \\\n \t  ./config.status --recheck; \\\n \telse \\\n+\t  $(MAKE) configure && \\\n \t  ./configure; \\\n \tfi\n reconfigure config.mak.autogen: config.status\n-- \n1.8.1\n"},{"id":"205845","messageId":"20130102083837.GA9328@sigill.intra.peff.net","threadId":"32507","inReplyTo":"20130102082544.GD18974@elie.Belkin","subject":"Re: [PATCH v2] build: do not automatically reconfigure unless configure.ac changed","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-01-02T08:38:37Z","receivedAt":"2013-01-02T08:38:37Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Jan 02, 2013 at 12:25:44AM -0800, Jonathan Nieder wrote:\n\n> Starting with v1.7.12-rc0~4^2 (build: reconfigure automatically if\n> configure.ac changes, 2012-07-19), configure is automatically run\n> every time the \"configure\" script changes.  In particular, that\n> means configure is automatically rerun whenever the version number\n> changes (which changes the configure script to support \"./configure\n> --helpe\"), which makes bisecting painfully slow.\n> \n> The intent was to make the reconfiguration process only trigger for\n> changes to configure.ac's logic.  Tweak the Makefile rule to match\n> that intent by depending on configure.ac instead of configure.\n\nIt seems I am late to the party. But FWIW, this looks the most sane to\nme of the patches posted in this thread.\n\n-Peff\n"},{"id":"205846","messageId":"20130102084248.GA22919@elie.Belkin","threadId":"32507","inReplyTo":"20130102082544.GD18974@elie.Belkin","subject":"Re: [PATCH v2] build: do not automatically reconfigure unless configure.ac changed","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2013-01-02T08:42:48Z","receivedAt":"2013-01-02T08:42:48Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Jonathan Nieder wrote:\n\n> Starting with v1.7.12-rc0~4^2 (build: reconfigure automatically if\n> configure.ac changes, 2012-07-19), configure is automatically run\n> every time the \"configure\" script changes.  In particular, that\n> means configure is automatically rerun whenever the version number\n> changes (which changes the configure script to support \"./configure\n> --helpe\")\n\nGah, I sent the log commit message --- the patch description from v1\nis the right one.  Sorry for the trouble.  Here is the fixed\ndescription again.\n\nSubject: build: do not automatically reconfigure unless configure.ac changed\n\nStarting with v1.7.12-rc0~4^2 (build: reconfigure automatically if\nconfigure.ac changes, 2012-07-19), \"config.status --recheck\" is\nautomatically run every time the \"configure\" script changes.  In\nparticular, that means the configuration procedure repeats whenever\nthe version number changes (since the configure script changes to\nsupport \"./configure --version\" and \"./configure --help\"), making\nbisecting painfully slow.\n\nThe intent was to make the reconfiguration process only trigger for\nchanges to configure.ac's logic.  Tweak the Makefile rule to match\nthat intent by depending on configure.ac instead of configure.\n\nReported-by: Martin von Zweigbergk <martinvonz@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n"},{"id":"205847","messageId":"20130102084807.GB22919@elie.Belkin","threadId":"32507","inReplyTo":"20130102083837.GA9328@sigill.intra.peff.net","subject":"Re: [PATCH v2] build: do not automatically reconfigure unless configure.ac changed","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2013-01-02T08:48:07Z","receivedAt":"2013-01-02T08:48:07Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Jeff King wrote:\n\n> It seems I am late to the party. But FWIW, this looks the most sane to\n> me of the patches posted in this thread.\n\nThanks.  config.status runs ./configure itself, though, so the rule\nshould actually be\n\n\tconfig.status: configure.ac\n\t\t$(QUIET_GEN)$(MAKE) configure && \\\n\t\tif test -f config.status; then \\\n\t\t  ./config.status --recheck; \\\n\t\telse \\\n\t\t  ./configure;\n\t\tfi\n\nRather than screw it up yet again, I'm going to sleep. :)  If someone\nelse corrects the patch before tomorrow, I won't mind.\n"},{"id":"205855","messageId":"50E4409B.4070203@gmail.com","threadId":"32507","inReplyTo":"20130102084807.GB22919@elie.Belkin","subject":"Re: [PATCH v2] build: do not automatically reconfigure unless configure.ac changed","fromName":"Stefano Lattarini","fromEmail":"stefano.lattarini@gmail.com","sentAt":"2013-01-02T14:13:47Z","receivedAt":"2013-01-02T14:13:47Z","isPatch":true,"sender":{"key":"stefano.lattarini@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1429199?v=4"},"body":"On 01/02/2013 09:48 AM, Jonathan Nieder wrote:\n> Jeff King wrote:\n> \n>> It seems I am late to the party. But FWIW, this looks the most sane to\n>> me of the patches posted in this thread.\n> \n> Thanks.  config.status runs ./configure itself, though, so the rule\n> should actually be\n> \n> \tconfig.status: configure.ac\n> \t\t$(QUIET_GEN)$(MAKE) configure && \\\n> \t\tif test -f config.status; then \\\n> \t\t  ./config.status --recheck; \\\n> \t\telse \\\n> \t\t  ./configure;\n> \t\tfi\n> \n> Rather than screw it up yet again, I'm going to sleep. :)  If someone\n> else corrects the patch before tomorrow, I won't mind.\n>\nFYI, this seems a sane approach to me.  At least until Autoconf is\nimproved to offer better (read: some :-) support to \"dynamic\" package\nversion numbers specified at configure runtime.  I hope that day\nisn't too far, since the current Autoconf limitation has been causing\nits share of annoyances small woes in Automake and Gnulib as well.\n\nThe only nit I have to offer is that I'd like to see more comments in\nthe git Makefile about why this \"semi-hack\" is needed.\n\nThanks,\n  Stefano\n"},{"id":"205867","messageId":"7va9sr4jgu.fsf@alter.siamese.dyndns.org","threadId":"32507","inReplyTo":"50E4409B.4070203@gmail.com","subject":"Re: [PATCH v2] build: do not automatically reconfigure unless configure.ac changed","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-02T16:50:57Z","receivedAt":"2013-01-02T16:50:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stefano Lattarini <stefano.lattarini@gmail.com> writes:\n\n> On 01/02/2013 09:48 AM, Jonathan Nieder wrote:\n>> Jeff King wrote:\n>> \n>>> It seems I am late to the party. But FWIW, this looks the most sane to\n>>> me of the patches posted in this thread.\n>> ...\n> FYI, this seems a sane approach to me....\n> The only nit I have to offer is that I'd like to see more comments in\n> the git Makefile about why this \"semi-hack\" is needed.\n\nThanks, everybody.\n\nPlease eyeball the below for (hopefully) the last time, to be\neventually merged to maint-1.7.12, maint-1.8.0 and maint (aka\nmaint-1.8.1) branches.\n\n-- >8 --\nFrom: Jonathan Nieder <jrnieder@gmail.com>\nDate: Wed, 2 Jan 2013 00:25:44 -0800\nSubject: [PATCH] build: do not automatically reconfigure unless configure.ac changed\n\nStarting with v1.7.12-rc0~4^2 (build: reconfigure automatically if\nconfigure.ac changes, 2012-07-19), \"config.status --recheck\" is\nautomatically run every time the \"configure\" script changes.  In\nparticular, that means the configuration procedure repeats whenever\nthe version number changes (since the configure script changes to\nsupport \"./configure --version\" and \"./configure --help\"), making\nbisecting painfully slow.\n\nThe intent was to make the reconfiguration process only trigger for\nchanges to configure.ac's logic.  Tweak the Makefile rule to match\nthat intent by depending on configure.ac instead of configure.\n\nReported-by: Martin von Zweigbergk <martinvonz@gmail.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\nReviewed-by: Jeff King <peff@peff.net>\nReviewed-by: Stefano Lattarini <stefano.lattarini@gmail.com>\n---\n Makefile | 10 ++++++++--\n 1 file changed, 8 insertions(+), 2 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 26b697d..2f5e2ab 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2167,8 +2167,14 @@ configure: configure.ac GIT-VERSION-FILE\n \t$(RM) $<+\n \n ifdef AUTOCONFIGURED\n-config.status: configure\n-\t$(QUIET_GEN)if test -f config.status; then \\\n+# We avoid depending on 'configure' here, because it gets rebuilt\n+# every time GIT-VERSION-FILE is modified, only to update the embedded\n+# version number string, which config.status does not care about.  We\n+# do want to recheck when the platform/environment detection logic\n+# changes, hence this depends on configure.ac.\n+config.status: configure.ac\n+\t$(QUIET_GEN)$(MAKE) configure && \\\n+\tif test -f config.status; then \\\n \t  ./config.status --recheck; \\\n \telse \\\n \t  ./configure; \\\n-- \n1.8.1.200.gd2acdf2\n"},{"id":"205868","messageId":"CANiSa6gqG_tBja_SyLSR5HCphaV7PYAk=ScXDdSk4VWpd-8uMw@mail.gmail.com","threadId":"32507","inReplyTo":"7va9sr4jgu.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v2] build: do not automatically reconfigure unless configure.ac changed","fromName":"Martin von Zweigbergk","fromEmail":"martinvonz@gmail.com","sentAt":"2013-01-02T17:07:11Z","receivedAt":"2013-01-02T17:07:11Z","isPatch":true,"sender":{"key":"martinvonz@gmail.com","avatar":"https://avatars.githubusercontent.com/u/891642?v=4"},"body":"> diff --git a/Makefile b/Makefile\n> index 26b697d..2f5e2ab 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -2167,8 +2167,14 @@ configure: configure.ac GIT-VERSION-FILE\n>         $(RM) $<+\n>\n>  ifdef AUTOCONFIGURED\n> -config.status: configure\n> -       $(QUIET_GEN)if test -f config.status; then \\\n> +# We avoid depending on 'configure' here, because it gets rebuilt\n> +# every time GIT-VERSION-FILE is modified, only to update the embedded\n> +# version number string, which config.status does not care about.  We\n> +# do want to recheck when the platform/environment detection logic\n> +# changes, hence this depends on configure.ac.\n> +config.status: configure.ac\n> +       $(QUIET_GEN)$(MAKE) configure && \\\n> +       if test -f config.status; then \\\n>           ./config.status --recheck; \\\n>         else \\\n>           ./configure; \\\n\nLooks great (at least from my 'make'-incompetent point of view :-)). I\ndo appreciate the comment. Thanks, everyone.\n"},{"id":"205876","messageId":"50E48BF6.2020900@gmail.com","threadId":"32507","inReplyTo":"7va9sr4jgu.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v2] build: do not automatically reconfigure unless configure.ac changed","fromName":"Stefano Lattarini","fromEmail":"stefano.lattarini@gmail.com","sentAt":"2013-01-02T19:35:18Z","receivedAt":"2013-01-02T19:35:18Z","isPatch":true,"sender":{"key":"stefano.lattarini@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1429199?v=4"},"body":"On 01/02/2013 05:50 PM, Junio C Hamano wrote:\n> Stefano Lattarini <stefano.lattarini@gmail.com> writes:\n> \n>> On 01/02/2013 09:48 AM, Jonathan Nieder wrote:\n>>> Jeff King wrote:\n>>>\n>>>> It seems I am late to the party. But FWIW, this looks the most sane to\n>>>> me of the patches posted in this thread.\n>>> ...\n>> FYI, this seems a sane approach to me....\n>> The only nit I have to offer is that I'd like to see more comments in\n>> the git Makefile about why this \"semi-hack\" is needed.\n> \n> Thanks, everybody.\n> \n> Please eyeball the below for (hopefully) the last time, to be\n> eventually merged to maint-1.7.12, maint-1.8.0 and maint (aka\n> maint-1.8.1) branches.\n> \n> -- >8 --\n> From: Jonathan Nieder <jrnieder@gmail.com>\n> Date: Wed, 2 Jan 2013 00:25:44 -0800\n> Subject: [PATCH] build: do not automatically reconfigure unless configure.ac changed\n> \n> Starting with v1.7.12-rc0~4^2 (build: reconfigure automatically if\n> configure.ac changes, 2012-07-19), \"config.status --recheck\" is\n> automatically run every time the \"configure\" script changes.  In\n> particular, that means the configuration procedure repeats whenever\n> the version number changes (since the configure script changes to\n> support \"./configure --version\" and \"./configure --help\"), making\n> bisecting painfully slow.\n> \n> The intent was to make the reconfiguration process only trigger for\n> changes to configure.ac's logic.  Tweak the Makefile rule to match\n> that intent by depending on configure.ac instead of configure.\n> \n> Reported-by: Martin von Zweigbergk <martinvonz@gmail.com>\n> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>\n> Reviewed-by: Jeff King <peff@peff.net>\n> Reviewed-by: Stefano Lattarini <stefano.lattarini@gmail.com>\n> ---\n>  Makefile | 10 ++++++++--\n>  1 file changed, 8 insertions(+), 2 deletions(-)\n> \n> diff --git a/Makefile b/Makefile\n> index 26b697d..2f5e2ab 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -2167,8 +2167,14 @@ configure: configure.ac GIT-VERSION-FILE\n>  \t$(RM) $<+\n>  \n>  ifdef AUTOCONFIGURED\n> -config.status: configure\n> -\t$(QUIET_GEN)if test -f config.status; then \\\n> +# We avoid depending on 'configure' here, because it gets rebuilt\n> +# every time GIT-VERSION-FILE is modified, only to update the embedded\n> +# version number string, which config.status does not care about.\n>\nAlas, config.status *do* care about it, in that the '@PACKAGE_VERSION@',\n'@PACKAGE_STRING@' and '@DEFS@' substitutions are affected by what is\nhard-coded in configure as the version number [1].  But if we do not\nuse those substitutions in any of our files (and I believe we don't),\nthen *we* can happily not care about the configure embedded version\nnumber string, and thus avoid the extra configure runs.  Phew.\n\n [1] Yes, this is a mess.  We know.  Sorry!\n\n> +# We\n> +# do want to recheck when the platform/environment detection logic\n> +# changes, hence this depends on configure.ac.\n> +config.status: configure.ac\n> +\t$(QUIET_GEN)$(MAKE) configure && \\\n> +\tif test -f config.status; then \\\n>  \t  ./config.status --recheck; \\\n>  \telse \\\n>  \t  ./configure; \\\n\nHTH,\n  Stefano\n"},{"id":"205878","messageId":"7vbod72uze.fsf@alter.siamese.dyndns.org","threadId":"32507","inReplyTo":"50E48BF6.2020900@gmail.com","subject":"Re: [PATCH v2] build: do not automatically reconfigure unless configure.ac changed","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-02T20:25:09Z","receivedAt":"2013-01-02T20:25:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stefano Lattarini <stefano.lattarini@gmail.com> writes:\n\n>>  ifdef AUTOCONFIGURED\n>> -config.status: configure\n>> -\t$(QUIET_GEN)if test -f config.status; then \\\n>> +# We avoid depending on 'configure' here, because it gets rebuilt\n>> +# every time GIT-VERSION-FILE is modified, only to update the embedded\n>> +# version number string, which config.status does not care about.\n>>\n> Alas, config.status *do* care about it, in that the '@PACKAGE_VERSION@',\n> '@PACKAGE_STRING@' and '@DEFS@' substitutions are affected by what is\n> hard-coded in configure as the version number [1].  But if we do not\n> use those substitutions in any of our files (and I believe we don't),\n> then *we* can happily not care about the configure embedded version\n> number string, and thus avoid the extra configure runs.  Phew.\n>\n>  [1] Yes, this is a mess.  We know.  Sorry!\n\nHeh.  Should we warn against the use of these symbols somewhere in\nconfigure.ac, perhaps, then?\n"},{"id":"205880","messageId":"50E49E54.9050009@gmail.com","threadId":"32507","inReplyTo":"7vbod72uze.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v2] build: do not automatically reconfigure unless configure.ac changed","fromName":"Stefano Lattarini","fromEmail":"stefano.lattarini@gmail.com","sentAt":"2013-01-02T20:53:40Z","receivedAt":"2013-01-02T20:53:40Z","isPatch":true,"sender":{"key":"stefano.lattarini@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1429199?v=4"},"body":"On 01/02/2013 09:25 PM, Junio C Hamano wrote:\n> Stefano Lattarini <stefano.lattarini@gmail.com> writes:\n> \n>>>  ifdef AUTOCONFIGURED\n>>> -config.status: configure\n>>> -\t$(QUIET_GEN)if test -f config.status; then \\\n>>> +# We avoid depending on 'configure' here, because it gets rebuilt\n>>> +# every time GIT-VERSION-FILE is modified, only to update the embedded\n>>> +# version number string, which config.status does not care about.\n>>>\n>> Alas, config.status *do* care about it, in that the '@PACKAGE_VERSION@',\n>> '@PACKAGE_STRING@' and '@DEFS@' substitutions are affected by what is\n>> hard-coded in configure as the version number [1].  But if we do not\n>> use those substitutions in any of our files (and I believe we don't),\n>> then *we* can happily not care about the configure embedded version\n>> number string, and thus avoid the extra configure runs.  Phew.\n>>\n>>  [1] Yes, this is a mess.  We know.  Sorry!\n> \n> Heh.  Should we warn against the use of these symbols somewhere in\n> configure.ac, perhaps, then?\n>\nActually, they should be checked against in files processed by\n'config.status', i.e., files listed in AC_CONFIG_FILES calls in\n'configure.ac'.  But I honestly believe that would be overkill;\nI say we simply adjust your comment to read something like:\n\n  # We avoid depending on 'configure' here, because it gets rebuilt\n  # every time GIT-VERSION-FILE is modified, only to update the\n  # embedded version number string, which we however do not\n  # substitute in any file processed by config.status.\n\nThanks,\n  Stefano\n"}]}