Re: Bugfix and new feature for PGXS

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Bruce Momjian <bruce(at)momjian(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: cedric(at)2ndquadrant(dot)com, pgsql-hackers(at)postgresql(dot)org, Josh Berkus <josh(at)agliodbs(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Craig Ringer <craig(at)2ndquadrant(dot)com>
Subject: Re: Bugfix and new feature for PGXS
Date: 2014-11-20 04:11:58
Message-ID: 546D6A0E.9080608@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 1/31/14 9:28 PM, Bruce Momjian wrote:
> On Fri, Jan 31, 2014 at 09:28:06PM -0500, Andrew Dunstan wrote:
>>
>> On 01/31/2014 09:19 PM, Bruce Momjian wrote:
>>> On Thu, Oct 10, 2013 at 11:00:30PM -0400, Andrew Dunstan wrote:
>>>> On 10/10/2013 09:35 PM, Peter Eisentraut wrote:
>>>>> On Tue, 2013-10-08 at 10:04 -0400, Andrew Dunstan wrote:
>>>>>> On 10/07/2013 08:47 PM, Peter Eisentraut wrote:
>>>>>>> I suspect this line
>>>>>>>
>>>>>>> submake-libpq: $(libdir)/libpq.so ;
>>>>>>>
>>>>>>> will cause problems on platforms with a different extension (e.g. OS X).
>>>>>> suggested fix is below.
>>>>> Hmm, this would duplicate information about shared library naming in a
>>>>> place outside of Makefile.shlib. That doesn't look right.
>>>>
>>>> Please suggest an alternative.
>>> Did we ever address this?
>>>
>>
>> No. I never got a reply, AFAIK.
>
> OK, seems there is no known fix then. Thanks.

I noticed this item was still in the 9.4 code. Looking at the original
submission
(http://www.postgresql.org/message-id/201306181552.36673.cedric@2ndquadrant.com,
patch 0001), I think the original reason for adding this was wrong to
begin with. Attached patch 0001 fixes that. The applicable parts of
that patch could be backpatched as a bug fix (but evidently no one cares
about building contrib with pgxs (except when I submit a patch to remove
it)).

In that topic, I also propose attached patch 0002 for 9.4, which removes
the use of the USE_VPATH variable and just uses VPATH. There is no need
for this additional indirection. Also, USE_FOO variables are typically
Boolean, so this is misnamed.

I note that the documentation in this topic
(http://www.postgresql.org/docs/devel/static/extend-pgxs.html) suggests
the use of config/prep_buildtree, but that is not installed, so I don't
know how much use that advice is. (I don't know at this point whether
just installing it would be a solution.)

Thirdly, I propose attached patch 0003, which reverts patch 0004 in the
original submission. I believe that patch was unnecessary, and I think
the new code is uglier. (Of course, I'm biased, because I wrote the old
code.) Technically, this ought to be for 9.5 only.

Finally, I have written a test suite for PGXS to support all these
outrageous claims: https://github.com/petere/test_pgxs. This tests most
of the variables supported in PGXS makefiles and tests that both
documented ways of vpath builds work. I don't propose this for
inclusion at the moment, because that would require more work, but it's
a good reference.

Attachment Content-Type Size
0001-Fix-SHLIB_PREREQS-use-in-contrib-allowing-PGXS-build.patch application/x-patch 3.1 KB
0002-Remove-USE_VPATH-make-variable-from-PGXS.patch application/x-patch 2.0 KB
0003-Revert-haphazard-pgxs-makefile-changes.patch application/x-patch 2.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Abhijit Menon-Sen 2014-11-20 04:22:01 Re: What exactly is our CRC algorithm?
Previous Message Peter Geoghegan 2014-11-20 04:08:18 Re: Nitpicky doc corrections for BRIN functions of pageinspect