Skip to contentSkip to conversation

bitbake error fixes

PATCH Applied Paul Eggleton 2 participants 6 messages Feb 13, 2012 – Feb 22, 2012

lore
Share & tools
lore
#0 lore raw

cover bitbake error fixes

The following changes (against Poky, but apply cleanly with -p2 against bitbake master) are available in the git repository at:
git://git.yoctoproject.org/poky-contrib paule/bberrors1
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=paule/bberrors1

Paul Eggleton (3):
bitbake: show appropriate warnings for universe target bitbake/knotty: ensure we return non-zero exit code on Ctrl+C bitbake/knotty: ensure CommandFailed increases error count

 bitbake/lib/bb/cooker.py    |    4 ++++
 bitbake/lib/bb/runqueue.py  |   10 +++++++---
 bitbake/lib/bb/ui/knotty.py |    6 ++++++
 3 files changed, 17 insertions(+), 3 deletions(-)
Signature · 1 line
1.7.5.4
#1 lore raw

PATCH 1/3 bitbake: show appropriate warnings for universe target

When building the universe target:
* Show a warning about universe likely producing errors
* Multiprovider errors are now shown as warnings

Also remove an unused "error" variable in runqueue.py.

Fixes [YOCTO #1936]

---
 bitbake/lib/bb/cooker.py   |    4 ++++
 bitbake/lib/bb/runqueue.py |   10 +++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)
bitbake/lib/bb/cooker.py +4 -0
index bb09dff..b5cf9e1 100644
@@ -1083,6 +1083,7 @@ class BBCooker:
         if (task == None):
             task = self.configuration.cmd
 
+        universe = ('universe' in targets)
         targets = self.checkPackages(targets)
 
         def buildTargetsIdle(server, rq, abort):
@@ -1126,6 +1127,8 @@ class BBCooker:
         taskdata.add_unresolved(localdata, self.status)
 
         rq = bb.runqueue.RunQueue(self, self.configuration.data, self.status, taskdata, runlist)
+        if universe:
+            rq.rqdata.warn_multi_bb = True
 
         self.server_registration_cb(buildTargetsIdle, rq)
 
@@ -1179,6 +1182,7 @@ class BBCooker:
                 pkgs_to_build.append(t)
 
         if 'universe' in pkgs_to_build:
+            parselog.warn("The \"universe\" target is only intended for testing and may produce errors.")
             parselog.debug(1, "collating packages for \"universe\"")
             pkgs_to_build.remove('universe')
             for t in self.status.universe_target:
bitbake/lib/bb/runqueue.py +7 -3
index 7bf4320..c24841f 100644
@@ -187,6 +187,7 @@ class RunQueueData:
         self.taskData = taskData
         self.targets = targets
         self.rq = rq
+        self.warn_multi_bb = False
 
         self.stampwhitelist = cfgData.getVar("BB_STAMP_WHITELIST", 1) or ""
         self.multi_provider_whitelist = (cfgData.getVar("MULTI_PROVIDER_WHITELIST", 1) or "").split()
@@ -674,11 +675,14 @@ class RunQueueData:
                     prov_list[prov] = [fn]
                 elif fn not in prov_list[prov]:
                     prov_list[prov].append(fn)
-        error = False
         for prov in prov_list:
             if len(prov_list[prov]) > 1 and prov not in self.multi_provider_whitelist:
-                error = True
-                logger.error("Multiple .bb files are due to be built which each provide %s (%s).\n This usually means one provides something the other doesn't and should.", prov, " ".join(prov_list[prov]))
+                msg = "Multiple .bb files are due to be built which each provide %s (%s)." % (prov, " ".join(prov_list[prov]))
+                if self.warn_multi_bb:
+                    logger.warn(msg)
+                else:
+                    msg += "\n This usually means one provides something the other doesn't and should."
+                    logger.error(msg)
 
 
         # Create a whitelist usable by the stamp checks
Signature · 1 line
1.7.5.4
#2 lore raw

PATCH 2/3 bitbake/knotty: ensure we return non-zero exit code on Ctrl+C

In reply to Paul Eggleton

If the user uses Ctrl+C to exit out of the build, then ensure we return a non-zero exit code since the entire build was not completed successfully.

If nothing else, this is useful to avoid continuing in the bitbake wrapper script in OE-Core if the initial pseudo build is interrupted.

---
 bitbake/lib/bb/ui/knotty.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
bitbake/lib/bb/ui/knotty.py +5 -0
index e1d42f7..2693a78 100644
@@ -296,4 +296,9 @@ def main(server, eventHandler):
     if summary:
         print(summary)
 
+    if shutdown:
+        print("Execution was interrupted, returning a non-zero exit code.")
+        if return_value == 0:
+            return_value = 1
+
     return return_value
Signature · 1 line
1.7.5.4
#3 lore raw

Re: [PATCH 2/3] bitbake/knotty: ensure we return non-zero exit code on Ctrl+C

Quoted 17 lines · On Monday 13 February 2012 11:41:32 Paul Eggleton wrote:

If the user uses Ctrl+C to exit out of the build, then ensure we return a non-zero exit code since the entire build was not completed successfully.

If nothing else, this is useful to avoid continuing in the bitbake wrapper script in OE-Core if the initial pseudo build is interrupted.

---
 bitbake/lib/bb/ui/knotty.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
bitbake/lib/bb/ui/knotty.py +0 -0
index e1d42f7..2693a78 100644

bitbake/lib/bb/ui/knotty.py def main(server, eventHandler): · line 304

Quoted 9 lines
bitbake/lib/bb/ui/knotty.py +5 -0
@@ -296,4 +296,9 @@ def main(server, eventHandler):
     if summary:
         print(summary)
 
+    if shutdown:
+        print("Execution was interrupted, returning a non-zero exit code.")
+        if return_value == 0:
+            return_value = 1
+
     return return_value

Seems I didn't test this well enough. Working on a fix right now.

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
#4 lore raw

PATCH 3/3 bitbake/knotty: ensure CommandFailed increases error count

In reply to Paul Eggleton

CommandFailed already sets the return code, so we print out the error summary message, however we don't increase the error count so it is usually zero in this case. As we are actually showing an ERROR message, increment the error count so that the summary makes sense.

---
 bitbake/lib/bb/ui/knotty.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
bitbake/lib/bb/ui/knotty.py +1 -0
index 2693a78..ed978e2 100644
@@ -203,6 +203,7 @@ def main(server, eventHandler):
                 break
             if isinstance(event, bb.command.CommandFailed):
                 return_value = event.exitcode
+                errors = errors + 1
                 logger.error("Command execution failed: %s", event.error)
                 break
             if isinstance(event, bb.command.CommandExit):
Signature · 1 line
1.7.5.4
#5 lore raw
In reply to Paul Eggleton
Quoted 10 lines · Paul Eggleton

The following changes (against Poky, but apply cleanly with -p2 against bitbake master) are available in the git repository at:
git://git.yoctoproject.org/poky-contrib paule/bberrors1
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=paule/bberrors1

Paul Eggleton (3):
bitbake: show appropriate warnings for universe target bitbake/knotty: ensure we return non-zero exit code on Ctrl+C bitbake/knotty: ensure CommandFailed increases error count

Merged to master, thanks.

Richard