[Scons-users] Prevent users from shooting them in the foot when adding FLAGS

Dan Čermák dan.cermak at cgc-instruments.com
Wed Nov 15 07:15:23 EST 2017


Hi folks,

I have today successfully shoot myself in the foot with SCons by
effectively doing the following:

env.Append(CPPPATH=['/path/to/foo/bar\n'])

The issue with this is that any build command gets terminated by the \n
prematurely, e.g. a gcc -I/path/to/foo/bar\n -c foo.c gets executed as:
gcc -I/path/to/foo/bar
which obviously fails, as gcc lacks any source files.

This is of course a user error (in my case it was because I extracted
the CPPPATH from the invocation of an external program), however would
anything speak against printing a warning if a \n or \r\n appears in any
of the variables passed to the Environment?


Cheers,

Dan


More information about the Scons-users mailing list