OK, one was resolvable but I don't think the other is - the tcl autotools build doesn't seem to like our crazy pathnames test.
Even when I try to boil it down outside of CMake with those paths, it wants an absolute path for --prefix but doesn't like the path we need to give it:
../TCL_BLD/unix/configure --prefix=/home/cyapp/extbuild/build/distcheck-odd_pathnames/1\ Odd_\ build\ dir\ ++/extinstall/tcl
../TCL_BLD/unix/configure: line 18844: test: too many arguments
../TCL_BLD/unix/configure: line 18857: Odd_: command not found
configure: creating ./config.status
./config.status: line 305: Odd_: command not found
config.status: creating Makefile
config.status: error: cannot find input file: ../unix/Makefile.in
../TCL_BLD/unix/configure: eval: line 37: unexpected EOF while looking for matching `"'
../TCL_BLD/unix/configure: eval: line 38: syntax error: unexpected end of file
That's fairly annoying, actually... it means that test can't be reliably run, since there is no guarantee a user's home directory will be in a path that's free of spaces.
/me wonders if the Tcl irc channel has any useful insights...
@Sean I may need to disable the odd pathnames distcheck, if the tcl build can't handle it
@starseeker you may not recall, but we when through phases struggling with support for spaces with our autotools build
it's doable, but just like anything, it has to be intentionally accommodated and it's easy to break when there's not a test for it. I know some communities that just dismiss paths with spaces as "don't care"
I'd say file a bug report on it. that's the kind of thing they'd likely fix right away or dismiss.
looking at their code, it actually looks like they try hard to quote everything correctly. just found one issue that was probably a recent change.
just committed a fix, and a manual build with the odd-pathnames path as the prefix seems to have worked
@Sean Ah, nice catch! I had forgotten (my memories of autotools are dominated by the libpng difficulties that were the straw that broke the camel's back as far as switching to CMake).
@Sean Looks like that's just the first of a number of issues. Trying to turn back on the odd pathnames distcheck, the Tcl configure blows up quickly in several ways. Testing manually (CPPFLAGS and LDFLAGS var setting quotes is a separate issue from the Tcl build but is also a problem) I can go through and quote some stuff in the configure script to get by a few more errors but then I get to the gcc test failing:
gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)
configure:1780: $? = 0
configure:1782: gcc -V </dev/null >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:1785: $? = 1
configure:1808: checking for C compiler default output file name
configure:1811: gcc -I/home/user/extbuild/build/distcheck-odd_pathnames/1 Odd_ build dir ++/include -L/home/user/extbuild/build/distcheck-odd_pathnames/1 Odd_ build dir ++/lib conftest.c >&5
gcc: error: Odd_: No such file or directory
gcc: error: build: No such file or directory
gcc: error: dir: No such file or directory
gcc: error: ++/include: No such file or directory
gcc: error: Odd_: No such file or directory
gcc: error: build: No such file or directory
gcc: error: dir: No such file or directory
gcc: error: ++/lib: No such file or directory
configure:1814: $? = 1
configure: failed
That one is clearly the CPPFLAGS="-I/home/user/extbuild/build/distcheck-odd_pathnames/1 Odd_ build dir ++/include" value not propagating correctly, but even if I don't set that (which won't work long term) I still get a series of other errors.
I get the feeling they've not tested this sort of scenario in a while...
Do we try to go through and fix all of it?
@Sean The quick alternative would be for me to put back my CMake Tcl build until we can sort it out with upstream (if they're included to fix it)
Per IRC recommendation, issue filed with Tcl at https://core.tcl-lang.org/tcl/tktview/888c1a8c9d84c1f5da4a46352bbf531424fe7126
Grrrr. Tk CMake logic isn't working properly on Windows in stand-alone mode, needed for ExternalProject_Add use. No easy answers...
@Sean I don't have confidence in my own ability to identify and fix the quoting issues in autoconf. I can try if necessary, but is there any chance you could take a look at it? This is the stand-alone test that should (hopefully) trip most of the same wires as the odd-pathnames build:
#!/bin/bash
mkdir "1 Odd_ source dir++"
mkdir "1 Odd_ build dir++"
mkdir "1 Odd_ install dir++"
cd "1 Odd_ source dir++"
tar -xvf ~/Downloads/tcl8.6.10-src.tar.gz
cd "$HOME/1 Odd_ build dir++"
export CPPFLAGS="-I$HOME/1 Odd_ install dir++/include"
export LDFLAGS="-L$HOME/1 Odd_ install dir++/lib"
"$HOME/1 Odd_ source dir++/tcl8.6.10/unix/configure" --prefix="$HOME/1 Odd_ install dir++"
starseeker said:
Do we try to go through and fix all of it?
erm, I dunno -- I got a successful build on Mac after the change I made
I can give that script a try, but just at a glance, those flags look wrong to me already
those spaces need to be escaped or the whole thing quoted, like export CPPFLAGS="-I\"$HOME/1 Odd_ install dir++/include\""
or better, export CPPFLAGS="\"-I$HOME/1 Odd_ install dir++/include\""
/me's eyes cross
not as good, but should also work so long as HOME doesn't have spaces: export CPPFLAGS="-I$HOME/1\ Odd_\ install\ dir++/include"
Maybe the better thing to do is define a couple scripts to trigger the configure and build stages, have CMake configure_file them, and then just run them - between shell itself and CMake this is a quoting nightmare
(which also means it will be a maintainability nightmare...)
er, so try it without first then.... :)
Does the Mac build work for you with that script if you take out the flag setting?
you mean without the flags? IIRC I had to add them (or some version of them) for Tcl to pick up our local copy of zlib
the quoting rules are pretty straight forward. if a var is within double-quotes, it's going to be expanded. the cppflags and ldflags you have there are invalid pretty much everywhere not because of shell/cmake behavior but because Odd_ is not a flag and "install" is not a flag... etc.
yes, I just ran configure with the odd prefix and it worked fine after the one fix
Alright, let me try that...
if you have to set LDFLAGS, then you should expect to need more than -L for runtime lookup to work. but should definitely try without it first and see.
/home/user/1 Odd_ source dir++/tcl8.6.10/unix/configure: line 721: test: too many arguments
/home/user/1 Odd_ source dir++/tcl8.6.10/unix/configure: line 727: test: too many arguments
configure: error: sources are in /home/user/1 Odd_ source dir++/tcl8.6.10/unix, but `cd /home/user/1 Odd_ source dir++/tcl8.6.10/unix' does not work
/me looks
that's because srcdir has spaces, I only fixed destination having spaces
Right - that's why the script is set up the way it is - to try and introduce spaces everywhere we might hit them (do hit them, in distcheck-odd_pathnames)
I'll have to check if that's fixable -- autotools lets you target any path, but I'm not sure about configuring from any path
can certainly fix the configure script manually easily enough -- it's only used in a few places
it's just that may be generated code, a possible limitation of autotools. lemme check.
Yeah, even if I quote those config.status isn't happy
If true (i.e. it's an innate autotools limitation) that pretty much restricts us to requiring a system Tcl/Tk install for distcheck-odd_pathnames...
it is an autotools limitation, documented even. they say outright that paths with special chars are not supported for source, build, or destination dirs. reading people's experience, looks like source and destination dirs can have spaces, but the build dir is a bit more ingrained.
so I think we either just add detection to our cmakelists to warn and/or make sure we build from a path without spaces when building ext
I think I've got something workable in r77736.
sounds good
on a barely related topic, I was happy to see cmake has support for non-failure test codes, i.e., a way to run a test that figures out some testing condition isn't satisfied, so it can report a different code that makes the test actually report as skipped instead of blankly claiming it failed or falsely making it appear to have passed. no action, just thought it was a nice discovery. I put it to use on the bigdb test which can't run on low-memory systems.
Last updated: Jan 09 2025 at 00:46 UTC