Stream: brlcad

Topic: tcl ExternalProject_Add and odd pathnames


view this post on Zulip starseeker (Nov 10 2020 at 19:43):

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.

view this post on Zulip starseeker (Nov 10 2020 at 19:48):

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

view this post on Zulip starseeker (Nov 10 2020 at 20:48):

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.

view this post on Zulip starseeker (Nov 10 2020 at 20:48):

/me wonders if the Tcl irc channel has any useful insights...

view this post on Zulip starseeker (Nov 11 2020 at 01:29):

@Sean I may need to disable the odd pathnames distcheck, if the tcl build can't handle it

view this post on Zulip Sean (Nov 11 2020 at 04:29):

@starseeker you may not recall, but we when through phases struggling with support for spaces with our autotools build

view this post on Zulip Sean (Nov 11 2020 at 04:30):

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"

view this post on Zulip Sean (Nov 11 2020 at 04:32):

I'd say file a bug report on it. that's the kind of thing they'd likely fix right away or dismiss.

view this post on Zulip Sean (Nov 11 2020 at 04:58):

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.

view this post on Zulip Sean (Nov 11 2020 at 05:00):

just committed a fix, and a manual build with the odd-pathnames path as the prefix seems to have worked

view this post on Zulip starseeker (Nov 11 2020 at 13:16):

@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).

view this post on Zulip starseeker (Nov 11 2020 at 13:34):

@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

view this post on Zulip starseeker (Nov 11 2020 at 13:38):

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.

view this post on Zulip starseeker (Nov 11 2020 at 13:41):

I get the feeling they've not tested this sort of scenario in a while...

view this post on Zulip starseeker (Nov 11 2020 at 13:42):

Do we try to go through and fix all of it?

view this post on Zulip starseeker (Nov 12 2020 at 14:19):

@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)

view this post on Zulip starseeker (Nov 12 2020 at 14:44):

Per IRC recommendation, issue filed with Tcl at https://core.tcl-lang.org/tcl/tktview/888c1a8c9d84c1f5da4a46352bbf531424fe7126

view this post on Zulip starseeker (Nov 12 2020 at 21:56):

Grrrr. Tk CMake logic isn't working properly on Windows in stand-alone mode, needed for ExternalProject_Add use. No easy answers...

view this post on Zulip starseeker (Nov 12 2020 at 21:58):

@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++"

view this post on Zulip Sean (Nov 12 2020 at 22:01):

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

view this post on Zulip Sean (Nov 12 2020 at 22:02):

I can give that script a try, but just at a glance, those flags look wrong to me already

view this post on Zulip Sean (Nov 12 2020 at 22:05):

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\""

view this post on Zulip starseeker (Nov 12 2020 at 22:05):

/me's eyes cross

view this post on Zulip Sean (Nov 12 2020 at 22:06):

not as good, but should also work so long as HOME doesn't have spaces: export CPPFLAGS="-I$HOME/1\ Odd_\ install\ dir++/include"

view this post on Zulip starseeker (Nov 12 2020 at 22:06):

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

view this post on Zulip starseeker (Nov 12 2020 at 22:07):

(which also means it will be a maintainability nightmare...)

view this post on Zulip Sean (Nov 12 2020 at 22:08):

er, so try it without first then.... :)

view this post on Zulip starseeker (Nov 12 2020 at 22:08):

Does the Mac build work for you with that script if you take out the flag setting?

view this post on Zulip starseeker (Nov 12 2020 at 22:09):

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

view this post on Zulip Sean (Nov 12 2020 at 22:10):

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.

view this post on Zulip Sean (Nov 12 2020 at 22:11):

yes, I just ran configure with the odd prefix and it worked fine after the one fix

view this post on Zulip starseeker (Nov 12 2020 at 22:12):

Alright, let me try that...

view this post on Zulip Sean (Nov 12 2020 at 22:13):

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.

view this post on Zulip starseeker (Nov 12 2020 at 22:16):

/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

view this post on Zulip Sean (Nov 12 2020 at 22:17):

/me looks

view this post on Zulip Sean (Nov 12 2020 at 22:19):

that's because srcdir has spaces, I only fixed destination having spaces

view this post on Zulip starseeker (Nov 12 2020 at 22:19):

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)

view this post on Zulip Sean (Nov 12 2020 at 22:20):

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

view this post on Zulip Sean (Nov 12 2020 at 22:21):

can certainly fix the configure script manually easily enough -- it's only used in a few places

view this post on Zulip Sean (Nov 12 2020 at 22:21):

it's just that may be generated code, a possible limitation of autotools. lemme check.

view this post on Zulip starseeker (Nov 12 2020 at 22:22):

Yeah, even if I quote those config.status isn't happy

view this post on Zulip starseeker (Nov 12 2020 at 22:25):

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...

view this post on Zulip Sean (Nov 12 2020 at 23:11):

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.

view this post on Zulip Sean (Nov 12 2020 at 23:12):

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

view this post on Zulip starseeker (Nov 13 2020 at 04:00):

I think I've got something workable in r77736.

view this post on Zulip Sean (Nov 13 2020 at 12:52):

sounds good

view this post on Zulip Sean (Nov 13 2020 at 12:56):

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: Oct 09 2024 at 00:44 UTC