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

Started by Tom Laneabout 21 years ago9 messages
#1Tom Lane
tgl@sss.pgh.pa.us

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

#2Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#1)
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

#3Robert Treat
xzilla@users.sourceforge.net
In reply to: Andrew Dunstan (#2)
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

#4Andrew Dunstan
andrew@dunslane.net
In reply to: Robert Treat (#3)
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

#5Magnus Hagander
mha@sollentuna.net
In reply to: Andrew Dunstan (#4)
Re: TODO item: make world safe for spaces in build/install

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).

It doesn't, but it's already on our TODO.

Oh, and you can always manually change to install in c:\postgresql or
whatever. It's just the default that is the platform mandated standard
:-)

//Magnus

#6John Hansen
john@geeknet.com.au
In reply to: Andrew Dunstan (#4)
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\ProgramFilesDir 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

#7Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Andrew Dunstan (#2)
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
#8Peter Eisentraut
peter_e@gmx.net
In reply to: Tom Lane (#1)
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/

#9Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Peter Eisentraut (#8)
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