Thread: pgxs and pginstaller

pgxs and pginstaller

From
Bruce Momjian
Date:
Thomas Hallgren wrote:
> Bruce Momjian wrote:
> 
> >Thomas Hallgren wrote:
> >  
> >
> >>Hi,
> >>I tried to compile PL/Java against PostgreSQL 8.1beta2. I use pgxs and 
> >>until now that has been just fine. Now pgxs suggests that the include 
> >>files reside under /usr/local/pgsql. They don't of course. Not on my 
> >>windows box anyway :-)
> >>
> >>I think it stems from the src/Makefile.global. On line 59 it reads:
> >>
> >>prefix := /usr/local/pgsql
> >>
> >>I guess I'm missing something. Can someone explain to me what I need to 
> >>change?
> >>    
> >>
> >
> >Take a look at Makefile.global.in.  That value is defined by the
> >--prefix flag when you run configure.  The default is /usr/local/pgsql,
> >and I am guessing you need to change that default on Win32.
> >
> >  
> >
> I'm using a pre-compiled installation of PostgreSQL. All I want to do is 
> use pgxs to be able to compile PL/Java.
> 
> There is other stuff that seems strange to me. Why do you append 
> 'postgresql' to the include directories further down in the file? I had 
> to remove that in order to compile.

Perhaps the builders of pginstaller could answer this question.

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


Re: pgxs and pginstaller

From
"Dave Page"
Date:

> -----Original Message-----
> From: pgsql-hackers-owner@postgresql.org
> [mailto:pgsql-hackers-owner@postgresql.org] On Behalf Of Bruce Momjian
> Sent: 22 September 2005 23:07
> To: Thomas Hallgren
> Cc: pgsql-hackers@postgresql.org
> Subject: [HACKERS] pgxs and pginstaller
>
> > There is other stuff that seems strange to me. Why do you append
> > 'postgresql' to the include directories further down in the
> file? I had
> > to remove that in order to compile.
>
> Perhaps the builders of pginstaller could answer this question.

We don't. We don't modify any of the files packaged in the installer
from when they are originally built. In the case of PostgreSQL itself,
it's built in /usr/local/src/postgresql-8.x, installed to
/usr/local/pgsql and then packaged up from there.

Regards, Dave


Re: pgxs and pginstaller

From
Thomas Hallgren
Date:
Dave Page wrote:
>  
> In the case of PostgreSQL itself, it's built in /usr/local/src/postgresql-8.x,> installed to /usr/local/pgsql and
thenpackaged up from there.
 
> 
Perhaps you should build it in the directory that the installer suggests 
as default for the installation? That way, most of the installations 
will work out of the box. If you should try that, be careful to use the 
Windows short representation (i.e. C:/Progra~1/PostgreSQL). Whitespace 
doesn't play well with most makefiles.

Regards,
Thomas Hallgren



Re: pgxs and pginstaller

From
"Dave Page"
Date:

> -----Original Message-----
> From: Thomas Hallgren [mailto:thhal@mailblocks.com]
> Sent: 23 September 2005 10:49
> To: Dave Page
> Cc: pgsql-hackers@postgresql.org
> Subject: Re: pgxs and pginstaller
>
> Dave Page wrote:
> >
> > In the case of PostgreSQL itself, it's built in
> /usr/local/src/postgresql-8.x,
>  > installed to /usr/local/pgsql and then packaged up from there.
> >
> Perhaps you should build it in the directory that the
> installer suggests
> as default for the installation? That way, most of the installations
> will work out of the box. If you should try that, be careful
> to use the
> Windows short representation (i.e. C:/Progra~1/PostgreSQL).
> Whitespace
> doesn't play well with most makefiles.

You can't because we build it under Msys which uses the Unix style
paths. GCC has a tendancy to barf horribly on Windows style paths as
well, as we found when trying to use pg_config with Slony.

I know little about pgxs, so if you can detail what settings need to
hacked during installation in the bug you opened I'd appreciate it. It
should be relatively trivial to rewrite in a custom action.

Regards, Dave


Re: pgxs and pginstaller

From
Thomas Hallgren
Date:
Dave Page wrote:

> 
>
>  
>
>>-----Original Message-----
>>From: Thomas Hallgren [mailto:thhal@mailblocks.com] 
>>Sent: 23 September 2005 10:49
>>To: Dave Page
>>Cc: pgsql-hackers@postgresql.org
>>Subject: Re: pgxs and pginstaller
>>
>>Dave Page wrote:
>>    
>>
>>> 
>>>In the case of PostgreSQL itself, it's built in 
>>>      
>>>
>>/usr/local/src/postgresql-8.x,
>> > installed to /usr/local/pgsql and then packaged up from there.
>>    
>>
>>Perhaps you should build it in the directory that the 
>>installer suggests 
>>as default for the installation? That way, most of the installations 
>>will work out of the box. If you should try that, be careful 
>>to use the 
>>Windows short representation (i.e. C:/Progra~1/PostgreSQL). 
>>Whitespace 
>>doesn't play well with most makefiles.
>>    
>>
>
>You can't because we build it under Msys which uses the Unix style
>paths. GCC has a tendancy to barf horribly on Windows style paths as
>well, as we found when trying to use pg_config with Slony.
>
>I know little about pgxs, so if you can detail what settings need to
>hacked during installation in the bug you opened I'd appreciate it. It
>should be relatively trivial to rewrite in a custom action.
>
>Regards, Dave
>  
>
It's two things basically. One I think that the installer team can fix, 
the other is IMHO an error in the Makefile.global.in and should be fixed 
there.

The first thing is the lib/pgxs/src/Makefile.global that is installed. 
It contains two paths that needs to change. The abs_top_srcdir and the 
prefix. In my patched file I use these settings:

abs_top_srcdir = /c/Progra~1/PostgreSQL/8.1-beta2/src/postgresql-8.1beta2
prefix := /c/Progra~1/PostgreSQL/8.1-beta2

That seems to work fine. The second problem is that when I made that 
change, I also had to change code that appends 'postgresql' to all paths 
unless the path contains the word 'pgsql' or 'postgres'. A comment 
statest that this is to avoid 'directory clutter'. A better check would 
perhaps be to hardcode rules that explicitly avoids some well known 
directories (/usr/include etc.). That would give the user a better 
freedom to choose prefix without having this side-effect.

My temporary patch for this was to remove all lines staring with 'ifeq' 
or 'endif' between line 66 and 102.

A very different solution to the whole problem would be to let the 
installer make extra checks when the development package is selected. It 
could for instance ask the user what directory  he plan to use as the 
'/usr/local' (suggest 'C:\msys\local' perhaps?) and then use 'pgsql' in 
that directory as the location for the installation.

Regards,
Thomas Hallgren







Re: pgxs and pginstaller

From
"Dave Page"
Date:

> -----Original Message-----
> From: Thomas Hallgren [mailto:thhal@mailblocks.com]
> Sent: 23 September 2005 11:17
> To: Dave Page
> Cc: pgsql-hackers@postgresql.org
> Subject: Re: pgxs and pginstaller
>
> It's two things basically. One I think that the installer
> team can fix,
> the other is IMHO an error in the Makefile.global.in and
> should be fixed
> there.
>
> The first thing is the lib/pgxs/src/Makefile.global that is
> installed.
> It contains two paths that needs to change. The
> abs_top_srcdir and the
> prefix. In my patched file I use these settings:
>
> abs_top_srcdir =
> /c/Progra~1/PostgreSQL/8.1-beta2/src/postgresql-8.1beta2
> prefix := /c/Progra~1/PostgreSQL/8.1-beta2

Hmm, those are still msys paths which the installer doesn't know about.
Will it work with:

abs_top_srcdir = "C:\\Program
Files\\PostgreSQL\\8.1-beta2\\src\\postgresql-8.1beta2"
prefix := "C:\\Program Files\\PostgreSQL\\8.1-beta2"

Those should be Windows and Msys friendly.

> That seems to work fine. The second problem is that when I made that
> change, I also had to change code that appends 'postgresql'
> to all paths
> unless the path contains the word 'pgsql' or 'postgres'. A comment
> statest that this is to avoid 'directory clutter'. A better
> check would
> perhaps be to hardcode rules that explicitly avoids some well known
> directories (/usr/include etc.). That would give the user a better
> freedom to choose prefix without having this side-effect.
>
> My temporary patch for this was to remove all lines staring
> with 'ifeq'
> or 'endif' between line 66 and 102.

I agree with your earlier comment - this should definitely be fixed in
PostgreSQL, not pgInstaller.

Regards, Dave.


Re: pgxs and pginstaller

From
Tom Lane
Date:
"Dave Page" <dpage@vale-housing.co.uk> writes:
>> My temporary patch for this was to remove all lines staring 
>> with 'ifeq' 
>> or 'endif' between line 66 and 102.

> I agree with your earlier comment - this should definitely be fixed in
> PostgreSQL, not pgInstaller.

It's not broken, and I've seen no argument as to why we ought to change it.
        regards, tom lane


Re: pgxs and pginstaller

From
Thomas Hallgren
Date:
Tom Lane wrote:

>"Dave Page" <dpage@vale-housing.co.uk> writes:
>  
>
>>>My temporary patch for this was to remove all lines staring 
>>>with 'ifeq' 
>>>or 'endif' between line 66 and 102.
>>>      
>>>
>
>  
>
>>I agree with your earlier comment - this should definitely be fixed in
>>PostgreSQL, not pgInstaller.
>>    
>>
>
>It's not broken, and I've seen no argument as to why we ought to change it.
>  
>
Well, at least make it case insensitive so that a location containing 
PostgreSQL doesn't cause this behavior.

But quite frankly, wouldn't it be much better if the rule(s) was based 
on known "common locations" rather than to just assume that it is a such 
if it doesn't contain the string postgres? You are limiting the valid 
settings of the 'prefix' option quite a bit at present. Why?

Regards,
Thomas Hallgren




Re: pgxs and pginstaller

From
"Dave Page"
Date:

> -----Original Message-----
> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> Sent: 23 September 2005 15:16
> To: Dave Page
> Cc: Thomas Hallgren; pgsql-hackers@postgresql.org
> Subject: Re: [HACKERS] pgxs and pginstaller
>
> "Dave Page" <dpage@vale-housing.co.uk> writes:
> >> My temporary patch for this was to remove all lines staring
> >> with 'ifeq'
> >> or 'endif' between line 66 and 102.
>
> > I agree with your earlier comment - this should definitely
> be fixed in
> > PostgreSQL, not pgInstaller.
>
> It's not broken, and I've seen no argument as to why we ought
> to change it.

Because it adds '/postgresql' to the path on Windows when it shouldn't,
as Thomas pointed out.

Regards, Dave.