[Scons-users] Customize build decision logic for phony targets, that doesn't involve files

Andrew Pashkin andrew.pashkin at gmx.co.uk
Tue Mar 15 17:35:41 EDT 2016


I have a target, that requires some time-expensive actions and depends 
on similar time-expensive targets. It's also a phony target, so it 
doesn't depends on a source files nor it doesn't produces a files. And I 
want to make SCons decide when to build this target or not depending on 
some abstract value. To me it would be ideal to use the capability of 
SCons, described in the manual as
> |Value(value, [built_value])| , |env.Value(value, [built_value])|
> ... Value Nodes can be used as dependencies of targets. If the result 
> of calling |str|(|value|) changes between SCons runs, any targets 
> depending on |Value|(|value|) will be rebuilt.

So I've build this SConstruct to test it:

    import random as rnd


    env = Environment()


    def action(**_):
         print('Do crazy things')

    input = env.Value('a')

    env['BUILDERS']['Custom'] = Builder(action=action)
    env.Custom(target='target', source=input)
    env.Pseudo('target')

And I expected SCons to stop rebuilding the target after the first 
build, since the value of the input Value remains constant between 
builds.But SCons rebuilds it every time.

Is there any way to achieve what I'm talking about?

-- 
With kind regards, Andrew Pashkin.
cell phone - +7 (985) 898 57 59
Skype - waves_in_fluids
e-mail - andrew.pashkin at gmx.co.uk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20160316/d7a0d852/attachment.html>


More information about the Scons-users mailing list