Skip to content
Tcl Source Code View Ticket
Login

View Ticket

spaces in paths break stuff

Open553544ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 43 days ago
Descriptionplain2002-05-08 01:54:39
If the build directory or the --prefix install 
directory contains a space, the Unix build/install
goes haywire.

Here's a patch that enables building/installation.
I'm not 100% sure that it leaves the contents
of tclConfig.sh making proper sense, though.
dgpplain2002-05-08 08:54:39
File Added - 22686: space.patch
dgpplain2002-05-08 12:35:18
Logged In: YES 
user_id=80530

The patch appears to be faulty in how it embeds
TCL_LIBRARY and TCL_PACKAGE_PATH into tclUnixInit.c.
dgpplain2002-05-08 13:36:35
Logged In: YES 
user_id=80530

Nope, that problem was just a bug in unixInit.test.

This patch works for me; still the unknown issues of
a proper tclConfig.sh and whether I've broken anything
on other platforms left for maintainer review.
dgpplain2002-05-09 04:30:29
Logged In: YES 
user_id=80530

Trying to build Tk confirms that the tclConfig.sh file
produced by this patch is unusable.  More revisions needed.
dgpplain2002-05-10 09:18:59
File Deleted - 22686: 



File Added - 22802: space.patch

Logged In: YES 
user_id=80530

Here's a revised patch that solves the problems
and leaves the tclConfig.sh contents in a state
that a suitable patched Tk can deal with.  See
a companion patch in the Tk project.
dgpplain2002-06-01 07:07:39
Logged In: YES 
user_id=80530

Any objection to a commit?
mdejongplain2002-06-01 07:12:31
Logged In: YES 
user_id=90858

Umm, let me take a look at it. I have been a bit
busy but I will get to it.
mdejongplain2002-06-05 09:31:05
Logged In: YES 
user_id=90858

First off, why did you remove the following code
from tcl.m4?

-    #
-    # eval is required to do the TCL_DBGX substitution
-    #
-
-    eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
-    eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
-    eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
-
-    eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
-    eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
-    eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""


I have to admit, this patch gives me a bit of an
uneasy feeling. Is there some reason this patch
is needed right now? Can it wait until 8.5 when
I plan on rewriting everything to use only one
set of build macros? The Unix build system has
*never* supported paths with spaces in them.
Why start now?
dgpplain2002-06-05 10:34:31
Logged In: YES 
user_id=80530

I'll take the meta-question first.

No, this is not an urgent matter.  If we wait on this, Tcl's
configure
and build system will not be any more broken than it always
has been.
(I was *shocked* to see that GNU's install-sh is broken, too!)
These changes took quite a bit of effort, and if they were 
non-controversial, I hoped to let more people benefit from
that effort.

When you get back to this during 8.5 work, I eliminated the
"eval"s
in tcl.m4 because I could not come up with any way to quote the
space-containing paths in TCL_LIB_FILE, TCL_LIB_SPEC, etc.
in a way that would survive an eval.

Instead, by removing the evals, the values substituted into
extension
Makefiles still contain the literal characters $TCL_DBGX. 
But that's
not a problem, because the tclConfig.sh file also offers
that for 
substitution, so just add a TCL_DBGX definition in the extension
Makefile and things are fine.  (See Bug 554348)
mdejongplain2002-06-06 08:10:08
Logged In: YES 
user_id=90858

The "just add TCL_DBGX to the extension's Makefile"
approach you suggest is how it used to be implemented.
The problems with this approach is what led me to
put those evals in the tcl.m4 in the first place.
What happens is the extension seems to work just fine
without the TCL_DBGX in the Makefile as long as you
don't build a static or debug version. When someone
comes along and build something other and a default
build, the linker fails because it tries to link to
a tcl library that is not there. We are not going to
go back to that impl.

I feel your pain when it comes to the quoting hell
of TCL_DBGX. The solution is to remove TCL_DBGX in
8.5 and come up with a new approach that will simplify
both Tcl and extension builds and allow installs
of multiple build types on one system. We don't need
to have multiple builds (static, threaded, etc) in
the same build dir. We just need to support multiple
builds in the same install prefix in 8.5.

As far as the immediate benefit people will see
from this patch, it just does not seem too important.
I would rather you hold onto this patch until 8.5.
dgpplain2004-03-27 05:23:34
Logged In: YES 
user_id=80530

8.5 development is happening.

time to look at this again...
dgpplain2004-12-10 02:44:49
Logged In: YES 
user_id=80530

After patch 1081595, this may
become feasible.
dgpplain2015-05-11 14:57:56
Bleah.  This is still true.  Name to root directory of a Tcl source
code distributions to "space in path" and all the unix/* build
scripts fail.  Thanks GNU!
serhiy.storchakawiki2026-10-20 19:54:59

Rechecked on main (unix): an out-of-tree build directory with a space and a --prefix with a space now work (build, install, tests). Only a space in the source directory still fails: configure succeeds, but make stops at once with "No rule to make target '.../macosx/configure.ac'", since unix/Makefile.in uses the source paths as make targets and prerequisites in some 220 rules. Building through a symlink to the source directory without a space works.

Note that with a space in the prefix, the -L/-I values in tclConfig.sh are not quoted, so extensions using them directly will still have trouble.

Log in (anonymous is fine) to add a comment.

Attachments: