[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 10:31:43 EST 2017


Hi Bill,

if you could point me to the code which handles environment variables
I'll try to create a pull request.


Cheers,

Dan

Bill Deegan <bill at baddogconsulting.com> writes:

> Dan,
>
> That must've been fun to find.. ;)
> Pull requests welcome.
> Though I'm reworking the storage/evaluation of environment variables
> currently which I plan to get into the 3.1 or 4.0 release (Next feature
> release, naming depends on whether I need to break compatibility with
> 3.0.1..)
>
> -Bill
>
> On Wed, Nov 15, 2017 at 7:15 AM, Dan Čermák <dan.cermak at cgc-instruments.com>
> wrote:
>
>> 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
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users


More information about the Scons-users mailing list