All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] bitbake error fixes
@ 2012-02-13 11:41 Paul Eggleton
  2012-02-13 11:41 ` [PATCH 1/3] bitbake: show appropriate warnings for universe target Paul Eggleton
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Paul Eggleton @ 2012-02-13 11:41 UTC (permalink / raw)
  To: bitbake-devel

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(-)

-- 
1.7.5.4




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

* [PATCH 1/3] bitbake: show appropriate warnings for universe target
  2012-02-13 11:41 [PATCH 0/3] bitbake error fixes Paul Eggleton
@ 2012-02-13 11:41 ` Paul Eggleton
  2012-02-13 11:41 ` [PATCH 2/3] bitbake/knotty: ensure we return non-zero exit code on Ctrl+C Paul Eggleton
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Paul Eggleton @ 2012-02-13 11:41 UTC (permalink / raw)
  To: bitbake-devel

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]

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 bitbake/lib/bb/cooker.py   |    4 ++++
 bitbake/lib/bb/runqueue.py |   10 +++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index bb09dff..b5cf9e1 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -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:
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 7bf4320..c24841f 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -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
-- 
1.7.5.4




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

* [PATCH 2/3] bitbake/knotty: ensure we return non-zero exit code on Ctrl+C
  2012-02-13 11:41 [PATCH 0/3] bitbake error fixes Paul Eggleton
  2012-02-13 11:41 ` [PATCH 1/3] bitbake: show appropriate warnings for universe target Paul Eggleton
@ 2012-02-13 11:41 ` Paul Eggleton
  2012-02-22 21:14   ` Paul Eggleton
  2012-02-13 11:41 ` [PATCH 3/3] bitbake/knotty: ensure CommandFailed increases error count Paul Eggleton
  2012-02-22 20:25 ` [PATCH 0/3] bitbake error fixes Richard Purdie
  3 siblings, 1 reply; 6+ messages in thread
From: Paul Eggleton @ 2012-02-13 11:41 UTC (permalink / raw)
  To: bitbake-devel

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.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 bitbake/lib/bb/ui/knotty.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index e1d42f7..2693a78 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -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
-- 
1.7.5.4




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

* [PATCH 3/3] bitbake/knotty: ensure CommandFailed increases error count
  2012-02-13 11:41 [PATCH 0/3] bitbake error fixes Paul Eggleton
  2012-02-13 11:41 ` [PATCH 1/3] bitbake: show appropriate warnings for universe target Paul Eggleton
  2012-02-13 11:41 ` [PATCH 2/3] bitbake/knotty: ensure we return non-zero exit code on Ctrl+C Paul Eggleton
@ 2012-02-13 11:41 ` Paul Eggleton
  2012-02-22 20:25 ` [PATCH 0/3] bitbake error fixes Richard Purdie
  3 siblings, 0 replies; 6+ messages in thread
From: Paul Eggleton @ 2012-02-13 11:41 UTC (permalink / raw)
  To: bitbake-devel

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.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 bitbake/lib/bb/ui/knotty.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index 2693a78..ed978e2 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -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):
-- 
1.7.5.4




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

* Re: [PATCH 0/3] bitbake error fixes
  2012-02-13 11:41 [PATCH 0/3] bitbake error fixes Paul Eggleton
                   ` (2 preceding siblings ...)
  2012-02-13 11:41 ` [PATCH 3/3] bitbake/knotty: ensure CommandFailed increases error count Paul Eggleton
@ 2012-02-22 20:25 ` Richard Purdie
  3 siblings, 0 replies; 6+ messages in thread
From: Richard Purdie @ 2012-02-22 20:25 UTC (permalink / raw)
  To: Paul Eggleton; +Cc: bitbake-devel

On Mon, 2012-02-13 at 11:41 +0000, Paul Eggleton wrote:
> 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




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

* Re: [PATCH 2/3] bitbake/knotty: ensure we return non-zero exit code on Ctrl+C
  2012-02-13 11:41 ` [PATCH 2/3] bitbake/knotty: ensure we return non-zero exit code on Ctrl+C Paul Eggleton
@ 2012-02-22 21:14   ` Paul Eggleton
  0 siblings, 0 replies; 6+ messages in thread
From: Paul Eggleton @ 2012-02-22 21:14 UTC (permalink / raw)
  To: bitbake-devel

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.
> 
> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
> ---
>  bitbake/lib/bb/ui/knotty.py |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
> index e1d42f7..2693a78 100644
> --- a/bitbake/lib/bb/ui/knotty.py
> +++ b/bitbake/lib/bb/ui/knotty.py
> @@ -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

-- 

Paul Eggleton
Intel Open Source Technology Centre



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

end of thread, other threads:[~2012-02-22 21:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-13 11:41 [PATCH 0/3] bitbake error fixes Paul Eggleton
2012-02-13 11:41 ` [PATCH 1/3] bitbake: show appropriate warnings for universe target Paul Eggleton
2012-02-13 11:41 ` [PATCH 2/3] bitbake/knotty: ensure we return non-zero exit code on Ctrl+C Paul Eggleton
2012-02-22 21:14   ` Paul Eggleton
2012-02-13 11:41 ` [PATCH 3/3] bitbake/knotty: ensure CommandFailed increases error count Paul Eggleton
2012-02-22 20:25 ` [PATCH 0/3] bitbake error fixes Richard Purdie

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.