threads / rfc / 25416

RFC patchMakefile: Turn off the configure target by default

Subject: [RFC PATCH] Makefile: Turn off the configure target by default

## tl;dr

14 messages between Oct 11, 2010 and Oct 12, 2010. Diffs are folded; open one to read it.

replies: 13people: 6as markdown or json

Michael J Gruber· Oct 11, 2010, 07:47 UTC · lore

For most software packages, untar-autoconf/make configure-configure-make is the preferred way to build the package; not so for Git. But the presence of the make target makes people believe so.

Try and make people use "make configure" only when they are sure they need to.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
    This does not help with people running autoconf themselves, of course.
    But we keep answering questions about failed configure attempts.
    
    On an annecdotical note: When I decided to switch to a dvcs, I failed building
    Git (with configure) and tried out hg instead. Imagine!
 Makefile |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
Show changes to Makefile +7 −0
diff --git a/Makefile b/Makefile
index 1f1ce04..430c096 100644
--- a/Makefile
+++ b/Makefile
@@ -1744,11 +1744,18 @@ $(patsubst %.py,%,$(SCRIPT_PYTHON)): % : unimplemented.sh
 endif # NO_PYTHON
 
 configure: configure.ac
+ifdef USEAUTOCONF
 	$(QUIET_GEN)$(RM) $@ $<+ && \
 	sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
 	    $< > $<+ && \
 	autoconf -o $@ $<+ && \
 	$(RM) $<+
+else
+	@echo "Using the Makefile and defining variables in config.mak is the"
+	@echo "preferred way of building Git. Please use"
+	@echo "USEAUTOCONF=1 make configure"
+	@echo "if you are really sure you need configure."
+endif
 
 # These can record GIT_VERSION
 git.o git.spec \
-- 
1.7.3.1.184.g5b1fd
Ævar Arnfjörð Bjarmason· Oct 11, 2010, 07:59 UTC · re: Michael J Gruber · lore

Re: [RFC PATCH] Makefile: Turn off the configure target by default

On Mon, Oct 11, 2010 at 07:47, Michael J Gruber <git@drmicha.warpmail.net> wrote:

(CC-ing Jakub Narebski, who maintains configure.ac)

I don't like it. For one this would break build scripts that use `make configure && ./configure && ...`. It's also annoying to have to set some variable to *really* invoke a target that I just indicated I *really* wanted by invoking it in the first place.

Perhaps a @echo from the configure script itself indicating that it's complimentary would be better.

> For most software packages, untar-autoconf/make configure-configure-make
> is the preferred way to build the package; not so for Git. But the
> presence of the make target makes people believe so.

Unlike in most packages autoconf is strictly complimentary for Git, but it usually gives you much better results. Instead of the Makefile guessing based on `uname -s` we actually check for features and set the config.mak.autogen variables accordingly.

So it's less likely to break on odd systems, and given that (as you point out) mostly everyone has autoconf already recommending it as the default would make more sense than the other way around.

>    On an annecdotical note: When I decided to switch to a dvcs, I failed building
>    Git (with configure) and tried out hg instead. Imagine!
What sort of failure? Has it been fixed since then?
Jakub Narebski· Oct 11, 2010, 08:39 UTC · re: Ævar Arnfjörð Bjarmason · lore

Re: [RFC PATCH] Makefile: Turn off the configure target by default

On Mon, 11 Oct 2010, Ævar Arnfjörð Bjarmason wrote:
> On Mon, Oct 11, 2010 at 07:47, Michael J Gruber
> <git@drmicha.warpmail.net> wrote:
> 
> (CC-ing Jakub Narebski, who maintains configure.ac)

I wouldn't say that I maintain it. I was one of people who started it, and I try to keep it from being too bitrotten, by asking to provide configure test when adding new configure knob to main Makefile.

I am certainly not an expert on autoconf.
Show 16 quoted lines
> I don't like it. For one this would break build scripts that use `make
> configure && ./configure && ...`. It's also annoying to have to set
> some variable to *really* invoke a target that I just indicated I
> *really* wanted by invoking it in the first place.
> 
> Perhaps a @echo from the configure script itself indicating that it's
> complimentary would be better.
> 
> > For most software packages, untar-autoconf/make configure-configure-make
> > is the preferred way to build the package; not so for Git. But the
> > presence of the make target makes people believe so.
> 
> Unlike in most packages autoconf is strictly complimentary for Git,
> but it usually gives you much better results. Instead of the Makefile
> guessing based on `uname -s` we actually check for features and set
> the config.mak.autogen variables accordingly.
That's why we have it, to be able to check for features, rather than
guess based on operating system and its version.
 
> So it's less likely to break on odd systems, and given that (as you
> point out) mostly everyone has autoconf already recommending it as the
> default would make more sense than the other way around.

But thanks to having ./configure optional step, we can build git also on platforms that doesn't have autoconf installed (though the same could be achieved by bundling ./configure script with release tarballs).

> >    On an annecdotical note: When I decided to switch to a dvcs, I failed building
> >    Git (with configure) and tried out hg instead. Imagine!
> 
> What sort of failure? Has it been fixed since then?
-- 
Jakub Narebski
Poland
Ævar Arnfjörð Bjarmason· Oct 11, 2010, 09:40 UTC · re: Jakub Narebski · lore

Re: [RFC PATCH] Makefile: Turn off the configure target by default

On Mon, Oct 11, 2010 at 08:39, Jakub Narebski <jnareb@gmail.com> wrote:
> But thanks to having ./configure optional step, we can build git also
> on platforms that doesn't have autoconf installed (though the same could
> be achieved by bundling ./configure script with release tarballs).

It already is built as part of the tarballs, at least for http://kernel.org/pub/software/scm/git/git-1.7.3.1.tar.bz2

Michael J Gruber· Oct 11, 2010, 12:10 UTC · re: Ævar Arnfjörð Bjarmason · lore

Re: [RFC PATCH] Makefile: Turn off the configure target by default

Ævar Arnfjörð Bjarmason venit, vidit, dixit 11.10.2010 11:40:
Show 8 quoted lines
> On Mon, Oct 11, 2010 at 08:39, Jakub Narebski <jnareb@gmail.com> wrote:
> 
>> But thanks to having ./configure optional step, we can build git also
>> on platforms that doesn't have autoconf installed (though the same could
>> be achieved by bundling ./configure script with release tarballs).
> 
> It already is built as part of the tarballs, at least for
> http://kernel.org/pub/software/scm/git/git-1.7.3.1.tar.bz2

Well, the point of my semi-serious RFC is that every so often, we have a variation on the following theme on the list:

- "Newbee" uses make configure && ./configure && make and can't build.
- Helpful "oldbees" respond like "Duh! Use the Makefile".

configure is a second class citizen in git.git (we even explicitly .gitignore it - if you allow that lame joke), and given my complete lack of auto-conf-foo, I can't change that. But there's no need to make someone feel stupid (I'm exaggerating a bit) for trying a standard build tool that we do ship.

But, really, the typical responses to build problems with configure indicate that most long timers don't use configure either, and probably don't feel too comfortable with it. So, I think we should either make the status quo clearer (Makefile as primary method) or change the status quo. I can only do the former ;)

Michael
Ævar Arnfjörð Bjarmason· Oct 11, 2010, 12:37 UTC · re: Michael J Gruber · lore

[RFC PATCH] Makefile: point out "make" if "make configure" fails

Someone trying to build Git may think the need autoconf when "make configure && ./configure && make" fails. But actually they can probably just run "make" directly.

Change the "make configure" output so that when it fails the user is informed of this:

    make configure && ./configure && make
        GEN configure
    ERROR: We couldn't run autoconf for you. But you're in luck!
    ERROR: Git doesn't actually need autoconf to build. Just try
    ERROR: running "make" directly at the top-level. The Makefile
    ERROR: will guess your configuration based on your OS. If that
    ERROR: doesn't work try installing autoconf and running
    ERROR: "make configure && ./configure && make" again.
    make: *** [configure] Error 1
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
On Mon, Oct 11, 2010 at 12:10, Michael J Gruber <git@drmicha.warpmail.net> wrote:
Show 27 quoted lines
> Ævar Arnfjörð Bjarmason venit, vidit, dixit 11.10.2010 11:40:
>> On Mon, Oct 11, 2010 at 08:39, Jakub Narebski <jnareb@gmail.com> wrote:
>>
>>> But thanks to having ./configure optional step, we can build git also
>>> on platforms that doesn't have autoconf installed (though the same could
>>> be achieved by bundling ./configure script with release tarballs).
>>
>> It already is built as part of the tarballs, at least for
>> http://kernel.org/pub/software/scm/git/git-1.7.3.1.tar.bz2
>
> Well, the point of my semi-serious RFC is that every so often, we have a
> variation on the following theme on the list:
>
> - "Newbee" uses make configure && ./configure && make and can't build.
> - Helpful "oldbees" respond like "Duh! Use the Makefile".
>
> configure is a second class citizen in git.git (we even explicitly
> .gitignore it - if you allow that lame joke), and given my complete lack
> of auto-conf-foo, I can't change that. But there's no need to make
> someone feel stupid (I'm exaggerating a bit) for trying a standard build
> tool that we do ship.
>
> But, really, the typical responses to build problems with configure
> indicate that most long timers don't use configure either, and probably
> don't feel too comfortable with it. So, I think we should either make
> the status quo clearer (Makefile as primary method) or change the status
> quo. I can only do the former ;)

The main problem with your patch is that existing invocations of "make configure" have to be altered. I haven't scoured the mailing list for these newbie reports you mention but aren't they mostly failing because users don't have autoconf installed, and not because the configure script itself fails?

If that's case something like this patch would probably be better, and maybe we also need to change something in the INSTALL file or other documentation.

 Makefile |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
Show changes to Makefile +10 −1
diff --git a/Makefile b/Makefile
index 1f1ce04..6d2928d 100644
--- a/Makefile
+++ b/Makefile
@@ -1747,7 +1747,16 @@ configure: configure.ac
 	$(QUIET_GEN)$(RM) $@ $<+ && \
 	sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
 	    $< > $<+ && \
-	autoconf -o $@ $<+ && \
+	if ! autoconf -o $@ $<+; \
+	then \
+		echo "ERROR: We couldn't run autoconf for you. But you're in luck!"; \
+		echo "ERROR: Git doesn't actually need autoconf to build. Just try"; \
+		echo "ERROR: running \"make\" directly at the top-level. The Makefile"; \
+		echo "ERROR: will guess your configuration based on your OS. If that"; \
+		echo "ERROR: doesn't work try installing autoconf and running"; \
+		echo "ERROR: \"make configure && ./configure && make\" again."; \
+		false; \
+	fi && \
 	$(RM) $<+
 
 # These can record GIT_VERSION
-- 
1.7.3.1.50.g1e633
Jakub Narebski· Oct 11, 2010, 15:06 UTC · re: Ævar Arnfjörð Bjarmason · lore

Re: [RFC PATCH] Makefile: point out "make" if "make configure" fails

On Mon, 11 Oct 2010, Ævar Arnfjörð Bjarmason wrote:
Show 18 quoted lines
> Someone trying to build Git may think the need autoconf when "make
> configure && ./configure && make" fails. But actually they can
> probably just run "make" directly.
> 
> Change the "make configure" output so that when it fails the user is
> informed of this:
> 
>     make configure && ./configure && make
>         GEN configure
>     ERROR: We couldn't run autoconf for you. But you're in luck!
>     ERROR: Git doesn't actually need autoconf to build. Just try
>     ERROR: running "make" directly at the top-level. The Makefile
>     ERROR: will guess your configuration based on your OS. If that
>     ERROR: doesn't work try installing autoconf and running
>     ERROR: "make configure && ./configure && make" again.
>     make: *** [configure] Error 1
> 
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
I like this.
-- 
Jakub Narebski
Poland
Sverre Rabbelier· Oct 11, 2010, 20:46 UTC · re: Jakub Narebski · lore

Re: [RFC PATCH] Makefile: point out "make" if "make configure" fails

Heya,
On Mon, Oct 11, 2010 at 17:06, Jakub Narebski <jnareb@gmail.com> wrote:
> I like this.
Me too.
> On Mon, 11 Oct 2010, Ævar Arnfjörð Bjarmason wrote:
>>     ERROR: We couldn't run autoconf for you. But you're in luck!
>>     ERROR: Git doesn't actually need autoconf to build.
This is a bit cheeky though. Perhaps just replace that with
>     ERROR: We couldn't run autoconf for you. However, Git doesn't
>     ERROR: actually need autoconf to build.
-- 
Cheers,

Sverre Rabbelier
Jakub Narebski· Oct 11, 2010, 15:18 UTC · re: Michael J Gruber · lore

Re: [RFC PATCH] Makefile: Turn off the configure target by default

Dnia poniedziałek 11. października 2010 14:10, Michael J Gruber napisał:
Show 14 quoted lines
> Ævar Arnfjörð Bjarmason venit, vidit, dixit 11.10.2010 11:40:
>> On Mon, Oct 11, 2010 at 08:39, Jakub Narebski <jnareb@gmail.com> wrote:
>> 
>>> But thanks to having ./configure optional step, we can build git also
>>> on platforms that doesn't have autoconf installed (though the same could
>>> be achieved by bundling ./configure script with release tarballs).
>> 
>> It already is built as part of the tarballs, at least for
>> http://kernel.org/pub/software/scm/git/git-1.7.3.1.tar.bz2
> 
> Well, the point of my semi-serious RFC is that every so often, we have a
> variation on the following theme on the list:
> 
> - "Newbee" uses make configure && ./configure && make and can't build.

As Ævar writes this happen mostly because "newbee" doesn't have autoconf installed (and is not using released tarball, where ./configure script is included). Ævar solution is much better.

> - Helpful "oldbees" respond like "Duh! Use the Makefile".

This can happen because A.) "oldbee" doesn't use configure script himself, so he gives (universal) advice that he can check, or B.) because there is an error in both Makefile guessing and ./configure script doesn't detect or misdetect thing; then "Use the Makefile" can be considered workaround for the issue till bug gets fixed.

> configure is a second class citizen in git.git (we even explicitly
> .gitignore it - if you allow that lame joke),

We .gitignore 'configure' script because it is *generated* file, and generated files should be not, as rule, placed under version control.

Show 5 quoted lines
> But, really, the typical responses to build problems with configure
> indicate that most long timers don't use configure either, and probably
> don't feel too comfortable with it. So, I think we should either make
> the status quo clearer (Makefile as primary method) or change the status
> quo. I can only do the former ;)

Because ./configure script enhances Makefile rather than generate it, using configure script can only improve situation (at the cost of extra cycles spent detecting)... well, with exception of rare cases bugs in configure.ac making it misdetect.

-- 
Jakub Narebski
Poland
Michael J Gruber· Oct 11, 2010, 15:28 UTC · re: Jakub Narebski · lore

Re: [RFC PATCH] Makefile: Turn off the configure target by default

Jakub Narebski venit, vidit, dixit 11.10.2010 17:18:
> Dnia poniedziałek 11. października 2010 14:10, Michael J Gruber napisał:
>> Ævar Arnfjörð Bjarmason venit, vidit, dixit 11.10.2010 11:40:
>>> On Mon, Oct 11, 2010 at 08:39, Jakub Narebski <jnareb@gmail.com> wrote:
>>>
...
Show 5 quoted lines
>> configure is a second class citizen in git.git (we even explicitly
>> .gitignore it - if you allow that lame joke),
> 
> We .gitignore 'configure' script because it is *generated* file, and
> generated files should be not, as rule, placed under version control.
I don't know which part of "joke" was unclear?
Show 11 quoted lines
> 
>> But, really, the typical responses to build problems with configure
>> indicate that most long timers don't use configure either, and probably
>> don't feel too comfortable with it. So, I think we should either make
>> the status quo clearer (Makefile as primary method) or change the status
>> quo. I can only do the former ;)
> 
> Because ./configure script enhances Makefile rather than generate it,
> using configure script can only improve situation (at the cost of extra
> cycles spent detecting)... well, with exception of rare cases bugs in
> configure.ac making it misdetect.

My observations on the list don't quite confirm that "configure" can only improve the make situation, but I don't use it myself. So, I'll let those give configure advice who use it.

Michael
Ævar Arnfjörð Bjarmason· Oct 11, 2010, 16:21 UTC · re: Michael J Gruber · lore

Re: [RFC PATCH] Makefile: Turn off the configure target by default

On Mon, Oct 11, 2010 at 15:28, Michael J Gruber <git@drmicha.warpmail.net> wrote:

Show 9 quoted lines
> Jakub Narebski venit, vidit, dixit 11.10.2010 17:18:
>> Because ./configure script enhances Makefile rather than generate it,
>> using configure script can only improve situation (at the cost of extra
>> cycles spent detecting)... well, with exception of rare cases bugs in
>> configure.ac making it misdetect.
>
> My observations on the list don't quite confirm that "configure" can
> only improve the make situation, but I don't use it myself. So, I'll let
> those give configure advice who use it.

If it doesn't improve it that's a bug that we need to fix. I haven't seen/found any of the threads/issues in question. Would you mind pointing some of them out, maybe the problems you cite are easy to fix.

Jonathan Nieder· Oct 11, 2010, 16:26 UTC · re: Ævar Arnfjörð Bjarmason · lore

Re: [RFC PATCH] Makefile: Turn off the configure target by default

Ævar Arnfjörð Bjarmason wrote:
> On Mon, Oct 11, 2010 at 15:28, Michael J Gruber
> <git@drmicha.warpmail.net> wrote:
Show 5 quoted lines
>> My observations on the list don't quite confirm that "configure" can
>> only improve the make situation, but I don't use it myself. So, I'll let
>> those give configure advice who use it.
>
> If it doesn't improve it that's a bug that we need to fix.

Probably Michael was referring to the FreeBSD 4 thread: http://thread.gmane.org/gmane.comp.version-control.git/158639

I suspect it has nothing to do with "configure", but given that most of the active developers do not use autoconf, it tends to be the first unknown one is tempted to eliminate.

Michael J Gruber· Oct 12, 2010, 08:33 UTC · re: Jonathan Nieder · lore

Re: [RFC PATCH] Makefile: Turn off the configure target by default

Jonathan Nieder venit, vidit, dixit 11.10.2010 18:26:
Show 16 quoted lines
> Ævar Arnfjörð Bjarmason wrote:
>> On Mon, Oct 11, 2010 at 15:28, Michael J Gruber
>> <git@drmicha.warpmail.net> wrote:
> 
>>> My observations on the list don't quite confirm that "configure" can
>>> only improve the make situation, but I don't use it myself. So, I'll let
>>> those give configure advice who use it.
>>
>> If it doesn't improve it that's a bug that we need to fix.
> 
> Probably Michael was referring to the FreeBSD 4 thread:
> http://thread.gmane.org/gmane.comp.version-control.git/158639
> 
> I suspect it has nothing to do with "configure", but given that
> most of the active developers do not use autoconf, it tends to be
> the first unknown one is tempted to eliminate.

That thread was just the hair-trigger, so to say, there were many others in the past. But it's very typical. We often have "Don't use configure - it's second class"-type answers to build problems. I don't really remember that many "I use configure, and it works here"-type answers.

Given the vigorous defense showing up here against deprecating configure (in the sense of declaring it second class), we can all be confident that there will be many knowledgeable and helpful answers to build problems for configure users, right?

Michael
Tor Arntsen· Oct 12, 2010, 09:10 UTC · re: Michael J Gruber · lore

Re: [RFC PATCH] Makefile: Turn off the configure target by default

On Tue, Oct 12, 2010 at 10:33, Michael J Gruber <git@drmicha.warpmail.net> wrote: [configure etc]

Show 9 quoted lines
> That thread was just the hair-trigger, so to say, there were many others
> in the past. But it's very typical. We often have "Don't use configure -
> it's second class"-type answers to build problems. I don't really
> remember that many "I use configure, and it works here"-type answers.
>
> Given the vigorous defense showing up here against deprecating configure
> (in the sense of declaring it second class), we can all be confident
> that there will be many knowledgeable and helpful answers to build
> problems for configure users, right?

At the moment './configure; make' works better than just 'make' on Tru64 and AIX platforms. I have patches somewhere to improve just 'make' on those platforms but I haven't gotten around to post them yet (need some polishing, or at least re-check against current .git). One reason I figured it's no hurry is that ./configure actually takes care of things there for now.

(The series posted by Gary from The Written Word, and mostly included by now I think, was mainly based on TWW using configure on all platforms btw. IIRC.)

-Tor

← back to recent threads