Skip to contentSkip to conversation

bitbake: cooker: wait seconds to unlock bitbake.lock

RFC PATCH New Chong Lu 1 participant 1 message Jan 16, 2015 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Chong Lu

author
#1 lore raw

RFC PATCH 1/1 bitbake: cooker: wait seconds to unlock bitbake.lock

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.

---
 bitbake/lib/bb/cooker.py | 8 ++++++++
 1 file changed, 8 insertions(+)
bitbake/lib/bb/cooker.py +8 -0
index 95f65ac..8ebb335 100644
@@ -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:
Signature · 1 line
1.9.1