[Scons-users] Using Command with TryBuild

Carnë Draug carandraug+dev at gmail.com
Fri Feb 15 02:37:21 EST 2013


Hi

I'm unable to use the Command builder with TryBuild. I get the following error:

AttributeError: 'NodeList' object has no attribute 'builder':
<snip>
File "/usr/lib/scons/SCons/SConf.py", line 799:
return self.sconf.TryBuild(*args, **kw)
File "/usr/lib/scons/SCons/SConf.py", line 546:
pref = self.env.subst( builder.builder.prefix )

I'm using this has to check for the availability of a perl module

context.TryBuild (context.env.Command(target = [], source = [], action
= "perl -M%s -e 1" % module))

I have also tried to use Execute

is_ok = True
if context.env.Execute("perl -M%s -e 1" % module):
is_ok = False
context.Result (is_ok)
return is_ok

which does work but prints the command being execute in front of the
check message. I tried SetOption ("silence") but this option is not
settable, and looked into the ENV variables for the COM string that
would fit execute but found nothing.

So how can I run a command when doing checks for configuration?

Thanks,
Carnë


More information about the Scons-users mailing list