Re: Bumping libpq version number?

Lists: pgsql-hackers
From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Bumping libpq version number?
Date: 2005-03-11 17:58:28
Message-ID: 200503111758.j2BHwSE10414@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Are we still bumping the libpq major version number for 8.0.2? I think
it is a bad idea because we will require too many client apps to be
recompiled, and we have had few problem reports.

We do need to bump the major version number for 8.1 and I am doing that
now.

One new problem I see is that changes to libpgport could affect client
apps that call libpq because they pull functions from pgport via libpq.
For example, now that snprintf is called pg_snprintf, my initdb failed
in the regression tests because the the new initdb binary used
pg_snprintf but the installed libpq (ld.so.conf) didn't have it yet.

The bottom line is that we only used to require major libpq version
bumps when we changed the libpq API. Now, with libpgport, I am
concerned that changes in libpgport also will require a major version
bump. This adds support to the idea that we will have to do a major
libpq bump for every major release.

--
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: Stephen Frost <sfrost(at)snowman(dot)net>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bumping libpq version number?
Date: 2005-03-11 18:11:26
Message-ID: 20050311181126.GL10437@ns.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

* Bruce Momjian (pgman(at)candle(dot)pha(dot)pa(dot)us) wrote:
> Are we still bumping the libpq major version number for 8.0.2? I think
> it is a bad idea because we will require too many client apps to be
> recompiled, and we have had few problem reports.
>
> We do need to bump the major version number for 8.1 and I am doing that
> now.
>
> One new problem I see is that changes to libpgport could affect client
> apps that call libpq because they pull functions from pgport via libpq.
> For example, now that snprintf is called pg_snprintf, my initdb failed
> in the regression tests because the the new initdb binary used
> pg_snprintf but the installed libpq (ld.so.conf) didn't have it yet.
>
> The bottom line is that we only used to require major libpq version
> bumps when we changed the libpq API. Now, with libpgport, I am
> concerned that changes in libpgport also will require a major version
> bump. This adds support to the idea that we will have to do a major
> libpq bump for every major release.

Uh, major libpq version bumps should happen when there's an incompatible
ABI change. I'm not entirely sure how libpgport relates, but libpq
versions shouldn't be explicitly linked to major release numbers and
it's possible for them to change between major releases...

Stephen


From: Kurt Roeckx <kurt(at)roeckx(dot)be>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bumping libpq version number?
Date: 2005-03-11 18:21:10
Message-ID: 20050311182110.GA26120@roeckx.be
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Mar 11, 2005 at 12:58:28PM -0500, Bruce Momjian wrote:
> Are we still bumping the libpq major version number for 8.0.2? I think
> it is a bad idea because we will require too many client apps to be
> recompiled, and we have had few problem reports.
>
> We do need to bump the major version number for 8.1 and I am doing that
> now.
>
> One new problem I see is that changes to libpgport could affect client
> apps that call libpq because they pull functions from pgport via libpq.
> For example, now that snprintf is called pg_snprintf, my initdb failed
> in the regression tests because the the new initdb binary used
> pg_snprintf but the installed libpq (ld.so.conf) didn't have it yet.

Does initdb call pg_snprintf directly? Or does it call some
libpq function that calls it?

> The bottom line is that we only used to require major libpq version
> bumps when we changed the libpq API. Now, with libpgport, I am
> concerned that changes in libpgport also will require a major version
> bump. This adds support to the idea that we will have to do a major
> libpq bump for every major release.

Soname changes really should only happen in case of API or ABI
changes and I think you really should try to avoid them. I'm not
sure why you think it's required now.

Also, I think it's alot better to actually do soname changes to
libraries if things can break. I don't see having 2 library
versions around as a problem. And I'd rather have something I
just know is not going to work.

Kurt


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Kurt Roeckx <kurt(at)roeckx(dot)be>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bumping libpq version number?
Date: 2005-03-11 18:29:46
Message-ID: 200503111829.j2BITkt24876@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Kurt Roeckx wrote:
> On Fri, Mar 11, 2005 at 12:58:28PM -0500, Bruce Momjian wrote:
> > Are we still bumping the libpq major version number for 8.0.2? I think
> > it is a bad idea because we will require too many client apps to be
> > recompiled, and we have had few problem reports.
> >
> > We do need to bump the major version number for 8.1 and I am doing that
> > now.
> >
> > One new problem I see is that changes to libpgport could affect client
> > apps that call libpq because they pull functions from pgport via libpq.
> > For example, now that snprintf is called pg_snprintf, my initdb failed
> > in the regression tests because the the new initdb binary used
> > pg_snprintf but the installed libpq (ld.so.conf) didn't have it yet.
>
> Does initdb call pg_snprintf directly? Or does it call some
> libpq function that calls it?

With the current CVS, initdb calls pg_snprintf() on my platform which
doesn't support %$ natively on my libc printf. Now, initdb could pull
from pgport itself but I think it pulled from libpq first. Perhaps we
should reorder how those libraries appear in the link line but I think
that would fix just this case, not the more general one of pg client
apps.

> > The bottom line is that we only used to require major libpq version
> > bumps when we changed the libpq API. Now, with libpgport, I am
> > concerned that changes in libpgport also will require a major version
> > bump. This adds support to the idea that we will have to do a major
> > libpq bump for every major release.
>
> Soname changes really should only happen in case of API or ABI
> changes and I think you really should try to avoid them. I'm not
> sure why you think it's required now.

We had the problem with 8.0.X where we remove get_progname from libpq
and psql and friends were pulling that from libpq in the past for 7.4.

> Also, I think it's alot better to actually do soname changes to
> libraries if things can break. I don't see having 2 library
> versions around as a problem. And I'd rather have something I
> just know is not going to work.

Yes, that is where I am leaning in this discussion because libpgport
varies much more frequently than the libpq API. However, changing the
link order should fix that so let me do that and see if it helps.

--
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: Kurt Roeckx <kurt(at)roeckx(dot)be>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bumping libpq version number?
Date: 2005-03-11 19:28:04
Message-ID: 20050311192804.GA26406@roeckx.be
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Mar 11, 2005 at 01:29:46PM -0500, Bruce Momjian wrote:
> Kurt Roeckx wrote:
> >
> > Does initdb call pg_snprintf directly? Or does it call some
> > libpq function that calls it?
>
> With the current CVS, initdb calls pg_snprintf() on my platform which
> doesn't support %$ natively on my libc printf. Now, initdb could pull
> from pgport itself but I think it pulled from libpq first. Perhaps we
> should reorder how those libraries appear in the link line but I think
> that would fix just this case, not the more general one of pg client
> apps.

Do "client apps" ever link to pgport itself? I assume only
"internal" applictions link to it?

I assume libpq is staticly linked to pgport and is exporting
symbols it shouldn't. Can we prevent it from exporting those
symbols?

Kurt


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Kurt Roeckx <kurt(at)roeckx(dot)be>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bumping libpq version number?
Date: 2005-03-11 19:37:17
Message-ID: 200503111937.j2BJbHS19745@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Kurt Roeckx wrote:
> On Fri, Mar 11, 2005 at 01:29:46PM -0500, Bruce Momjian wrote:
> > Kurt Roeckx wrote:
> > >
> > > Does initdb call pg_snprintf directly? Or does it call some
> > > libpq function that calls it?
> >
> > With the current CVS, initdb calls pg_snprintf() on my platform which
> > doesn't support %$ natively on my libc printf. Now, initdb could pull
> > from pgport itself but I think it pulled from libpq first. Perhaps we
> > should reorder how those libraries appear in the link line but I think
> > that would fix just this case, not the more general one of pg client
> > apps.
>
> Do "client apps" ever link to pgport itself? I assume only
> "internal" applictions link to it?

They do.

> I assume libpq is staticly linked to pgport and is exporting
> symbols it shouldn't. Can we prevent it from exporting those
> symbols?

I can think of no way to prevent it, except on Win32 that has an exports
file.

--
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: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bumping libpq version number?
Date: 2005-03-11 21:39:59
Message-ID: 200503112240.00185.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bruce Momjian wrote:
> Are we still bumping the libpq major version number for 8.0.2?

Yes.

> I
> think it is a bad idea because we will require too many client apps
> to be recompiled,

That is not true, as previously discussed.

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


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bumping libpq version number?
Date: 2005-03-11 21:47:40
Message-ID: 200503112147.j2BLleT26913@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut wrote:
> Bruce Momjian wrote:
> > Are we still bumping the libpq major version number for 8.0.2?
>
> Yes.
>
> > I
> > think it is a bad idea because we will require too many client apps
> > to be recompiled,
>
> That is not true, as previously discussed.

It is not true only if the old libpq stays around, which isn't always
the case.

--
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: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bumping libpq version number?
Date: 2005-03-11 22:17:07
Message-ID: 200503112317.07711.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bruce Momjian wrote:
> It is not true only if the old libpq stays around, which isn't always
> the case.

I think that would clearly be a Don't-do-that-then situation.

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


From: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bumping libpq version number?
Date: 2005-03-11 22:17:51
Message-ID: 20050311181714.I92893@ganymede.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, 11 Mar 2005, Bruce Momjian wrote:

> Peter Eisentraut wrote:
>> Bruce Momjian wrote:
>>> Are we still bumping the libpq major version number for 8.0.2?
>>
>> Yes.
>>
>>> I
>>> think it is a bad idea because we will require too many client apps
>>> to be recompiled,
>>
>> That is not true, as previously discussed.
>
> It is not true only if the old libpq stays around, which isn't always
> the case.

that's an administrative decision though, not ours ... we have source code
going back to 6.x, so it isn't like older versions aren't available ...

----
Marc G. Fournier Hub.Org Networking Services (http://www.hub.org)
Email: scrappy(at)hub(dot)org Yahoo!: yscrappy ICQ: 7615664


From: Andrew - Supernews <andrew+nonews(at)supernews(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Bumping libpq version number?
Date: 2005-03-13 13:22:10
Message-ID: slrnd38fk1.3a6.andrew+nonews@trinity.supernews.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2005-03-11, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> wrote:
> Kurt Roeckx wrote:
>> I assume libpq is staticly linked to pgport and is exporting
>> symbols it shouldn't. Can we prevent it from exporting those
>> symbols?
>
> I can think of no way to prevent it, except on Win32 that has an exports
> file.

At least a significant minority, if not an actual majority, of Unix
platforms do allow this; including (to my knowledge) Solaris, AIX and
everything using ELF with GNU ld (therefore including Linux and FreeBSD).

--
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: andrew(at)supernews(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Bumping libpq version number?
Date: 2005-03-13 19:22:31
Message-ID: 200503131922.j2DJMVh11884@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew - Supernews wrote:
> On 2005-03-11, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> wrote:
> > Kurt Roeckx wrote:
> >> I assume libpq is staticly linked to pgport and is exporting
> >> symbols it shouldn't. Can we prevent it from exporting those
> >> symbols?
> >
> > I can think of no way to prevent it, except on Win32 that has an exports
> > file.
>
> At least a significant minority, if not an actual majority, of Unix
> platforms do allow this; including (to my knowledge) Solaris, AIX and
> everything using ELF with GNU ld (therefore including Linux and FreeBSD).

OK, how is this done with ELF?

--
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 - Supernews <andrew+nonews(at)supernews(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Bumping libpq version number?
Date: 2005-03-13 21:36:57
Message-ID: slrnd39cjp.3a6.andrew+nonews@trinity.supernews.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2005-03-13, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> wrote:
> Andrew - Supernews wrote:
>> On 2005-03-11, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> wrote:
>> > I can think of no way to prevent it, except on Win32 that has an exports
>> > file.
>>
>> At least a significant minority, if not an actual majority, of Unix
>> platforms do allow this; including (to my knowledge) Solaris, AIX and
>> everything using ELF with GNU ld (therefore including Linux and FreeBSD).
>
> OK, how is this done with ELF?

Using version commands in a linker script file.

The minimal example looks about like this (for GNU ld, for Solaris ld
leave off the outer VERSION { } wrapper):

VERSION {
{
global: foo; bar; baz;
local: *;
};
}

This makes all symbols other than "foo", "bar" and "baz" into local symbols,
not visible outside the library.

This much of the Solaris-style symbol versioning support is handled entirely
in the linker and thus should work on any system with ELF and GNU ld, or on
Solaris with the native linker. (The rest requires runtime support, which
probably doesn't exist on platforms other than Solaris.)

--
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services