[Scons-users] Problems with ParseFlags()
Fred Wright
fw at fwright.net
Sat Mar 26 18:23:44 EDT 2016
I recently had to track down the reason that attempts to build GPSD on
FreeBSD with ncurses enabled were crashing scons. The trigger was the
pkg_config data that FreeBSD has for ncurses:
$ pkg-config --libs ncurses
-L/usr/local/lib -rpath /usr/local/lib -lncurses -ltinfo
I believe the -rpath is completely redundant in this context, but
nevertheless that's how the FreeBSD pkg-config has it set up for ncurses
(and 11 other packages among the ones I have installed). Feeding this to
ParseFlags() leads to a chain of problems:
1) ParseFlags() doesn't recognize -rpath as an explicitly-handled option.
Although it doesn't need to handle every possible option, the fact that it
has RPATH support but doesn't know about -rpath seems like a bug.
2) After passing over the -rpath, it then encounters the /usr/local/lib,
which (presumably as the default assumption for unknown non-option items)
it assumes is a file. But there's already a directory node for it
(probably as a result of the -L), so the attempt to create a file node
results in a TypeError exception from the klass mismatch.
3) Nothing catches this exception until it gets all the way back to the
scons top level, which error-exits to the shell.
In addition:
4) Even when running with --debug=pdb, the uncaught exception exits to the
shell, rather than going to pdb in a state where pdb.pm() can be used to
examine the exception context.
Also, it's annoying to have to specify the full path to SConstruct in
order to set breakpoints in it. This is mainly pdb's fault; I don't know
if there's an easy way for scons to add the SConstruct directory to pdb's
list of search paths.
Fred Wright
More information about the Scons-users
mailing list