[Scons-users] Tool specification `exists()` not called?
Marc Joliet
marcec at gmx.de
Thu Oct 10 07:31:41 EDT 2013
Am Wed, 09 Oct 2013 22:09:24 +0200
schrieb Dirk Bächle <tshortik at gmx.de>:
> 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...
I had the same confusion, so perhaps that part of the documentation should be
rephrased sometime.
> > 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.
Yay!
> 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'
I prefer to expose (and, as a user, have exposed) that sort of potentially
system-dependent variable as a construction variable (so that I can call "scons
QT4DIR=/some/path") and have the tool test for that and return False if it, for
example, still can't find a required program.
--
Marc Joliet
--
"People who think they know everything really annoy those of us who know we
don't" - Bjarne Stroustrup
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
Url : http://four.pairlist.net/pipermail/scons-users/attachments/20131010/e71cb206/attachment.pgp
More information about the Scons-users
mailing list