[Scons-users] Cloning environments, cannot enable custom tools

Killian De Smedt killiands at gmail.com
Fri Oct 25 11:49:40 EDT 2013


Hello everybody,

I currently have one custom tool, called 'protoc' which adds a new Builder
'Protoc' to my environment.

When I create a new environment in my SConscripts with 'env =
Environment(..., tools=['default', 'protoc'], toolpath=[Dir('#').abspath])
everything works as expected. I can call env.Protoc(...) and it will call
my custom builder as expected.

However, I am now trying to create a default environment in my SConstruct
file and pass this one to my SConscript files to make my life a bit easier,
using the method described here:
http://www.scons.org/doc/1.2.0/HTML/scons-user/x3186.html

The problem is that the Clone process does not seem to preserve my tools, I
always end up with an AttributeError when trying to call the Protoc
command. I noticed the Clone command explicitly specifies the tools and
toolpath variables again in its interface, so I thought I should reapply
them there, but this did not work either. Whatever I tried up until now,
the custom builder seems to have disappeared after a Clone.

I also made sure that the Protoc command is present in the default
environment by printing the output of dir on it (in the SConscript), the
output of dir on the cloned environment did not contain the Protoc.

How can I (ideally) preserve the tools in a Clone, or (less ideally due to
duplication) at least re-apply them?

Thank you,

Killian

<killiands at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20131025/096ee077/attachment-0001.html


More information about the Scons-users mailing list