[Scons-users] Action commands
Tom Tanner (BLOOMBERG/ LONDON)
ttanner2 at bloomberg.net
Tue Jan 17 04:47:57 EST 2017
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20170117/e0a6da9f/attachment.html>
More information about the Scons-users
mailing list