[Scons-users] Tool specification `exists()` not called?

Dirk Bächle tshortik at gmx.de
Wed Oct 9 16:09:24 EDT 2013


On 09.10.2013 21:05, Márcio Faustino wrote:

> Hi Dirk,

>

> I read it online at

> <http://www.scons.org/doc/production/HTML/scons-man.html#lbAG>, in the

> paragraph starting with "This looks for a tool specification in".

>


Although this paragraph doesn't state explicitly that the exists()
method gets called (nit-picking, I know ;) ), I can understand how it
may be misleading...


> If user defined tools won't have their "exists()" called, what is the

> appropriate thing to do in order to signal that a tool does not exist?

>


There is no easy answer to this question, I'm afraid. Note that a revamp
of the current SCons toolchain handling is on our Roadmap (
http://www.scons.org/wiki/Roadmap ) for the near future.

My current personal view on this is: A Tool itself is always present,
otherwise you'd get an ImportError. Tools that don't define any
Builders, but simply change the Environment, should always return True.
A Tool should return False or '' from its exists() method, if the user
has no chance to get its defined Builders working by setting internal
variables, especially $PATH.
As a user I still want to be able to say:

env = Environment(tools=[])
# Builders get installed, even though the executables are
# not found on the path
env.Tool('Qt4')
# Now we correct the paths to our commands
# and make the Builders work
env['QT4DIR'] = '/something/special/not/in/path'

Dirk




More information about the Scons-users mailing list