Unix Technical Forum

TODO item: make world safe for spaces in build/install paths

This is a discussion on TODO item: make world safe for spaces in build/install paths within the pgsql Hackers forums, part of the PostgreSQL category; --> Pursuant to Theodore Petrosky's recent trouble report, I thought I would see what happens if you try to build ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-11-2008, 03:10 AM
Tom Lane
 
Posts: n/a
Default TODO item: make world safe for spaces in build/install paths

Pursuant to Theodore Petrosky's recent trouble report, I thought I would
see what happens if you try to build Postgres in a directory whose path
contains spaces, or if the install prefix contains spaces.

It doesn't work, not even close.

It looks to me like there are a couple of hundred places in the
Makefiles that would need to be fixed by adding quotes around various
references to $(libdir) and related variables. I'm afraid that VPATH
builds with spaces in the path to the original source tree are not
realistically fixable at all; certainly prep_buildtree cannot easily be
fixed (it misparses the output of "find") and it looks like we'd need
upstream Autoconf changes as well to get configure to work fully in that
scenario.

I don't think it's appropriate to try to fix this at RC3 stage,
seeing that it's not a regression --- this never worked before either.
But maybe we should add it to the TODO list to consider working on
someday.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-11-2008, 03:11 AM
Andrew Dunstan
 
Posts: n/a
Default Re: TODO item: make world safe for spaces in build/install



Tom Lane wrote:

>Pursuant to Theodore Petrosky's recent trouble report, I thought I would
>see what happens if you try to build Postgres in a directory whose path
>contains spaces, or if the install prefix contains spaces.
>
>It doesn't work, not even close.
>
>It looks to me like there are a couple of hundred places in the
>Makefiles that would need to be fixed by adding quotes around various
>references to $(libdir) and related variables. I'm afraid that VPATH
>builds with spaces in the path to the original source tree are not
>realistically fixable at all; certainly prep_buildtree cannot easily be
>fixed (it misparses the output of "find") and it looks like we'd need
>upstream Autoconf changes as well to get configure to work fully in that
>scenario.
>
>I don't think it's appropriate to try to fix this at RC3 stage,
>seeing that it's not a regression --- this never worked before either.
>But maybe we should add it to the TODO list to consider working on
>someday.
>
>
>
>


I've just reluctantly managed to convince myself that it's worth a TODO.
In 99% of cases it's a matter of "don't do that". If we didn't have
relocatable installs it would matter a lot. Maybe for now it's worth
checking for and causing an error at the configure stage. That would be
nicer than some arbitrary failure later in the process.

cheers

andrew

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-11-2008, 03:11 AM
Robert Treat
 
Posts: n/a
Default Re: TODO item: make world safe for spaces in build/install

On Friday 31 December 2004 20:03, Andrew Dunstan wrote:
> Tom Lane wrote:
> >Pursuant to Theodore Petrosky's recent trouble report, I thought I would
> >see what happens if you try to build Postgres in a directory whose path
> >contains spaces, or if the install prefix contains spaces.
> >
> >It doesn't work, not even close.

<snip>
> >
> >I don't think it's appropriate to try to fix this at RC3 stage,
> >seeing that it's not a regression --- this never worked before either.
> >But maybe we should add it to the TODO list to consider working on
> >someday.

>
> I've just reluctantly managed to convince myself that it's worth a TODO.
> In 99% of cases it's a matter of "don't do that". If we didn't have
> relocatable installs it would matter a lot. Maybe for now it's worth
> checking for and causing an error at the configure stage. That would be
> nicer than some arbitrary failure later in the process.
>


Along similar lines, when I installed RC1 on a windows box it installed it
under the "program files" directory. Now, this was fine for most cases, but
when I had to use some of the command line tools it was really crappy trying
to write explicit directories under dos. I generally chalk that up to windows
being a crappy os to work with from the command line, but I wonder if the
installer ought to be more suggestive to use something like c:\postgresql\ or
at least warn user not to install in directories with spaces.

--
Robert Treat
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-11-2008, 03:11 AM
Andrew Dunstan
 
Posts: n/a
Default Re: TODO item: make world safe for spaces in build/install



Robert Treat wrote:

>
>Along similar lines, when I installed RC1 on a windows box it installed it
>under the "program files" directory. Now, this was fine for most cases, but
>when I had to use some of the command line tools it was really crappy trying
>to write explicit directories under dos. I generally chalk that up to windows
>being a crappy os to work with from the command line, but I wonder if the
>installer ought to be more suggestive to use something like c:\postgresql\ or
>at least warn user not to install in directories with spaces.
>
>


Well, that's not really along similar lines, except that it also
concerns the issue of spaces in directories.

Actually, the standard Windows place to put software is Program Files,
and programs that don't do that are considered somewhat impolite. The
short answer really is "put the directories in your path". Windows users
generally understand this quite well. Maybe the installer should offer
to add the location to the System path or the user's path (assuming it
doesn't already).

cheers

andrew

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-11-2008, 03:11 AM
John Hansen
 
Posts: n/a
Default Re: TODO item: make world safe for spaces in

> Actually, the standard Windows place to put software is Program Files,

Actually,. it's not... it's %ProgramFiles% or
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Pro gramFilesDir since the
name of "C:\Program Files" may vary depending on the language of the OS.

> and programs that don't do that are considered somewhat impolite.


Impolite is a bit of an understatement IMO.

just my $0.02 worth,

john


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-11-2008, 03:11 AM
Bruce Momjian
 
Posts: n/a
Default Re: TODO item: make world safe for spaces in build/install


Added to TODO:

* Allow building with directories containing spaces

---------------------------------------------------------------------------

Andrew Dunstan wrote:
>
>
> Tom Lane wrote:
>
> >Pursuant to Theodore Petrosky's recent trouble report, I thought I would
> >see what happens if you try to build Postgres in a directory whose path
> >contains spaces, or if the install prefix contains spaces.
> >
> >It doesn't work, not even close.
> >
> >It looks to me like there are a couple of hundred places in the
> >Makefiles that would need to be fixed by adding quotes around various
> >references to $(libdir) and related variables. I'm afraid that VPATH
> >builds with spaces in the path to the original source tree are not
> >realistically fixable at all; certainly prep_buildtree cannot easily be
> >fixed (it misparses the output of "find") and it looks like we'd need
> >upstream Autoconf changes as well to get configure to work fully in that
> >scenario.
> >
> >I don't think it's appropriate to try to fix this at RC3 stage,
> >seeing that it's not a regression --- this never worked before either.
> >But maybe we should add it to the TODO list to consider working on
> >someday.
> >
> >
> >
> >

>
> I've just reluctantly managed to convince myself that it's worth a TODO.
> In 99% of cases it's a matter of "don't do that". If we didn't have
> relocatable installs it would matter a lot. Maybe for now it's worth
> checking for and causing an error at the configure stage. That would be
> nicer than some arbitrary failure later in the process.
>
> cheers
>
> andrew
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>


--
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, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-11-2008, 03:11 AM
Peter Eisentraut
 
Posts: n/a
Default Re: TODO item: make world safe for spaces in build/install paths

Tom Lane wrote:
> Pursuant to Theodore Petrosky's recent trouble report, I thought I
> would see what happens if you try to build Postgres in a directory
> whose path contains spaces,


The last I heard in the autotools community on this issue was "forget
it". Not that that means it's impossible, but you're going to fight a
hard battle with make, which has no quoting mechanism at all.

> or if the install prefix contains spaces.


This should be achievable, with a few thousand quotes in the right
places.

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

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-11-2008, 03:12 AM
Bruce Momjian
 
Posts: n/a
Default Re: TODO item: make world safe for spaces in build/install

Peter Eisentraut wrote:
> Tom Lane wrote:
> > Pursuant to Theodore Petrosky's recent trouble report, I thought I
> > would see what happens if you try to build Postgres in a directory
> > whose path contains spaces,

>
> The last I heard in the autotools community on this issue was "forget
> it". Not that that means it's impossible, but you're going to fight a
> hard battle with make, which has no quoting mechanism at all.
>
> > or if the install prefix contains spaces.

>
> This should be achievable, with a few thousand quotes in the right
> places.


Interesting. TODO updated:

* Allow building with directories containing spaces

There are two capabilities here, first the ability to build from a
source directory that contains spaces, and second the ability to install
into a directory that contains spaces. The first is probably not
possible because 'gmake' and other compiler tools do not fully support
spaces in path names. The second is possible with proper quoting in
the makefiles. Because PostgreSQL supports relocatable installs, it
is possible to install into a directory that doesn't contain spaces and
then copy the install to a directory with spaces.

--
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, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:31 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com