Re: sh -> pl

Lists: pgsql-hackers
From: David Fetter <david(at)fetter(dot)org>
To: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: sh -> pl
Date: 2008-06-17 14:04:39
Message-ID: 20080617140439.GA11140@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Folks,

I've noticed that a big hunk of our build system has gratuitous
dependencies on some variety of shell and on tools like sed, none of
which makes Windows developers feel welcome. I know people are
working toward a cmake or other more cross-platform toolchain.

My proposal is a lot more modest, and doesn't conflict with the larger
one. I'd like to move the above stuff to self-contained perl would
help to make things more cross-platform and clean up, no offense to
the fine authors, some pretty crufty code in there.

Comments? Objections?

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: David Fetter <david(at)fetter(dot)org>
Cc: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: sh -> pl
Date: 2008-06-17 14:19:59
Message-ID: 4857C80F.8040008@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

David Fetter wrote:
> Folks,
>
> I've noticed that a big hunk of our build system has gratuitous
> dependencies on some variety of shell and on tools like sed, none of
> which makes Windows developers feel welcome. I know people are
> working toward a cmake or other more cross-platform toolchain.
>
> My proposal is a lot more modest, and doesn't conflict with the larger
> one. I'd like to move the above stuff to self-contained perl would
> help to make things more cross-platform and clean up, no offense to
> the fine authors, some pretty crufty code in there.
>
>
>

Give us some examples. (If you think the sed scripts are crufty, check
out some of the awk we use.)

In the case of sed, there is a standard perl replacement called psed
which can be used in at least simple cases.

But nothing we do to the make-based build system will make Windows
developers wanting to use MSVC feel any better, so I'm not quite sure
exactly what you would achieve.

Is perl currently required to build from tarball? If not, you would be
placing an additional build requirement and there may still be a few odd
build environments that don't sport perl by default.

cheers

andrew


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Fetter <david(at)fetter(dot)org>
Cc: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: sh -> pl
Date: 2008-06-17 14:25:49
Message-ID: 20275.1213712749@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

David Fetter <david(at)fetter(dot)org> writes:
> My proposal is a lot more modest, and doesn't conflict with the larger
> one. I'd like to move the above stuff to self-contained perl would
> help to make things more cross-platform and clean up, no offense to
> the fine authors, some pretty crufty code in there.

This seems quite useless. Make scripts always rely on a shell
environment; you won't be buying any portability at all.

We might or might not want to switch to cmake, but I don't see any
value in half-measures.

regards, tom lane


From: David Fetter <david(at)fetter(dot)org>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: sh -> pl
Date: 2008-06-17 14:41:19
Message-ID: 20080617144119.GD11140@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Jun 17, 2008 at 10:19:59AM -0400, Andrew Dunstan wrote:
> David Fetter wrote:
>> Folks,
>>
>> I've noticed that a big hunk of our build system has gratuitous
>> dependencies on some variety of shell and on tools like sed, none
>> of which makes Windows developers feel welcome. I know people are
>> working toward a cmake or other more cross-platform toolchain. My
>> proposal is a lot more modest, and doesn't conflict with the larger
>> one. I'd like to move the above stuff to self-contained perl would
>> help to make things more cross-platform and clean up, no offense to
>> the fine authors, some pretty crufty code in there.
>
> Give us some examples.

That new version stamper calls out to sed, when perl is perfectly
capable of doing the same work itself and not spawning 30 shells in
the process.

> (If you think the sed scripts are crufty, check out some of the awk
> we use.)

Another cleanup opportunity :)

> In the case of sed, there is a standard perl replacement called psed which
> can be used in at least simple cases.
>
> But nothing we do to the make-based build system will make Windows
> developers wanting to use MSVC feel any better, so I'm not quite sure
> exactly what you would achieve.

Well, it'll wind up with a build system that's documented a lot better
than it is :)

> Is perl currently required to build from tarball? If not, you would
> be placing an additional build requirement and there may still be a
> few odd build environments that don't sport perl by default.

This is 2008, and it's silly to pretend we need to support this
"requirement" on systems where people are building Postgres.

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: David Fetter <david(at)fetter(dot)org>
Cc: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: sh -> pl
Date: 2008-06-17 15:02:44
Message-ID: 4857D214.4050102@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

David Fetter wrote:
> On Tue, Jun 17, 2008 at 10:19:59AM -0400, Andrew Dunstan wrote:
>
>> David Fetter wrote:
>>
>>> Folks,
>>>
>>> I've noticed that a big hunk of our build system has gratuitous
>>> dependencies on some variety of shell and on tools like sed, none
>>> of which makes Windows developers feel welcome. I know people are
>>> working toward a cmake or other more cross-platform toolchain. My
>>> proposal is a lot more modest, and doesn't conflict with the larger
>>> one. I'd like to move the above stuff to self-contained perl would
>>> help to make things more cross-platform and clean up, no offense to
>>> the fine authors, some pretty crufty code in there.
>>>
>> Give us some examples.
>>
>
> That new version stamper calls out to sed, when perl is perfectly
> capable of doing the same work itself and not spawning 30 shells in
> the process.
>

I thought you might be thinking of that. In fact, you are completely
mischaracterising this script, which is not any part of the build
system. It is a maintenance tool, probably of practical interest to
about three people, and there is no requirement for it to be cross-platform.

>> Is perl currently required to build from tarball? If not, you would
>> be placing an additional build requirement and there may still be a
>> few odd build environments that don't sport perl by default.
>>
>
> This is 2008, and it's silly to pretend we need to support this
> "requirement" on systems where people are building Postgres.
>
>
>

Weren't you the person who just wanted not to be painted into a corner?
In general, I am in favor of having as few build dependencies as
possible. So should you be.

cheers

andrew


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: David Fetter <david(at)fetter(dot)org>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: sh -> pl
Date: 2008-06-17 15:07:12
Message-ID: 20080617150712.GQ4918@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

David Fetter wrote:

> That new version stamper calls out to sed, when perl is perfectly
> capable of doing the same work itself and not spawning 30 shells in
> the process.

That's great. Please send a patch to improve the stamper. (Are you
really worried about its performance, given that it runs about once a
month on average?)

> > (If you think the sed scripts are crufty, check out some of the awk
> > we use.)
>
> Another cleanup opportunity :)

I'm not sure it's the same case here, because the stamper is supposed to
run on very few machines (mostly just Marc's) whereas the rest of the
stuff is supposed to run on many others.

> > Is perl currently required to build from tarball? If not, you would
> > be placing an additional build requirement and there may still be a
> > few odd build environments that don't sport perl by default.
>
> This is 2008, and it's silly to pretend we need to support this
> "requirement" on systems where people are building Postgres.

Maybe, or maybe not. Do these platforms all have Perl?

gypsy_moth Solaris 8 SUN Studio 8 sparc
warthog UnixWare 7.1.4 cc 4.2 isa
canary NetBSD 1.6 gcc 2.95.3 x86
kudu Solaris 9 Sun WorkShop 6 update 2 C 5.3 x86
spoonbill OpenBSD OpenBSD 4.2 gcc gcc 3.3.5 Sparc64
grebe AIX 5.3 GCC 4.0.1 PPC
osprey NetBSD 2.0 gcc 3.3.3 m68k

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


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: David Fetter <david(at)fetter(dot)org>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: sh -> pl
Date: 2008-06-17 15:08:33
Message-ID: 4857D371.6060802@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

David Fetter wrote:
> On Tue, Jun 17, 2008 at 10:19:59AM -0400, Andrew Dunstan wrote:
>> David Fetter wrote:
>>> Folks,

> Well, it'll wind up with a build system that's documented a lot better
> than it is :)
>
>> Is perl currently required to build from tarball? If not, you would
>> be placing an additional build requirement and there may still be a
>> few odd build environments that don't sport perl by default.
>
> This is 2008, and it's silly to pretend we need to support this
> "requirement" on systems where people are building Postgres.

I am curious what your overall proposal includes? Would I do:

perl Makefile.PL; make?

Or would things like autoconf and bison still be required?

Or are you just presenting to remove all the underlying nits that are
tied to all the different unix derived utilities?

Sincerely,

Joshua D. Drake


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: David Fetter <david(at)fetter(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: sh -> pl
Date: 2008-06-17 15:41:19
Message-ID: 22560.1213717279@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> David Fetter wrote:
>> This is 2008, and it's silly to pretend we need to support this
>> "requirement" on systems where people are building Postgres.

> Maybe, or maybe not. Do these platforms all have Perl?

In this connection it might be worth pointing to the Red Hat/Fedora
definition of the standard minimum build environment:
https://fedoraproject.org/wiki/Packaging/Guidelines#Exceptions
which I can assure you is no spur-of-the-moment list but was
very carefully chosen.

It has awk, and sed ... but not perl.

regards, tom lane


From: Kris Jurka <books(at)ejurka(dot)com>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: David Fetter <david(at)fetter(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: sh -> pl
Date: 2008-06-17 16:25:09
Message-ID: Pine.BSO.4.64.0806171224250.7554@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, 17 Jun 2008, Alvaro Herrera wrote:

> Maybe, or maybe not. Do these platforms all have Perl?
>

Of course. They're all buildfarm clients and the buildfarm script is
perl.

Kris Jurka


From: Jorgen Austvik <Jorgen(dot)Austvik(at)Sun(dot)COM>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: David Fetter <david(at)fetter(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: sh -> pl
Date: 2008-06-17 22:26:05
Message-ID: 485839FD.9030608@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Alvaro Herrera wrote:
> Maybe, or maybe not. Do these platforms all have Perl?
> gypsy_moth Solaris 8 SUN Studio 8 spar
If the moths don't have perl, we'll add it, no problem - don't let that
stop anything.

(On a separate note, we have had some problems internally with DNS, so
some reporting has failed from some of out moths, it is a Sun internal
infrastructure problem which we are looking into.)

-Jørgen
--
Sun Database Group

http://blogs.sun.com/austvik


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Jorgen Austvik <Jorgen(dot)Austvik(at)Sun(dot)COM>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, David Fetter <david(at)fetter(dot)org>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: sh -> pl
Date: 2008-06-17 22:31:32
Message-ID: 48583B44.4000004@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Jorgen Austvik wrote:
> Alvaro Herrera wrote:
>> Maybe, or maybe not. Do these platforms all have Perl?
>> gypsy_moth Solaris 8 SUN Studio 8 spar
> If the moths don't have perl, we'll add it, no problem - don't let
> that stop anything.
>
>

Of course they have perl - the buildfarm script is perl.

cheers

andrew


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: David Fetter <david(at)fetter(dot)org>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: sh -> pl
Date: 2008-06-19 02:33:13
Message-ID: 200806190233.m5J2XD225976@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

David Fetter wrote:
> On Tue, Jun 17, 2008 at 10:19:59AM -0400, Andrew Dunstan wrote:
> > David Fetter wrote:
> >> Folks,
> >>
> >> I've noticed that a big hunk of our build system has gratuitous
> >> dependencies on some variety of shell and on tools like sed, none
> >> of which makes Windows developers feel welcome. I know people are
> >> working toward a cmake or other more cross-platform toolchain. My
> >> proposal is a lot more modest, and doesn't conflict with the larger
> >> one. I'd like to move the above stuff to self-contained perl would
> >> help to make things more cross-platform and clean up, no offense to
> >> the fine authors, some pretty crufty code in there.
> >
> > Give us some examples.
>
> That new version stamper calls out to sed, when perl is perfectly
> capable of doing the same work itself and not spawning 30 shells in
> the process.

This does remind me of the "Useless Use of Cat Award" from
comp.unix.shell:

http://partmaps.org/era/unix/award.html

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: David Fetter <david(at)fetter(dot)org>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: sh -> pl
Date: 2008-06-19 03:38:11
Message-ID: 4859D4A3.3050609@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bruce Momjian wrote:
> David Fetter wrote:
>
>> On Tue, Jun 17, 2008 at 10:19:59AM -0400, Andrew Dunstan wrote:
>>
>>> David Fetter wrote:
>>>
>>>> Folks,
>>>>
>>>> I've noticed that a big hunk of our build system has gratuitous
>>>> dependencies on some variety of shell and on tools like sed, none
>>>> of which makes Windows developers feel welcome. I know people are
>>>> working toward a cmake or other more cross-platform toolchain. My
>>>> proposal is a lot more modest, and doesn't conflict with the larger
>>>> one. I'd like to move the above stuff to self-contained perl would
>>>> help to make things more cross-platform and clean up, no offense to
>>>> the fine authors, some pretty crufty code in there.
>>>>
>>> Give us some examples.
>>>
>> That new version stamper calls out to sed, when perl is perfectly
>> capable of doing the same work itself and not spawning 30 shells in
>> the process.
>>
>
> This does remind me of the "Useless Use of Cat Award" from
> comp.unix.shell:
>
> http://partmaps.org/era/unix/award.html
>

Well, yes. I was confused before. I thought David was referring to the
new add_cvs_markers script (which BTW does not spawn any useless shells
at all).

This script (version_stamp.pl) is already perl, and so David's criticism
of it is slightly justified, although it spawns sh and sed 5 times, not
30. It is at best a very minor inefficiency - something that mildly
annoys those of us well at home in perl and is blithely and not
unreasonably ignored by everyone else.

Note also that this script is not part of the build process either, so
the Windows developer argument hardly holds here.

cheers

andrew