Thread: ./configure argument checking

./configure argument checking

From
"Jim C. Nasby"
Date:
Wasn't configure changed to complain if it's fed a bogus argument? I
just did ./configure --with-deps on a fresh checkout and it didn't
complain...
-- 
Jim Nasby                                            jim@nasby.net
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)


Re: ./configure argument checking

From
Andrew Dunstan
Date:
Jim C. Nasby wrote:
> Wasn't configure changed to complain if it's fed a bogus argument? I
> just did ./configure --with-deps on a fresh checkout and it didn't
> complain...
>   

My recollection was Peter said this was an autoconf "feature".

cheers

andrew


Re: ./configure argument checking

From
Martijn van Oosterhout
Date:
On Thu, Oct 12, 2006 at 04:41:14PM -0400, Andrew Dunstan wrote:
> Jim C. Nasby wrote:
> >Wasn't configure changed to complain if it's fed a bogus argument? I
> >just did ./configure --with-deps on a fresh checkout and it didn't
> >complain...
> >
>
> My recollection was Peter said this was an autoconf "feature".

IIRC it was made a non-fatal warning somewhere near the end of the
output, but I'm not sure...

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Re: ./configure argument checking

From
Bruce Momjian
Date:
Martijn van Oosterhout wrote:
-- Start of PGP signed section.
> On Thu, Oct 12, 2006 at 04:41:14PM -0400, Andrew Dunstan wrote:
> > Jim C. Nasby wrote:
> > >Wasn't configure changed to complain if it's fed a bogus argument? I
> > >just did ./configure --with-deps on a fresh checkout and it didn't
> > >complain...
> > >  
> > 
> > My recollection was Peter said this was an autoconf "feature".
> 
> IIRC it was made a non-fatal warning somewhere near the end of the
> output, but I'm not sure...

It spits out this line just before it creates its output files:
*** Option ignored: --with-lkjasdf

--  Bruce Momjian   bruce@momjian.us EnterpriseDB    http://www.enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


Re: ./configure argument checking

From
Tom Lane
Date:
Bruce Momjian <bruce@momjian.us> writes:
> Martijn van Oosterhout wrote:
>> IIRC it was made a non-fatal warning somewhere near the end of the
>> output, but I'm not sure...

> It spits out this line just before it creates its output files:
>     *** Option ignored: --with-lkjasdf

Of course, since it spits out pages and pages of normally-useless trivia,
we've all become conditioned to ignore configure's output as long as it
doesn't actually fail :-(

Not sure what to do about that --- I doubt that raising this warning to
error would be a good idea, seeing how firmly the upstream developers
believe it shouldn't even be a warning.  Is there any sort of "quiet
mode" possible that would report only warnings?  Would it be a good idea
if it were possible?
        regards, tom lane


Re: ./configure argument checking

From
Bruce Momjian
Date:
Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > Martijn van Oosterhout wrote:
> >> IIRC it was made a non-fatal warning somewhere near the end of the
> >> output, but I'm not sure...
> 
> > It spits out this line just before it creates its output files:
> >     *** Option ignored: --with-lkjasdf
> 
> Of course, since it spits out pages and pages of normally-useless trivia,
> we've all become conditioned to ignore configure's output as long as it
> doesn't actually fail :-(
> 
> Not sure what to do about that --- I doubt that raising this warning to
> error would be a good idea, seeing how firmly the upstream developers
> believe it shouldn't even be a warning.  Is there any sort of "quiet
> mode" possible that would report only warnings?  Would it be a good idea
> if it were possible?

I think one idea is a "pedantic" mode that fails if an unrecognized
option is supplied.

--  Bruce Momjian   bruce@momjian.us EnterpriseDB    http://www.enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


Re: ./configure argument checking

From
"Andrew Dunstan"
Date:
Bruce Momjian wrote:
> Tom Lane wrote:
>> Bruce Momjian <bruce@momjian.us> writes:
>> > Martijn van Oosterhout wrote:
>> >> IIRC it was made a non-fatal warning somewhere near the end of the
>> >> output, but I'm not sure...
>>
>> > It spits out this line just before it creates its output files:
>> >     *** Option ignored: --with-lkjasdf
>>
>> Of course, since it spits out pages and pages of normally-useless
>> trivia,
>> we've all become conditioned to ignore configure's output as long as it
>> doesn't actually fail :-(
>>
>> Not sure what to do about that --- I doubt that raising this warning to
>> error would be a good idea, seeing how firmly the upstream developers
>> believe it shouldn't even be a warning.  Is there any sort of "quiet
>> mode" possible that would report only warnings?  Would it be a good idea
>> if it were possible?
>
> I think one idea is a "pedantic" mode that fails if an unrecognized
> option is supplied.
>


I do not see any point at all in a special mode. If you know enough to
want to use it you should be able to protect yourself more directly from
needing it, simply by taking care to use correct switches.

Frankly, I'd let sleeping dogs lie, in this case.

cheers

andrew



Re: ./configure argument checking

From
Martijn van Oosterhout
Date:
On Thu, Oct 12, 2006 at 08:01:06PM -0500, Andrew Dunstan wrote:
> > I think one idea is a "pedantic" mode that fails if an unrecognized
> > option is supplied.
>
> I do not see any point at all in a special mode. If you know enough to
> want to use it you should be able to protect yourself more directly from
> needing it, simply by taking care to use correct switches.

It was originally a fatal error right at the beginning but we got
complaints that build systems tend to assume they can load the
command-line with lots of crap and still expect it to work.

All I can suggest at this point is try to make it more visible (more
stars or spacing). Ofcourse with ./configure && make && make install
you still won't see it.

I would like a pedantic mode, but the method of activation is a tricky
issue. You want it to be 'on' for normal users but 'off' for automatic
build scripts.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Re: ./configure argument checking

From
Tom Lane
Date:
Martijn van Oosterhout <kleptog@svana.org> writes:
> I would like a pedantic mode, but the method of activation is a tricky
> issue. You want it to be 'on' for normal users but 'off' for automatic
> build scripts.

A quiet mode would work better, because it could be on by default for 
both cases.  However, people may be too used to expecting to see chatter
from configure scripts --- anyone who's used a few before would probably
think the script was hung :-(
        regards, tom lane


Re: ./configure argument checking

From
Alvaro Herrera
Date:
Tom Lane wrote:
> Martijn van Oosterhout <kleptog@svana.org> writes:
> > I would like a pedantic mode, but the method of activation is a tricky
> > issue. You want it to be 'on' for normal users but 'off' for automatic
> > build scripts.
> 
> A quiet mode would work better, because it could be on by default for 
> both cases.  However, people may be too used to expecting to see chatter
> from configure scripts --- anyone who's used a few before would probably
> think the script was hung :-(

Maybe have it emit single chars instead of lines for each check?  That
way it looks like something's going on.  Not sure how difficult that is
with autoconf.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


Re: ./configure argument checking

From
"Jim C. Nasby"
Date:
On Fri, Oct 13, 2006 at 11:25:28AM -0400, Alvaro Herrera wrote:
> Tom Lane wrote:
> > Martijn van Oosterhout <kleptog@svana.org> writes:
> > > I would like a pedantic mode, but the method of activation is a tricky
> > > issue. You want it to be 'on' for normal users but 'off' for automatic
> > > build scripts.
> > 
> > A quiet mode would work better, because it could be on by default for 
> > both cases.  However, people may be too used to expecting to see chatter
> > from configure scripts --- anyone who's used a few before would probably
> > think the script was hung :-(
> 
> Maybe have it emit single chars instead of lines for each check?  That
> way it looks like something's going on.  Not sure how difficult that is
> with autoconf.

That would be useful, though personally I'd much rather have the default
be to error-out if it gets garbage arguments. If we provided a flag that
disabled that, all porters would have to do is to add that to the myriad
of flags they're already passing in.

In the meantime, +1 to adding some whitespace around the warning... I'd
suggest two blank lines before and after.
-- 
Jim Nasby                                            jim@nasby.net
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)


Re: ./configure argument checking

From
Tom Lane
Date:
"Jim C. Nasby" <jim@nasby.net> writes:
> In the meantime, +1 to adding some whitespace around the warning... I'd
> suggest two blank lines before and after.

I don't really see that that would accomplish anything.  The problem is
exactly that configure emits many many lines of output which no one
bothers to read --- it's been years since it even fit in my terminal
window's scroll-back buffer :-(  A couple blank lines in there won't do
much except make the output even longer.

> ... personally I'd much rather have the default
> be to error-out if it gets garbage arguments. If we provided a flag that
> disabled that, all porters would have to do is to add that to the myriad
> of flags they're already passing in.

This is bending the upstream autoconf developers' idea of what to do
well past the breaking point ;-).  Still, if we think that bad configure
arguments is a serious problem, maybe this is what we should do.

The reason I like the "quiet mode" idea better is that "garbage
argument" is not the only warning I fear people are missing.  There's
also the one about "you've got an obsolete Bison", which is either
extremely important or utterly useless depending on whether there are
up-to-date prebuilt .c files or not.  That means we can *not* turn it
into an error condition ... but because it is not close to either the
beginning or the end of the configure run, it's virtually guaranteed
that people won't notice it.  If we fixed things so that the warnings
were pretty nearly the only output, then they'd get noticed.
        regards, tom lane


Re: ./configure argument checking

From
"Jim C. Nasby"
Date:
On Fri, Oct 13, 2006 at 12:45:23PM -0400, Tom Lane wrote:
> "Jim C. Nasby" <jim@nasby.net> writes:
> > In the meantime, +1 to adding some whitespace around the warning... I'd
> > suggest two blank lines before and after.
> 
> I don't really see that that would accomplish anything.  The problem is
> exactly that configure emits many many lines of output which no one
> bothers to read --- it's been years since it even fit in my terminal
> window's scroll-back buffer :-(  A couple blank lines in there won't do
> much except make the output even longer.

Well, if the warning was close enough to the end it would help. I
thought I'd just missed it, but I just tested again and couldn't find a
warning anywhere (I even grepped config.log). So I suspect that this
functionality is now borked.

> > ... personally I'd much rather have the default
> > be to error-out if it gets garbage arguments. If we provided a flag that
> > disabled that, all porters would have to do is to add that to the myriad
> > of flags they're already passing in.
> 
> This is bending the upstream autoconf developers' idea of what to do
> well past the breaking point ;-).  Still, if we think that bad configure
> arguments is a serious problem, maybe this is what we should do.
> 
> The reason I like the "quiet mode" idea better is that "garbage
> argument" is not the only warning I fear people are missing.  There's
> also the one about "you've got an obsolete Bison", which is either
> extremely important or utterly useless depending on whether there are
> up-to-date prebuilt .c files or not.  That means we can *not* turn it
> into an error condition ... but because it is not close to either the
> beginning or the end of the configure run, it's virtually guaranteed
> that people won't notice it.  If we fixed things so that the warnings
> were pretty nearly the only output, then they'd get noticed.

Hrm... I don't suppose there's a way to capture the critical warnings in
a temporary file and then cat that at the end? (I'm assuming that it'll
be nearly impossible to get a quite mode out of autoconf...)
-- 
Jim Nasby                                            jim@nasby.net
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)


Re: ./configure argument checking

From
Tom Lane
Date:
"Jim C. Nasby" <jim@nasby.net> writes:
> Hrm... I don't suppose there's a way to capture the critical warnings in
> a temporary file and then cat that at the end? (I'm assuming that it'll
> be nearly impossible to get a quite mode out of autoconf...)

Hmm ... maybe we could just rearrange the script to produce the warnings
at the very end?  I'm not sure how much flexibility autoconf gives you
concerning the ordering of end-game processing, but it'd be worth trying.
        regards, tom lane


Re: ./configure argument checking

From
Peter Eisentraut
Date:
Tom Lane wrote:
> Not sure what to do about that --- I doubt that raising this warning
> to error would be a good idea, seeing how firmly the upstream
> developers believe it shouldn't even be a warning.  Is there any sort
> of "quiet mode" possible that would report only warnings?  Would it
> be a good idea if it were possible?

peter@colt:~/devel/pg82/pgsql$ ./configure --enable-foo --quiet
*** Option ignored: --enable-foo
peter@colt:~/devel/pg82/pgsql$

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/


Re: ./configure argument checking

From
"Jim C. Nasby"
Date:
On Fri, Oct 13, 2006 at 08:40:42PM +0200, Peter Eisentraut wrote:
> Tom Lane wrote:
> > Not sure what to do about that --- I doubt that raising this warning
> > to error would be a good idea, seeing how firmly the upstream
> > developers believe it shouldn't even be a warning.  Is there any sort
> > of "quiet mode" possible that would report only warnings?  Would it
> > be a good idea if it were possible?
> 
> peter@colt:~/devel/pg82/pgsql$ ./configure --enable-foo --quiet
> *** Option ignored: --enable-foo
> peter@colt:~/devel/pg82/pgsql$

Odd, I can't get that on a very recent checkout of HEAD:
decibel@phonebook.1[13:51]~/pgsql/HEAD:156%./configure
--with-includes=/opt/local/include --with-libraries=/opt/local/lib
--with-pgport=5820 --enable-depend
--prefix=/Users/decibel/pgsql/HEAD/820 --with-blarg --enable-blarg |
grep blarg
decibel@phonebook.1[13:54]~/pgsql/HEAD:157%
-- 
Jim Nasby                                            jim@nasby.net
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)


Re: ./configure argument checking

From
Peter Eisentraut
Date:
Jim C. Nasby wrote:
> > peter@colt:~/devel/pg82/pgsql$ ./configure --enable-foo --quiet
> > *** Option ignored: --enable-foo
> > peter@colt:~/devel/pg82/pgsql$
>
> Odd, I can't get that on a very recent checkout of HEAD:
> decibel@phonebook.1[13:51]~/pgsql/HEAD:156%./configure
> --with-includes=/opt/local/include --with-libraries=/opt/local/lib
> --with-pgport=5820 --enable-depend
> --prefix=/Users/decibel/pgsql/HEAD/820 --with-blarg --enable-blarg |
> grep blarg
> decibel@phonebook.1[13:54]~/pgsql/HEAD:157%

Yeah, it seems there are some portability problems with that code.  I'm 
looking into it.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/


Re: ./configure argument checking

From
"Jim C. Nasby"
Date:
On Fri, Oct 13, 2006 at 09:36:14PM +0200, Peter Eisentraut wrote:
> Jim C. Nasby wrote:
> > > peter@colt:~/devel/pg82/pgsql$ ./configure --enable-foo --quiet
> > > *** Option ignored: --enable-foo
> > > peter@colt:~/devel/pg82/pgsql$
> >
> > Odd, I can't get that on a very recent checkout of HEAD:
> > decibel@phonebook.1[13:51]~/pgsql/HEAD:156%./configure
> > --with-includes=/opt/local/include --with-libraries=/opt/local/lib
> > --with-pgport=5820 --enable-depend
> > --prefix=/Users/decibel/pgsql/HEAD/820 --with-blarg --enable-blarg |
> > grep blarg
> > decibel@phonebook.1[13:54]~/pgsql/HEAD:157%
> 
> Yeah, it seems there are some portability problems with that code.  I'm 
> looking into it.

Cool, thanks. I'm running OS X 10.4.8 on a G4 Powerbook if that
matters...
-- 
Jim Nasby                                            jim@nasby.net
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)


Re: ./configure argument checking

From
Martijn van Oosterhout
Date:
On Fri, Oct 13, 2006 at 01:24:52PM -0400, Tom Lane wrote:
> "Jim C. Nasby" <jim@nasby.net> writes:
> > Hrm... I don't suppose there's a way to capture the critical warnings in
> > a temporary file and then cat that at the end? (I'm assuming that it'll
> > be nearly impossible to get a quite mode out of autoconf...)
>
> Hmm ... maybe we could just rearrange the script to produce the warnings
> at the very end?  I'm not sure how much flexibility autoconf gives you
> concerning the ordering of end-game processing, but it'd be worth trying.

At the end of the day configure is just a shell script, so worst case
you load all the warnings into an environment variable and print that
at the end...

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Re: ./configure argument checking

From
Peter Eisentraut
Date:
Peter Eisentraut wrote:
> Yeah, it seems there are some portability problems with that code. 
> I'm looking into it.

Fixed.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/


Re: ./configure argument checking

From
Tom Lane
Date:
Peter Eisentraut <peter_e@gmx.net> writes:
> Tom Lane wrote:
>> ... Is there any sort
>> of "quiet mode" possible that would report only warnings?

> [ it's already there ]

So maybe we just ought to tweak the installation instructions to
recommend use of --quiet?
        regards, tom lane