[Scons-users] How to prepend all commands to enable switching execution environments..

robert zeigler robert.zeigler at gmail.com
Thu Oct 31 15:46:00 EDT 2013


Thanks for the hints; they are pointing me in a much better direction than
I was heading. I'm considering overriding $SPAWN with a custom function
definition. It will provide me with the power I need in this case.

Aside from multi-platform support and returning the right return code, are
there concerns/pitfalls I should be aware of in overriding $SPAWN?

Thanks,

Robert


On Thu, Oct 31, 2013 at 12:59 PM, William Deegan
<bill at baddogconsulting.com>wrote:


> Robert,

>

> On Oct 31, 2013, at 9:51 AM, robert zeigler <robert.zeigler at gmail.com>

> wrote:

>

> I have a situation where a build command can be wrapped in several

> different ways, depending on the build environment. The wrapping doesn't

> change the actual command executed, it only changes the scheduling of the

> execution (think: slurm, open grid engine, etc.).

>

> As a very simple example:

>

> Command["target1", "source1", "somecommand < $SOURCE > $TARGET")

>

> Could be executed directly:

>

> somecommand < source1 > target1

>

> or it could be wrapped, say in a call to slurm:

>

> salloc <resources> srun <resources> somecommand < source1 > target1

>

> I would love for this wrapping of build commands to occur "behind the

> scenes":

> 1) The wrapping should be applied to all executed commands (so external

> builders and tools should "just work"

> 2) Target freshness should not depend on the type of wrapping that

> occurs, but /should/ still depend on the command that is wrapped.

>

> I've looked through the documentation at custom builders, "AddMethod",

> deciders, etc. I can get close to what I want. I might even be able to get

> there, but I keep thinking there must be a better way than what I'm trying.

> Is this possible with scons?

>

>

> Sure. So I'd suggest you just prepend the SHLINK, SHCC SHCXX, etc

> variables with your prefixing commands. (see

> http://scons.org/doc/production/HTML/scons-man.html for list of variables)

> But wrap them in $( and $) See manpage: env.subst() for details.

> http://scons.org/doc/production/HTML/scons-man.html

>

> Or you could change env['SHELL'] see manpage as well.

> -Bill

>

> _______________________________________________

> Scons-users mailing list

> Scons-users at scons.org

> http://four.pairlist.net/mailman/listinfo/scons-users

>

>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20131031/6fbdc221/attachment-0001.htm


More information about the Scons-users mailing list