Re: psql & readline & win32

Lists: pgsql-hackers
From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql & readline & win32
Date: 2006-02-13 11:56:20
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCE6C7FE7@algol.sollentuna.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

> Would the easiest solution be to make a patch to readline for
> Win32, and only allow Win32 to link to readline if that patch
> is in readline, and spit out a compile error if readline
> doesn't have that patch.

What would we patch it with? I don't think anybody has found a problem
there, this is a separate file that you ship along with it.

> As far as the license, psql spits out a copyright notice as
> it starts.
> It would be a shame to have to mention GPL in there.

Even that may not be enough. This is the GPL we're talking about.

> Can we get any companies to fund a port of libedit to Win32?

That would be nice. Takers?

> What does readline have that Win32 native editing does not?

tab completion, for one. Some editing keys, IIRC. I thought history, but
it does seem we have history workign on native :)

//Magnus


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Magnus Hagander <mha(at)sollentuna(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: psql & readline & win32
Date: 2006-02-13 17:12:31
Message-ID: 200602131712.k1DHCVH23738@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Magnus Hagander wrote:
> > Would the easiest solution be to make a patch to readline for
> > Win32, and only allow Win32 to link to readline if that patch
> > is in readline, and spit out a compile error if readline
> > doesn't have that patch.
>
> What would we patch it with? I don't think anybody has found a problem
> there, this is a separate file that you ship along with it.

Well, the problem is that it handles backslash incorrectly. We could
patch that in the readline source rather than playing with a
configuaration file.

> > As far as the license, psql spits out a copyright notice as
> > it starts.
> > It would be a shame to have to mention GPL in there.
>
> Even that may not be enough. This is the GPL we're talking about.

At that point, psql becomes GPL, no question.

> > Can we get any companies to fund a port of libedit to Win32?
>
> That would be nice. Takers?
>
>
> > What does readline have that Win32 native editing does not?
>
> tab completion, for one. Some editing keys, IIRC. I thought history, but
> it does seem we have history workign on native :)

I think what we don't have is saving history between psql uses.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Magnus Hagander <mha(at)sollentuna(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: psql & readline & win32
Date: 2006-02-13 17:52:17
Message-ID: 2734.1139853137@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Magnus Hagander wrote:
>> What would we patch it with? I don't think anybody has found a problem
>> there, this is a separate file that you ship along with it.

> Well, the problem is that it handles backslash incorrectly. We could
> patch that in the readline source rather than playing with a
> configuaration file.

Do the readline developers agree that it's "incorrect"? I could see
shipping a patch as a short-term band-aid, but not if the patch isn't
going to be accepted upstream.

>> Even that may not be enough. This is the GPL we're talking about.

> At that point, psql becomes GPL, no question.

Which means it's not happening, no?

regards, tom lane


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Magnus Hagander <mha(at)sollentuna(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: psql & readline & win32
Date: 2006-02-13 18:00:14
Message-ID: 200602131800.k1DI0Ej01563@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Magnus Hagander wrote:
> >> What would we patch it with? I don't think anybody has found a problem
> >> there, this is a separate file that you ship along with it.
>
> > Well, the problem is that it handles backslash incorrectly. We could
> > patch that in the readline source rather than playing with a
> > configuaration file.
>
> Do the readline developers agree that it's "incorrect"? I could see
> shipping a patch as a short-term band-aid, but not if the patch isn't
> going to be accepted upstream.

No idea. We need to develop the patch and submit it.

> >> Even that may not be enough. This is the GPL we're talking about.
>
> > At that point, psql becomes GPL, no question.
>
> Which means it's not happening, no?

To clearify, I meant the psql binary becomes GPL.

When we build psql with readline, which is our default on many
platforms, we are already be GPL'ing psql, at least according to the
copyright holders, FSF. We are dynamic linking on many platforms, but
according to the FSF, it makes it GPL.

I do think that adding readline features to the Win32 psql doesn't
warrant the license change for the psql binary.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Magnus Hagander <mha(at)sollentuna(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: psql & readline & win32
Date: 2006-02-13 18:19:46
Message-ID: 2980.1139854786@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Tom Lane wrote:
>>> At that point, psql becomes GPL, no question.
>>
>> Which means it's not happening, no?

> To clearify, I meant the psql binary becomes GPL.

There is no such thing as "the binary becomes GPL". GPL applies to
the source code.

> When we build psql with readline, which is our default on many
> platforms, we are already be GPL'ing psql, at least according to the
> copyright holders, FSF.

No, we are NOT doing that, not even according to FSF. Our usage of
a pre-installed readline library falls under this exception in the
standard GPL terms:

However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.

When we link to a readline library that is normally present on the
target system, we do not become covered by the GPL, because of this
exception. But shipping readline in our package would be a flat
violation of the GPL unless we are willing to relicense.

regards, tom lane


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Magnus Hagander <mha(at)sollentuna(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: psql & readline & win32
Date: 2006-02-13 18:45:55
Message-ID: 200602131845.k1DIjt508859@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Tom Lane wrote:
> >>> At that point, psql becomes GPL, no question.
> >>
> >> Which means it's not happening, no?
>
> > To clearify, I meant the psql binary becomes GPL.
>
> There is no such thing as "the binary becomes GPL". GPL applies to
> the source code.

OK.

> > When we build psql with readline, which is our default on many
> > platforms, we are already be GPL'ing psql, at least according to the
> > copyright holders, FSF.
>
> No, we are NOT doing that, not even according to FSF. Our usage of
> a pre-installed readline library falls under this exception in the
> standard GPL terms:
>
> However, as a
> special exception, the source code distributed need not include
> anything that is normally distributed (in either source or binary
> form) with the major components (compiler, kernel, and so on) of the
> operating system on which the executable runs, unless that component
> itself accompanies the executable.
>
> When we link to a readline library that is normally present on the
> target system, we do not become covered by the GPL, because of this
> exception. But shipping readline in our package would be a flat
> violation of the GPL unless we are willing to relicense.

Interesting, but that phrase is for what you need to distribute for an
already-GPL source code. See the "GPL-related disputes" section:

http://en.wikipedia.org/wiki/Gpl

and an old email from me on the topic:

http://archives.postgresql.org/pgsql-general/2003-08/msg01811.php

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Magnus Hagander <mha(at)sollentuna(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: psql & readline & win32
Date: 2006-02-13 19:05:17
Message-ID: 43F0D86D.9080109@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bruce Momjian wrote:

>>>When we build psql with readline, which is our default on many
>>>platforms, we are already be GPL'ing psql, at least according to the
>>>copyright holders, FSF.
>>>
>>>
>>No, we are NOT doing that, not even according to FSF. Our usage of
>>a pre-installed readline library falls under this exception in the
>>standard GPL terms:
>>
>> However, as a
>> special exception, the source code distributed need not include
>> anything that is normally distributed (in either source or binary
>> form) with the major components (compiler, kernel, and so on) of the
>> operating system on which the executable runs, unless that component
>> itself accompanies the executable.
>>
>>When we link to a readline library that is normally present on the
>>target system, we do not become covered by the GPL, because of this
>>exception. But shipping readline in our package would be a flat
>>violation of the GPL unless we are willing to relicense.
>>
>>
>
>Interesting, but that phrase is for what you need to distribute for an
>already-GPL source code. See the "GPL-related disputes" section:
>
> http://en.wikipedia.org/wiki/Gpl
>
>and an old email from me on the topic:
>
> http://archives.postgresql.org/pgsql-general/2003-08/msg01811.php
>
>
>

Let's just get off this track. We can easily tie ourselves up in knots
over it. Moving to libedit everywhere would be a good way to go if it's
achievable.

Incidentally, the exception quoted probably doesn't apply to any closed
source Unix any more than it does to Windows - last I looked none of
them normally ship libreadline. So presumably it's desirable to make
sure libedit works at least on those platforms.

So what's needed to bring libedit up to scratch? Are there any platforms
where it works as well as libreadline? On which platforms does it have
reduced or no functionality?

cheers

andrew


From: Greg Stark <gsstark(at)mit(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Magnus Hagander <mha(at)sollentuna(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: psql & readline & win32
Date: 2006-02-13 19:26:10
Message-ID: 87fymn5act.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> > To clearify, I meant the psql binary becomes GPL.
>
> There is no such thing as "the binary becomes GPL". GPL applies to
> the source code.

That's an odd thing to say. The binary is as much covered by copyright as the
source and can't be distributed without satisfying the requirements of the
license that covers it. The GPL requirements mean you can't distribute a
binary that depends on readline without including the corresponding source
code.

I'm not sure that's really an onerous requirement. It just means if you're a
commercial vendor selling a binary-only version of Postgres you can't link
your binary-only version against readline and then distribute it. Which should
be pretty obvious anyways.

(The exception Tom points out might even make it legal to distribute a Linux
compile of Postgres linked against readline since most Linux distributions
include readline. That wasn't true when that exception was written though so
you may want to check with your lawyer about that.)

I think people are mixing this stuff up with the less obvious claim about
programs like postgres being deemed "derivative works" of libraries like
readline because they "depend" on them. Postgres doesn't really depend in any
real sense on readline so I can't see that argument working in this case
anyways. If there was some GPLed library that Postgres couldn't work usefully
without then there might be a real need for a non-GPL'd version of that
library.

--
greg


From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Magnus Hagander <mha(at)sollentuna(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: psql & readline & win32
Date: 2006-02-13 20:33:32
Message-ID: 20060213203332.GF20796@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Feb 13, 2006 at 01:19:46PM -0500, Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > When we build psql with readline, which is our default on many
> > platforms, we are already be GPL'ing psql, at least according to the
> > copyright holders, FSF.

> When we link to a readline library that is normally present on the
> target system, we do not become covered by the GPL, because of this
> exception. But shipping readline in our package would be a flat
> violation of the GPL unless we are willing to relicense.

Umm, whatever happens, the licence on psql doesn't change. If we link
compile and link psql with readline and distribute the result, all that
means is that the combined work must be distributed under terms
compliant with the GPL (eg source availability, etc). The code doesn't
"become" GPL'd.

The licence on psql remains unchanged and if someone took the result
and deleted all the GPL stuff, the result would still be licenced as
BSD.

Only the copyright holder can change the licence of code. All the GPL
does in a combined work is require that any parts have the at least the
same freedoms as required by the GPL. Since BSD is compatable with (ie
more free than) the GPL, it's all ok, but at no point is any licence
changed.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.