From: Ed Bartosh <ed.bartosh@linux.intel.com>
To: bitbake-devel@lists.openembedded.org
Subject: [PATCH] bitbake: invalidate mtime cache if file doesn't exist
Date: Tue, 14 Apr 2015 19:42:50 +0300 [thread overview]
Message-ID: <1429029770-15462-1-git-send-email-ed.bartosh@linux.intel.com> (raw)
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
next reply other threads:[~2015-04-14 16:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-14 16:42 Ed Bartosh [this message]
2015-04-17 10:31 ` [PATCH] bitbake: invalidate mtime cache if file doesn't exist 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1429029770-15462-1-git-send-email-ed.bartosh@linux.intel.com \
--to=ed.bartosh@linux.intel.com \
--cc=bitbake-devel@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox