Thread: 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
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
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
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
> 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
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, Pennsylvania19073
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/
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 theability to install into a directory that contains spaces. The first is probably not possible because 'gmake' and othercompiler 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 containspaces 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, Pennsylvania19073