summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/sstatesig.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oe/sstatesig.py')
-rw-r--r--meta/lib/oe/sstatesig.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index b6f8ab92cb..f883497292 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -399,7 +399,13 @@ def find_siginfo(pn, taskname, taskhashlist, d):
399 return siginfo.rpartition('.')[2] 399 return siginfo.rpartition('.')[2]
400 400
401 def get_time(fullpath): 401 def get_time(fullpath):
402 return os.stat(fullpath).st_mtime 402 # NFS can end up in a weird state where the file exists but has no stat info.
403 # If that happens, we assume it doesn't acutally exist and show a warning
404 try:
405 return os.stat(fullpath).st_mtime
406 except FileNotFoundError:
407 bb.warn("Could not obtain mtime for {}".format(fullpath))
408 return None
403 409
404 # First search in stamps dir 410 # First search in stamps dir
405 localdata = d.createCopy() 411 localdata = d.createCopy()
@@ -422,13 +428,17 @@ def find_siginfo(pn, taskname, taskhashlist, d):
422 if taskhashlist: 428 if taskhashlist:
423 for taskhash in taskhashlist: 429 for taskhash in taskhashlist:
424 if fullpath.endswith('.%s' % taskhash): 430 if fullpath.endswith('.%s' % taskhash):
425 hashfiles[taskhash] = {'path':fullpath, 'sstate':False, 'time':get_time(fullpath)} 431 mtime = get_time(fullpath)
432 if mtime:
433 hashfiles[taskhash] = {'path':fullpath, 'sstate':False, 'time':mtime}
426 if len(hashfiles) == len(taskhashlist): 434 if len(hashfiles) == len(taskhashlist):
427 foundall = True 435 foundall = True
428 break 436 break
429 else: 437 else:
430 hashval = get_hashval(fullpath) 438 hashval = get_hashval(fullpath)
431 hashfiles[hashval] = {'path':fullpath, 'sstate':False, 'time':get_time(fullpath)} 439 mtime = get_time(fullpath)
440 if mtime:
441 hashfiles[hashval] = {'path':fullpath, 'sstate':False, 'time':mtime}
432 442
433 if not taskhashlist or (len(hashfiles) < 2 and not foundall): 443 if not taskhashlist or (len(hashfiles) < 2 and not foundall):
434 # That didn't work, look in sstate-cache 444 # That didn't work, look in sstate-cache
@@ -459,7 +469,9 @@ def find_siginfo(pn, taskname, taskhashlist, d):
459 actual_hashval = get_hashval(fullpath) 469 actual_hashval = get_hashval(fullpath)
460 if actual_hashval in hashfiles: 470 if actual_hashval in hashfiles:
461 continue 471 continue
462 hashfiles[actual_hashval] = {'path':fullpath, 'sstate':True, 'time':get_time(fullpath)} 472 mtime = get_time(fullpath)
473 if mtime:
474 hashfiles[actual_hashval] = {'path':fullpath, 'sstate':True, 'time':mtime}
463 475
464 return hashfiles 476 return hashfiles
465 477