Discussion:
[Scons-users] SCons not actually not using timestamp-newer decider correctly.
Lyuwen Fu
2018-05-06 21:41:53 UTC
Permalink
Hi,

When I am trying to use timestamp-newer decider in scons. Scons is still trying to create a '.sconsign.dblite' file. And if the file does not exist. Scons will not compare the timestamp between the targets and dependencies to determine whether or not to rebuild. This is not the same as it is described "This is the behavior of the classic Make utility", because make does not generate any extra files.

To recreate this issue, just execute:
```
touch dep target
echo “env = Environment()” > SConstruct
echo “env.Decider("make”)” >> SConstruct
echo “env.Command('target', 'dep', 'touch target’)” >> SConstruct
scons -n
```
The output will show the "'touch target” command even if 'target' has a timestamp newer than 'dep’.


================================
Lyuwen Fu
Ph.D. Candidate
Columbia University
***@gmail.com
(347) 208-5539
Bill Deegan
2018-05-07 18:23:52 UTC
Permalink
Seems like you have two questions/issues.
1) SCons creating sconsign file.
SCons will always create the sconsign file.
In this case it will store at least, all the dependencies, the command
lines for each target, the date and size of each file.

2) SCons is not checking the file timestamps between target and sources to
decide if the target should be rebuilt?
Since in addition to file timestamp SCons will always check the Action
used to create the target files, and there is no information what those
were when there is no existing .sconsign, then it is expected that it would
rebuild. Also factored into the decision whether to rebuild is the number
of dependencies for the target. If that number has changed (and in this
case since there is no previous information, that # would be 0 and would
always show changed), then it will rebuild.

Note: This is to ensure that (minimally) to target file is NOT rebuilt when
there is a change. The inverse of this would be to assume that the command
line to create the target file didn't change, but since that's not a safe
assumption. SCons will not do that.

I can understand your confusion regarding the decider man page
documentation.

In essence the Decider influences rebuilds only when the previous build
information about action and dependencies of the target are unchanged.

Hope this helps.
-Bill
Post by Lyuwen Fu
Hi,
When I am trying to use timestamp-newer decider in scons. Scons is still
trying to create a '.sconsign.dblite' file. And if the file does not exist.
Scons will not compare the timestamp between the targets and dependencies
to determine whether or not to rebuild. This is not the same as it is
described "This is the behavior of the classic Make utility", because make
does not generate any extra files.
```
touch dep target
echo “env = Environment()” > SConstruct
echo “env.Decider("make”)” >> SConstruct
echo “env.Command('target', 'dep', 'touch target’)” >> SConstruct
scons -n
```
The output will show the "'touch target” command even if 'target' has a
timestamp newer than 'dep’.
================================
Lyuwen Fu
Ph.D. Candidate
Columbia University
(347) 208-5539
_______________________________________________
Scons-users mailing list
https://pairlist4.pair.net/mailman/listinfo/scons-users
Loading...