All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bitbake: invalidate mtime cache if file doesn't exist
@ 2015-04-14 16:42 Ed Bartosh
  2015-04-17 10:31 ` Richard Purdie
  0 siblings, 1 reply; 4+ messages in thread
From: Ed Bartosh @ 2015-04-14 16:42 UTC (permalink / raw)
  To: bitbake-devel

Mtime cache is desinged with assumption that files are not
removed. Unfortunately it's not always the case for memory-resident
bitbake as build/tmp can be removed to perform build from scratch.
In this case bitbake crashes when trying to create timestamps if
tmp/stamps/ hierarchy doesn't exist.

Simple check of file existance should solve this issue.

[YOCTO: #7562]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 bitbake/lib/bb/parse/__init__.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/bitbake/lib/bb/parse/__init__.py b/bitbake/lib/bb/parse/__init__.py
index 25effc2..e880732 100644
--- a/bitbake/lib/bb/parse/__init__.py
+++ b/bitbake/lib/bb/parse/__init__.py
@@ -62,6 +62,8 @@ def cached_mtime(f):
     return __mtime_cache[f]
 
 def cached_mtime_noerror(f):
+    if not os.path.exists(f):
+        return 0
     if f not in __mtime_cache:
         try:
             __mtime_cache[f] = os.stat(f)[stat.ST_MTIME]
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-04-21 15:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-14 16:42 [PATCH] bitbake: invalidate mtime cache if file doesn't exist Ed Bartosh
2015-04-17 10:31 ` Richard Purdie
2015-04-19 22:03   ` [PATCH] bitbake: reset mtime cache before the build Ed Bartosh
2015-04-21 15:48   ` [PATCH] bitbake: reset build " Ed Bartosh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.