[libGD] #229 [Task opened] GD build should fail with clear error message if source or install path includes spaces
[email protected] Thu, 30 Sep 2010 03:46:48 +0200 (CEST)
| Newsgroups | php.gd.bugs |
|---|---|
| Message-ID | <[email protected]> |
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
A new Flyspray task has been opened. Details are below.
User who did this - Jim DeLaHunt (JimDeLaHunt)
Attached to Project - libGD
Summary - GD build should fail with clear error message if source or install path includes spaces
Task Type - Bug Report
Category - Configure/Build
Status - Unconfirmed
Assigned To -
Operating System - All
Severity - Medium
Priority - Normal
Reported Version - 2.0.35
Due in Version - Undecided
Due Date - Undecided
Details - I've just spent quite a while trying to get GD 2.0.35 to build on a Mac OS X system, using a working directory path which happens to include space characters (blanks). I used a custom install location which is in the same parent directory as the working directory. The parent directory path is something like:
/Users/jdlh/Documents/Pr/2010/JDLH\ Consulting/A\ Client/site\ editing/gd
I believe that the underlying issue is that gd relies on GNU configure and GNU libtool to build, and those tools don't work in all cases with paths containing spaces. See [[http://lists.gnu.org/archive/html/libtool/2006-01/msg00022.html]] for a discussion. The advice from libtool developers in this list was for users to pick working directory paths that don't have spaces. It is apparently difficult to change libtool to tolerate spaces in paths.
I suggest two workarounds:
1. In the documentation on building GD, mention that the paths should not contain spaces. For instance, README.TXT should add a phrase about paths (see suggested patch below), the "FAQ C Compile" wiki page on building [[http://www.libgd.org/FAQ_C_Compile]] should mention this, the "DOC Compiling GD on Mac OS X HOWTO" [[http://www.libgd.org/DOC_Compiling_GD_on_Mac_OS_X_HOWTO]] should especially mention it. I'd add text to the wiki, but it appears to require me to be logged in, and I can't see a way to create a user ID on that wiki (anti-spam measures?).
2. In the build scripts, add a test for spaces in path names, and fail clearly with a specific error message. I don't have a patch to propose for this. It would have saved me a lot of work to have a clear error message when I tried to build.
**How to reproduce bug:**
- Create a working directory with spaces in its path name, e.g. /Users/jdlh/spaces\ in\ name/gd
- Create subdirectories ./src and ./local
- Download GD 2.0.35 source into /Users/jdlh/spaces\ in\ name/gd/src/ .
- Run ./configure --prefix=/Users/jdlh/spaces\ in\ name/gd/local .
- If you clear #4, set up an install target with spaces in its path,
<code>setenv CMAKE_INCLUDE_PATH /Users/jdlh/spaces\ in\ name/gd/local/include
% setenv CMAKE_LIBRARY_PATH /Users/jdlh/spaces\ in\ name/gd/local/lib
% cmake -DUSE_EXT_GD=1 -DBUILD_TEST=1
</code>
**Observed behaviour:**
Error messages like this:
<code>....
WARNING: `missing' script is too old or missing
.....
/bin/sh ./libtool --mode=install /usr/bin/install -c 'libgd.la'
'/Users/jdlh/spaces in name/gd/local/lib/libgd.la'
/usr/bin/install -c .libs/libgd.2.0.0.dylib "/Users/jdlh/spaces
in name/gd/local/lib/libgd.2.0.0.dylib"
(cd "/Users/jdlh/spaces in name/gd/local/lib" && { ln -s -f libgd.2.0.0.dylib
libgd.2.dylib ||
{ rm -f libgd.2.dylib && ln -s libgd.2.0.0.dylib libgd.2.dylib; }; })
(cd "/Users/jdlh/spaces in name/gd/local/lib" && { ln -s -f libgd.2.0.0.dylib
libgd.dylib ||
{ rm -f libgd.dylib && ln -s libgd.2.0.0.dylib libgd.dylib; }; })
/usr/bin/install -c .libs/libgd.lai "/Users/jdlh/spaces in name/gd/local/lib/libgd.la"
/usr/bin/install -c .libs/libgd.a /Users/jdlh/spaces in name/gd/local/lib/libgd.a
usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
[-o owner] file1 file2
install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
[-o owner] file1 ... fileN directory
install -d [-v] [-g group] [-m mode] [-o owner] directory ...
make[2]: *** [install-libLTLIBRARIES] Error 64
make[1]: *** [install-am] Error 2
make: *** [install-recursive] Error 1
.....
chmod 644 /Users/jdlh/spaces in name/gd/local/lib/libgd.a
chmod: /Users/jdlh/spaces: No such file or directory
chmod: in: No such file or directory
chmod: name/gd/local/lib/libgd.a: No such file or directory
make[2]: *** [install-libLTLIBRARIES] Error 1
make[1]: *** [install-am] Error 2
make: *** [install-recursive] Error 1
</code>
**Desired behaviour:**
Error message of form:
<code>ERROR: source code path must not contain spaces.
Path is '/Users/jdlh/spaces in name/gd/src'. </code>
or,
<code>ERROR: install target path must not contain spaces.
Path is '/Users/jdlh/spaces in name/gd/local/'. </code>
**Suggest documentation patches**
README.TXT: change
<code>Quick install guide:
If the sources have been fetched from CVS, run bootstrap.sh [options].
</code>
To read:
<code>Quick install guide:
Extract the sources into a directory. Choose a directory which has no
spaces anywhere in its path, like "/projects/gd". If the sources have been
fetched from CVS, run bootstrap.sh [options].
</code>
In the "FAQ C Compile" wiki page on building [[http://www.libgd.org/FAQ_C_Compile]], change "After you have download all libs you should extract them to a common directory level, f.e. lets say we use c:\projects on Win32, or ~/projects on Linux. After you have extracted all, it should look like below" to:
"After you have download all libs you should extract them to a common directory level, e.g. lets say we use c:\projects on Win32, or ~/projects on Linux. It is important that there be no spaces characters (blanks) anywhere in the path to this directory: GD's build tools can't work with spaces in pathnames.
After you have extracted all, it should look like below".
In the "DOC Compiling GD on Mac OS X HOWTO" [[http://www.libgd.org/DOC_Compiling_GD_on_Mac_OS_X_HOWTO]], at the end of the section "Setting up the environment", add the following text:
"Choose a working directory for your GD development, e.g. ~/myuser/projects/gd/ . It is important that there be no spaces characters (blanks) anywhere in the path to this directory: GD's build tools can't work with spaces in pathnames."
**Workaround**
The obvious workaround is for the user to choose paths which have no spaces. This will be inconvenient on some platforms and for some users, but my guess is that developers who are working with *nix-origin sources are used to it.
A workaround that was successful for me was to make a symbolic link from a directory with a space-free path to my working directory. Then cd to the working directory via this path.
<code>
% mkdir /Users/jdlh/no_spaces/
% cd /Users/jdlh/no_spaces/
% ln -s /Users/jdlh/spaces in name/gd/ gd
% cd /Users/jdlh/no_spaces/gd
% ./configure --prefix=/Users/jdlh/no_spaces/gd/local
</code>
(etc.)
More information can be found at the following URL:
http://bugs.libgd.org/?do=details&task_id=229
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.