Suggestion: Which Binary?

Started by David E. Wheelerabout 20 years ago41 messageshackers
Jump to latest
#1David E. Wheeler
david@kineticode.com

Dear PostgreSQL Hackers,

I recently ran into an issue where I was having trouble compiling
PostgreSQL with PL/Perl. Although Mac OS X 10.4 comes with a dynamic
Perl, I long ago compiled my own Perl, which is static. So /usr/bin/
perl was my static Perl, and /usr/bin/perl5.8.6 is the stock Perl.
But of course, PostgreSQL's configure script was just executing
'perl' and finding it in the path, thus getting my static Perl which,
of course, wouldn't work.

I got 'round this by temporarily moving things around:

rm /usr/bin/perl
ln /usr/bin/perl5.8.6 /usr/bin/perl
./configure --with-perl
rm /usr/bin/perlo
ln /usr/local/bin/perl5.8.8 /usr/bin/perl

But that's a PITA. I'd much rather have been able to tell configure
*which* perl to use:

./configure --with-perl=/usr/bin/perl5.8.6

Would it be possible to add support for an optional argument to the
PL/* options (--with-perl,--with-python, --with-tcl) so that we can
get it to use the correct binary without having to resort to any
shenanigans?

Just an idea.

Thanks!

David

#2Seneca Cunningham
scunning@ca.afilias.info
In reply to: David E. Wheeler (#1)
Re: Suggestion: Which Binary?

David Wheeler wrote:

But that's a PITA. I'd much rather have been able to tell configure
*which* perl to use:

./configure --with-perl=/usr/bin/perl5.8.6

Would it be possible to add support for an optional argument to the PL/*
options (--with-perl,--with-python, --with-tcl) so that we can get it to
use the correct binary without having to resort to any shenanigans?

Like passing PERL=/usr/bin/perl5.8.6 to configure?

--
Seneca Cunningham
scunning@ca.afilias.info

#3David E. Wheeler
david@kineticode.com
In reply to: Seneca Cunningham (#2)
Re: Suggestion: Which Binary?

On Mar 31, 2006, at 12:05, Seneca Cunningham wrote:

Like passing PERL=/usr/bin/perl5.8.6 to configure?

Is that currently supported? Because, if so, it's documented AFAICT.

Best,

David

#4Josh Berkus
josh@agliodbs.com
In reply to: David E. Wheeler (#1)
Re: Suggestion: Which Binary?

People:

./configure --with-perl=/usr/bin/perl5.8.6

In support of David's suggestion, I'll point out that most other OSS
software configuration scripts (Apache, PHP, etc.) I deal with supports
the above syntax.

--
--Josh

Josh Berkus
Aglio Database Solutions
San Francisco

#5David E. Wheeler
david@kineticode.com
In reply to: Josh Berkus (#4)
Re: Suggestion: Which Binary?

On Mar 31, 2006, at 12:40, Josh Berkus wrote:

In support of David's suggestion, I'll point out that most other OSS
software configuration scripts (Apache, PHP, etc.) I deal with
supports
the above syntax.

Yes, but even the environment variables get me what I want. I
therefore respectfully submit the attached patch to document them in
the INSTALL file.

Best,

David

Attachments:

perl_python_patch.patch.txttext/plain; name=perl_python_patch.patch.txt; x-unix-mode=0644Download+13-0
#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: David E. Wheeler (#1)
Re: Suggestion: Which Binary?

David Wheeler <david@kineticode.com> writes:

But that's a PITA. I'd much rather have been able to tell configure
*which* perl to use:

./configure --with-perl=/usr/bin/perl5.8.6

The more usual way to handle this sort of thing is to put each version
of perl in a different directory, and then you can alter PATH while
running configure to pick which one you want. I've got several versions
of perl on this machine that I select that way ... it doesn't require
any special smarts on the part of the perl-using program, and it scales
to handle multiple versions of other things like Tcl, too.

regards, tom lane

#7Tom Lane
tgl@sss.pgh.pa.us
In reply to: David E. Wheeler (#5)
Re: Suggestion: Which Binary?

David Wheeler <david@kineticode.com> writes:

Yes, but even the environment variables get me what I want. I
therefore respectfully submit the attached patch to document them in
the INSTALL file.

It seems rather pointless to document two instances of what is in fact
a generic autoconf-script behavior ...

regards, tom lane

#8David E. Wheeler
david@kineticode.com
In reply to: Tom Lane (#6)
Re: Suggestion: Which Binary?

On Mar 31, 2006, at 15:52, Tom Lane wrote:

The more usual way to handle this sort of thing is to put each version
of perl in a different directory, and then you can alter PATH while
running configure to pick which one you want. I've got several
versions
of perl on this machine that I select that way ... it doesn't require
any special smarts on the part of the perl-using program, and it
scales
to handle multiple versions of other things like Tcl, too.

I would normally do that, as well, but in this case, I wanted my self-
compiled Perl to always be what runs (as a general rule), so I had it
hard link itself in /usr/bin as well as /usr/local/bin. It is only in
this one case where I need the stock Perl to be found that things get
wonky for me. :-)

Best,

David

#9David E. Wheeler
david@kineticode.com
In reply to: Tom Lane (#7)
Re: Suggestion: Which Binary?

On Mar 31, 2006, at 16:01, Tom Lane wrote:

It seems rather pointless to document two instances of what is in fact
a generic autoconf-script behavior ...

I'm sorry to be such a moron about this, but what exactly is that
behavior? That you can specify an environment variable for whatever *
is in --with-*?

Thanks,

David

#10David Fetter
david@fetter.org
In reply to: Tom Lane (#6)
Re: Suggestion: Which Binary?

On Fri, Mar 31, 2006 at 06:52:51PM -0500, Tom Lane wrote:

David Wheeler <david@kineticode.com> writes:

But that's a PITA. I'd much rather have been able to tell configure
*which* perl to use:

./configure --with-perl=/usr/bin/perl5.8.6

The more usual way to handle this sort of thing is to put each
version of perl in a different directory, and then you can alter
PATH while running configure to pick which one you want. I've got
several versions of perl on this machine that I select that way ...
it doesn't require any special smarts on the part of the perl-using
program, and it scales to handle multiple versions of other things
like Tcl, too.

You mean something more like this?

PATH=/path/to/perl:/usr/bin:/bin ./configure ...

Sounds good, except when the perl people have in mind is on the same
path as other perls. How would changing $PATH help with a situation
like that?

Cheers,
D
--
David Fetter <david@fetter.org> http://fetter.org/
phone: +1 415 235 3778 AIM: dfetter666
Skype: davidfetter

Remember to vote!

#11Tom Lane
tgl@sss.pgh.pa.us
In reply to: David E. Wheeler (#9)
Re: Suggestion: Which Binary?

David Wheeler <david@kineticode.com> writes:

On Mar 31, 2006, at 16:01, Tom Lane wrote:

It seems rather pointless to document two instances of what is in fact
a generic autoconf-script behavior ...

I'm sorry to be such a moron about this, but what exactly is that
behavior? That you can specify an environment variable for whatever *
is in --with-*?

The generic autoconf documentation says

You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:

./configure CC=c89 CFLAGS=-O2 LIBS=-lposix

This isn't super helpful, of course, since it doesn't say exactly which
variables any particular autoconf script responds to. But pretty much
all of the programs that a configure script searches for are reflected
as variables. A quick grep through our configure script for the phrase
"Let the user override" finds a couple dozen hits, and that's just for
programs, never mind non-program variables.

regards, tom lane

#12Peter Eisentraut
peter_e@gmx.net
In reply to: David E. Wheeler (#5)
Re: Suggestion: Which Binary?

David Wheeler wrote:

Yes, but even the environment variables get me what I want. I
therefore respectfully submit the attached patch to document them in
the INSTALL file.

Next time you submit a patch, please consider reading it before sending
it out.

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

#13Jim Nasby
Jim.Nasby@BlueTreble.com
In reply to: Tom Lane (#7)
Re: Suggestion: Which Binary?

On Fri, Mar 31, 2006 at 07:01:18PM -0500, Tom Lane wrote:

David Wheeler <david@kineticode.com> writes:

Yes, but even the environment variables get me what I want. I
therefore respectfully submit the attached patch to document them in
the INSTALL file.

It seems rather pointless to document two instances of what is in fact
a generic autoconf-script behavior ...

The problem is that PostgreSQL is moving out of the realm of "hard-core
geeks only" and more into the mainstream. I'd bet a number of our users
have very little idea how autoconf and it's progeny work. It's probably
not unlikely that those folks would be able to figure out where their
perl was, but then not know how to tell it to configure.
--
Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

#14Peter Eisentraut
peter_e@gmx.net
In reply to: Jim Nasby (#13)
Re: Suggestion: Which Binary?

Jim C. Nasby wrote:

The problem is that PostgreSQL is moving out of the realm of
"hard-core geeks only" and more into the mainstream.

Someone who has a non-default Perl installation is hardly mainstream.

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

#15Andrew Dunstan
andrew@dunslane.net
In reply to: Jim Nasby (#13)
Re: Suggestion: Which Binary?

Jim C. Nasby wrote:

On Fri, Mar 31, 2006 at 07:01:18PM -0500, Tom Lane wrote:

David Wheeler <david@kineticode.com> writes:

Yes, but even the environment variables get me what I want. I
therefore respectfully submit the attached patch to document them in
the INSTALL file.

It seems rather pointless to document two instances of what is in fact
a generic autoconf-script behavior ...

The problem is that PostgreSQL is moving out of the realm of "hard-core
geeks only" and more into the mainstream. I'd bet a number of our users
have very little idea how autoconf and it's progeny work. It's probably
not unlikely that those folks would be able to figure out where their
perl was, but then not know how to tell it to configure.

Most such users would use a binary distribution, though - either from
the OS supplier or from our collection of binaries. If people are going
to build postgres themselves from source then I *do* expect them to be
moderately hard-core geeks.

cheers

andrew

#16David E. Wheeler
david@kineticode.com
In reply to: Tom Lane (#11)
Re: Suggestion: Which Binary?

On Mar 31, 2006, at 20:02, Tom Lane wrote:

You can give `configure' initial values for configuration
parameters
by setting variables in the command line or in the environment.
Here
is an example:

./configure CC=c89 CFLAGS=-O2 LIBS=-lposix

This isn't super helpful, of course, since it doesn't say exactly
which
variables any particular autoconf script responds to. But pretty much
all of the programs that a configure script searches for are reflected
as variables. A quick grep through our configure script for the
phrase
"Let the user override" finds a couple dozen hits, and that's just for
programs, never mind non-program variables.

Right, but me, while I compile lots of stuff, I don't understand
configure or autconf at all. So I was completely unaware of this
feature. I'm very pleased to know it now, of course. But I don't see
how it could be any harm to add notes to the INSTALL file explicitly
letting users know how to do stuff like this. The INSTALL file is,
after all, what folks like me read when looking for information
beyond ./configure && make && make install. It would have helped me a
lot, and I see no disadvantage to including it.

Am I missing something?

Thanks,

David

#17David E. Wheeler
david@kineticode.com
In reply to: Peter Eisentraut (#12)
Re: Suggestion: Which Binary?

On Apr 1, 2006, at 06:58, Peter Eisentraut wrote:

Next time you submit a patch, please consider reading it before
sending
it out.

I just read the patch, and it looks fine to me. No typos that I
noticed. I might have screwed up the SGML stuff, but I know even less
about SGML than I do about autoconf and configure. :-)

So, pray tell, what have I screwed up? I would of course be happy to
submit a corrected patch.

Best,

David

#18David E. Wheeler
david@kineticode.com
In reply to: David E. Wheeler (#17)
Re: Suggestion: Which Binary?

On Apr 1, 2006, at 15:39, David Wheeler wrote:

So, pray tell, what have I screwed up? I would of course be happy
to submit a corrected patch.

Sorry, I'm an idiot. New version attached.

Best,

David

Attachments:

perl_python.patch.txttext/plain; name=perl_python.patch.txt; x-unix-mode=0644Download+13-0
#19Peter Eisentraut
peter_e@gmx.net
In reply to: David E. Wheeler (#18)
Re: Suggestion: Which Binary?

David Wheeler wrote:

On Apr 1, 2006, at 15:39, David Wheeler wrote:

So, pray tell, what have I screwed up? I would of course be happy
to submit a corrected patch.

Sorry, I'm an idiot. New version attached.

Well, you got one of them, but I still have my doubts about
"/usr/bin/per5.8.6".

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

#20David E. Wheeler
david@kineticode.com
In reply to: Peter Eisentraut (#19)
Re: Suggestion: Which Binary?

On Apr 1, 2006, at 15:49, Peter Eisentraut wrote:

Well, you got one of them, but I still have my doubts about
"/usr/bin/per5.8.6".

LOL! God, what an oaf!

David

Attachments:

perl_python.patch.txttext/plain; name=perl_python.patch.txt; x-unix-mode=0644Download+13-0
#21Tom Lane
tgl@sss.pgh.pa.us
In reply to: David E. Wheeler (#16)
#22Robert Treat
xzilla@users.sourceforge.net
In reply to: Andrew Dunstan (#15)
#23Tom Lane
tgl@sss.pgh.pa.us
In reply to: Robert Treat (#22)
#24David E. Wheeler
david@kineticode.com
In reply to: Robert Treat (#22)
#25David E. Wheeler
david@kineticode.com
In reply to: Tom Lane (#21)
#26Peter Eisentraut
peter_e@gmx.net
In reply to: David E. Wheeler (#25)
#27David E. Wheeler
david@kineticode.com
In reply to: Peter Eisentraut (#26)
#28Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: David E. Wheeler (#27)
#29Peter Eisentraut
peter_e@gmx.net
In reply to: David E. Wheeler (#27)
#30David E. Wheeler
david@kineticode.com
In reply to: Alvaro Herrera (#28)
#31David E. Wheeler
david@kineticode.com
In reply to: Peter Eisentraut (#29)
#32David E. Wheeler
david@kineticode.com
In reply to: David E. Wheeler (#31)
#33Tom Lane
tgl@sss.pgh.pa.us
In reply to: David E. Wheeler (#32)
#34Peter Eisentraut
peter_e@gmx.net
In reply to: David E. Wheeler (#32)
#35Andrew Dunstan
andrew@dunslane.net
In reply to: Robert Treat (#22)
#36Joshua D. Drake
jd@commandprompt.com
In reply to: Jim Nasby (#13)
#37David E. Wheeler
david@kineticode.com
In reply to: Tom Lane (#33)
#38Bruce Momjian
bruce@momjian.us
In reply to: David E. Wheeler (#37)
#39David E. Wheeler
david@kineticode.com
In reply to: Bruce Momjian (#38)
#40Bruce Momjian
bruce@momjian.us
In reply to: David E. Wheeler (#37)
#41David E. Wheeler
david@kineticode.com
In reply to: Bruce Momjian (#40)