Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2008-03-14
04:20 • Ticket [1913622fff] TCL_LIB_SPEC change breaks stuff status still Closed wit... artifact: e94e4b37aa user: das
04:11 • Ticket [1913622fff]: 4 changes artifact: 415ddb09da user: dgp
03:58 • Closed ticket [1913622fff]. artifact: 97444e93cc user: das
02:09 • Open ticket [1913622fff]. artifact: 45b9886787 user: dgp
00:55 • Ticket [1913622fff]: 4 changes artifact: 4ac7219592 user: andreas_kupries
00:50 • Pending ticket [1913622fff]. artifact: 0d5b24342d user: das
2008-03-13
23:50 • Ticket [1913622fff]: 4 changes artifact: a9cbe0dc18 user: dgp
23:48 • Ticket [1913622fff]: 4 changes artifact: a86343119c user: andreas_kupries
23:37 • Ticket [1913622fff]: 4 changes artifact: 0fb67fcb23 user: das
23:32 • Ticket [1913622fff]: 4 changes artifact: ef8158c17d user: dgp
23:27 • Ticket [1913622fff]: 4 changes artifact: f754aaa9c0 user: dgp
23:23 • Ticket [1913622fff]: 4 changes artifact: 94f14c230f user: das
15:38 • New ticket [1913622fff]. artifact: 25f5d6de5d user: dgp

TCL_LIB_SPEC change breaks stuff

Closed / Fixed1913622fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 19 years ago
Descriptionplain2008-03-13 15:38:58
Until yesterday, the TCL_LIB_SPEC
value in tclConfig.sh looked like
this:

TCL_LIB_SPEC='-L/home/dgp/i686/linux/lib -ltcl8.5'

Now it looks like this:

TCL_LIB_SPEC='-L"/home/dgp/i686/linux/lib" -ltcl8.5'

This breaks a system of build scripts
(written in Tcl) that I have for programs
that embed Tcl.  That build script system
takes the TCL_LIB_SPEC value, puts each
word of it in "..." quotes and lappends
each word to the list of arguments to
be passed to [exec].

Starting today, my attempts to build
produce the

"extra characters after close-quote"

error.

I'll look into whether this can be
resolved with more defensive coding
of the build scripts, but if this change
broke my stuff, it probably broke other
stuff too.  Can we reconsider, or at least
save such a change for the 8.6 alphas?
dasplain2008-03-13 23:23:37
Logged In: YES 
user_id=90580
Originator: NO

the quoting was added to allow for the path to the lib dir and esp the tcl build dir to contain spaces...
the other possibility would have been to backslash-quote those spaces e.g. via sed, it sounds like that would be a more compatible option?
dgpplain2008-03-13 23:27:19
Logged In: YES 
user_id=80530
Originator: YES


Even after working around the
"-L"/path/to/library"" quoting problem,
I end up with the value {-L"/path/to/library"}
as an argument passed to [exec].  [exec]
treats those quoted literally, so my
linker is then looking in a directory that
has the quotes as part of its name.  Final
result is 

/usr/bin/ld: cannot find -ltk8.5
dgpplain2008-03-13 23:32:11
Logged In: YES 
user_id=80530
Originator: YES


x-ed

It sounds like the approach of
backslash quoting spaces in the
path would at least leave those
paths without spaces unmolested,
and I'd be at least no worse off
than I was before.

(I don't know whether all instances
of spaces in path names work in
my build system or not).

I don't mind making improvements
in this area.  In fact I made
a big effort in this direction
once (553544).  But I really don't
want a change in a patchlevel release
to break my entire installed base, and
that's what this change does.  I either
need something gentler, or a delay to
the 8.6 development timeframe.
dasplain2008-03-13 23:37:52
Logged In: YES 
user_id=90580
Originator: NO

understood, ok, will switch all the double-quoted cases that end up in tclConfig.sh to backslash quoting
andreas_kupriesplain2008-03-13 23:48:18
Logged In: YES 
user_id=75003
Originator: NO

Note that AIX is worse off. Because of its linker idiosyncrasies it doesn't use -ltcl8.x, but appends a file directly to the path. The result can be seen below.

tclConfig.sh:TCL_BUILD_LIB_SPEC='-bI:"/home/andreask/dbn/lba/night/builds/aix-rs6000/tcl.inst/unix/aix-rs6000"/lib.exp'
tclConfig.sh:TCL_LIB_SPEC      ='-bI:"/home/andreask/dbn/lba/night/builds/aix-rs6000/out/aix-rs6000/lib"/libtcl8.5.exp'

Do you see how the quotes break the final path?
Bash might understand that, most other shell I don't believe so.
dgpplain2008-03-13 23:50:42
Logged In: YES 
user_id=80530
Originator: YES


I'm happy to hear it's not
just my old broken crap that
has trouble with this. :)
dasplain2008-03-14 00:50:54
Logged In: YES 
user_id=90580
Originator: NO

committed switch to backslash quoting for LIB_SPEC values.

none of the other quoting changes make it into *Config.sh so should not cause this type of problem.

sorry about the mess, hopefully this fixes it...
andreas_kupriesplain2008-03-14 00:55:44
Logged In: YES 
user_id=75003
Originator: NO

I will run another 8.5 build this to see what things will look like on AIX with the latest change.
If the '"'s were simply changed to '\"', well I do not see '\"A\"/x.exp' working or as valid path.
dgpplain2008-03-14 02:09:12
Logged In: YES 
user_id=80530
Originator: YES


That change takes care of my
problems.  Thanks!
dasplain2008-03-14 03:58:24
Logged In: YES 
user_id=90580
Originator: NO

Andreas,

no the change removes the surrounding '"'s and instead replaces any ' ' in the path by '\ '.
this is a bit less strong (only makes spaces safe), but is good enough for my needs...

according to 'man bash' the full list of metachars that would need to be quoted to be completely safe is:
" ' ! $ ` \ |  & ; ( ) < > space tab
dgpplain2008-03-14 04:11:25
Logged In: YES 
user_id=80530
Originator: YES


This is less important to me, but....

$ cd tcl8.5.2/unix
$./configure --prefix="/home/dgp/path space"
...
checking if the C stack grows upwards in memory... no
./configure: line 18609: space/lib: No such file or directory
configure: creating ./config.status
...
$ grep TCL_LIB_SPEC tclConfig.sh
TCL_LIB_SPEC='-L/home/dgp/path space/lib -ltcl8.5'

So is the revised scheme working?
dasplain2008-03-14 04:20:13
Logged In: YES 
user_id=90580
Originator: NO

as mentioned in the ChangeLog, my changes only enable INSTALL_ROOT and path to builddir to contain spaces, I did not quote any of the standard bindir, libdir, includedir etc (which are based on prefix).
if you try again with a builddir with spaces in the path you should see the new scheme working, but note that the path to srcdir cannot contain any spaces due to a bug in autoconf...
I was originally more ambitious about quoting everything but when I discovered that autoconf bug I gave up and concentrated on what I needed in the short term...
Log in (anonymous is fine) to add a comment.