[Scons-users] Action commands

Bill Deegan bill at baddogconsulting.com
Tue Jan 17 11:50:46 EST 2017


Tom,

Can you make a small example to demonstrate the issue?
The ones you've posted aren't sufficient for me to understand it.

Thanks,
Bill

On Tue, Jan 17, 2017 at 1:47 AM, Tom Tanner (BLOOMBERG/ LONDON) <
ttanner2 at bloomberg.net> wrote:

>
> It's in the generator. the code is something like this:
>
> def generator(source, target, env, for_signature):
> # # Bad way corrupts env
> # env['THIS'] = 'echo'
> # return Action('$THIS blah')
> # Still bad way - doesn't propogate THIS
> return Action('$THIS blah', THIS='echo')
>
> The generator has to return the action, I think?
>
> From: bill at baddogconsulting.com At: 01/16/17 16:40:47
> To: Tom Tanner (BLOOMBERG/ LONDON), scons-users at scons.org
> Subject: Re: [Scons-users] Action commands
>
> Try Action() without the env.
> Assuming you're using the created object later and not just calling action
> by itself?
>
> -Bill
>
> On Mon, Jan 16, 2017 at 4:26 AM, Tom Tanner (BLOOMBERG/ LONDON) <
> ttanner2 at bloomberg.net> wrote:
>
>> I was quite surprised recently to find that if you (attempt to) pass it
>> environment overrides it ignores them
>>
>> so if you do
>>
>> env.Command('$THIS blah', THIS='echo')
>>
>> it does what is expected.
>>
>> but
>>
>> env.Action('$THIS blah', THIS='echo')
>>
>> I've had occasion to want to do the latter when writing a Builder, or at
>> least it has appeared that's what I've wanted to do, when one of env
>> variables in the Action command is something that actually processes
>> another environment variable. And I can't do this:
>>
>> def generator(source, target, env, for_signature):
>> env['THIS'] = 'echo'
>>
>> because it corrupts env. And I tried cloning env inside the generator and
>> returning a cloned_env.Action. That did not work out well.
>>
>> So what can I do ?
>>
>> _______________________________________________
>> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20170117/c4dc5379/attachment.html>


More information about the Scons-users mailing list