[Scons-users] Treating all files as out of date

Dirk Bächle tshortik at gmx.de
Thu Jul 11 17:11:11 EDT 2013


Hi Remko,

On 11.07.2013 19:13, Remko Tronçon wrote:

> Hi Dirk,

>

> On 10 July 2013 00:06, Dirk Bächle <tshortik at gmx.de> wrote:

>> If you'd simply need this for a single project or once in a while, another

>> option would be a custom Decider (see 6.1.4 in the UserGuide) which always

>> returns True.

> Although this seemed to work on first sight, it seems to still not

> rebuild some types of files.

> [...]

>

> For "Foo", this works, but "Bar" is never

> regenerated. Any reasons? I'm guessing it's related to the source

> nodes not being Files but Values, but if so, is it intentional that

> the Decider does not apply to these nodes?


you're right. It's not possible to override the "has_changed" function
for Value nodes with the env.Decider() function, it only works for
File/Directory nodes (can't tell whether this is "by design" or not,
it's what the current code says).
You can replace it manually, as follows:

import SCons.Node.Python as snp

def custom_decider(dep, target, prev_ni):
return True

snp.Value.changed_since_last_build = custom_decider

env = Environment()
env.Tool("textfile")
env.Decider(custom_decider)
env.Textfile("Bar", ["Bar"])
env.Program("foo", ["foo.c"])

I tested this on my side, and it seems to work fine. So give it a spin
if you like...

Regards,

Dirk




More information about the Scons-users mailing list