[Scons-dev] dependencys, md5s and timestamps

Peter Løje Hansen plh at oticon.dk
Tue Oct 8 08:38:42 EDT 2013



> -----Original Message-----

> From: scons-dev-bounces at scons.org [mailto:scons-dev-bounces at scons.org]

> On Behalf Of Tom Tanner (BLOOMBERG/ LONDON)

> Sent: 8. oktober 2013 10:10

> To: scons-dev at scons.org; scons-users at scons.org

> Subject: [Scons-dev] dependencys, md5s and timestamps

>

> Yet more investigation has got me to the point where I don't get nasty

> surprises with timestamps.

>

> It appears that this function in Node/FS.py:

> def changed_timestamp_then_content(self, target, prev_ni):

> if not self.changed_timestamp_match(target, prev_ni):

> try:

> self.get_ninfo().csig = prev_ni.csig

> except AttributeError:

> pass

> return False

> return self.changed_content(target, prev_ni)

>

> has the rather unexpected (to me) result of occasionally overwriting

> the calculated signature in your node info when your build has fetched

> something from the cache. I have now modified my 'is the file corrupt'

> check so that it avoids overwriting the csig if there already is one.

>

> I freely admit to being extremely confused about timestamps now. I

> think probably they should be avoided like the plague, but that makes

> the build quite slow as it's doing a lot of unnecessary calculations.

>

> So my question here is really - is the changeed_timestamp_then_content

> actually doing the right thing?

> _______________________________________________

> Scons-dev mailing list

> Scons-dev at scons.org

> http://two.pairlist.net/mailman/listinfo/scons-dev


I have actually spent days debugging above code.

We are using SCons in API mode and in a situation where a source scanner is triggering another source scanner then after second run it happens for some target files that the md5sum of the source files are "shifted" one position up in the .sconsign.dblite file but not the timestamp and filesize fields! I have given up on the issue for now but think maybe the source scanner is not reentrant.

I don't like the code:

> try:

> self.get_ninfo().csig = prev_ni.csig

> except AttributeError:

> pass


The exception can be raised from both left and right side of the assignment...

Best regards
Peter Hansen



More information about the Scons-dev mailing list