[bitbake-devel] [RFC][PATCH 1/1] bitbake: cooker: wait seconds to unlock bitbake.lock

Chong Lu Chong.Lu at windriver.com
Fri Jan 16 09:33:57 UTC 2015


Sometimes, we get following error when bitbake command is executed continuously

    "ERROR: Only one copy of bitbake should be run against a build directory"

For example, "bitbake -p m4 && bitbake -e".
Add seconds to wait unlock after first bitbake command exit.

Signed-off-by: Chong Lu <Chong.Lu at windriver.com>
---
 bitbake/lib/bb/cooker.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 95f65ac..8ebb335 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -140,6 +140,14 @@ class BBCooker:
         # directory at a time
         lockfile = self.data.expand("${TOPDIR}/bitbake.lock")
         self.lock = bb.utils.lockfile(lockfile, False, False)
+        n = 0
+        while n < 3:
+            if not self.lock:
+                time.sleep(0.5)
+                self.lock = bb.utils.lockfile(lockfile, False, False)
+                n += 1
+            else:
+                break
         if not self.lock:
             bb.fatal("Only one copy of bitbake should be run against a build directory")
         try:
-- 
1.9.1




More information about the bitbake-devel mailing list