Makefile: Turn off the configure target by default
RFC PATCH 1/1 Makefile: Turn off the configure target by default
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.
---
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(-)
Makefile +7 -0
@@ -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 \
Signature · 1 line
1.7.3.1.184.g5b1fd
On Mon, Oct 11, 2010 at 07:47, Michael J Gruber
<[email protected]> 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.
Quoted 3 lines
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.
Quoted 2 lines
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?
Quoted 4 lines · Ævar Arnfjörð Bjarmason
On Mon, Oct 11, 2010 at 07:47, Michael J Gruber
<[email protected]> 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.
Quoted 8 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.
Quoted 8 lines
Quoted 3 lines
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
Makefileguessing based onuname -swe 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.
Quoted 3 lines
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).
Quoted 4 lines
Quoted 2 lines
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?
Signature · 2 lines
Jakub Narebski Poland
Quoted 3 lines · Jakub Narebski
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
Ævar Arnfjörð Bjarmason venit, vidit, dixit 11.10.2010 11:40:
Quoted 8 lines · Jakub Narebski
Quoted 4 lines
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
RFC PATCH 1/1 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
---
Quoted 22 lines · Michael J Gruber
Ævar Arnfjörð Bjarmason venit, vidit, dixit 11.10.2010 11:40:
Quoted 8 lines · Jakub Narebski
Quoted 4 lines
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.bz2Well, 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 theMakefile".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.
Quoted 5 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 (
Makefileas 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(-)
Makefile +10 -1
@@ -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
Signature · 1 line
1.7.3.1.50.g1e633
Re: [RFC PATCH] Makefile: point out "make" if "make configure" fails
Quoted 17 lines · Ævar Arnfjörð Bjarmason
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. TheMakefile
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
Quoted 1 line
Signed-off-by Ævar Arnfjörð Bjarmason <[email protected]>
I like this.
Signature · 2 lines
Jakub Narebski Poland
Re: [RFC PATCH] Makefile: point out "make" if "make configure" fails
Heya,
Quoted 1 line · Jakub Narebski
I like this.
Me too.
Quoted 3 lines · Ævar Arnfjörð Bjarmason
Quoted 2 lines
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
Quoted 2 lines
ERROR: We couldn't run autoconf for you. However, Git doesn't
ERROR: actually need autoconf to build.
Signature · 3 lines
Cheers, Sverre Rabbelier
Quoted 7 lines · Michael J Gruber
Ævar Arnfjörð Bjarmason venit, vidit, dixit 11.10.2010 11:40:
Quoted 6 lines · Jakub Narebski
Quoted 4 lines
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).
Quoted 7 lines
Quoted 2 lines
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.bz2Well, 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.
Quoted 1 line
- 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.
Quoted 2 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.
Quoted 5 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 (
Makefileas 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.
Signature · 2 lines
Jakub Narebski Poland
Jakub Narebski venit, vidit, dixit 11.10.2010 17:18:
Quoted 4 lines
Quoted 3 lines · Michael J Gruber
Ævar Arnfjörð Bjarmason venit, vidit, dixit 11.10.2010 11:40:
Quoted 2 lines · Jakub Narebski
...
Quoted 5 lines
Quoted 2 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?
Quoted 11 lines
Quoted 6 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 (
Makefileas primary method) or change the status quo. I can only do the former ;)Because ./configure script enhances
Makefilerather 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
Quoted 9 lines · Michael J Gruber
Jakub Narebski venit, vidit, dixit 11.10.2010 17:18:
Quoted 4 lines
Because ./configure script enhances
Makefilerather 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.
Quoted 8 lines · Ævar Arnfjörð Bjarmason
Quoted 3 lines · Michael J Gruber
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.
Jonathan Nieder venit, vidit, dixit 11.10.2010 18:26:
Quoted 8 lines
Quoted 7 lines · Ævar Arnfjörð Bjarmason
Quoted 3 lines · Michael J Gruber
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.
Quoted 8 lines
Quoted 1 line
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/158639I 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
On Tue, Oct 12, 2010 at 10:33, Michael J Gruber
<[email protected]> wrote:
[configure etc]
Quoted 9 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