Patchwork [02/16] bitbake pseudo wrapper: Don't base success on bitbake return code

login
register
mail settings
Submitter Matthew McClintock
Date Sept. 29, 2011, 4:20 a.m.
Message ID <1317270070-14250-2-git-send-email-msm@freescale.com>
Download mbox | patch
Permalink /patch/12381/
State New, archived
Headers show

Comments

Matthew McClintock - Sept. 29, 2011, 4:20 a.m.
bitbake does not return 0 when a build succeeds. Instead lets look and
make sure the pseudo binaries are created as a proper test of success

Signed-off-by: Matthew McClintock <msm@freescale.com>
---
 scripts/bitbake |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
Richard Purdie - Sept. 29, 2011, 8:26 a.m.
On Wed, 2011-09-28 at 23:20 -0500, Matthew McClintock wrote:
> bitbake does not return 0 when a build succeeds.

Er, yes it does. If you're seeing something other than 0 its likely
because you're seeing ERROR messages?

Cheers,

Richard
McClintock Matthew-B29882 - Sept. 29, 2011, 6:04 p.m.
On Thu, Sep 29, 2011 at 3:26 AM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> On Wed, 2011-09-28 at 23:20 -0500, Matthew McClintock wrote:
>> bitbake does not return 0 when a build succeeds.
>
> Er, yes it does. If you're seeing something other than 0 its likely
> because you're seeing ERROR messages?

First off, this appears to have been fixed along the way. But I know I
was getting a message like:

[snip]
NOTE: Tasks Summary: Attempted 133 tasks of which 0 didn't need to be
rerun and 0 failed.

Then it would stop after building pseudo-native. Maybe we should add a
message to scripts/bitbake so we get an actual failure message when
this occurs? Also, are these errors relevant if we built psuedo-native
properly?

-M
Richard Purdie - Sept. 29, 2011, 6:27 p.m.
On Thu, 2011-09-29 at 18:04 +0000, McClintock Matthew-B29882 wrote:
> On Thu, Sep 29, 2011 at 3:26 AM, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > On Wed, 2011-09-28 at 23:20 -0500, Matthew McClintock wrote:
> >> bitbake does not return 0 when a build succeeds.
> >
> > Er, yes it does. If you're seeing something other than 0 its likely
> > because you're seeing ERROR messages?
> 
> First off, this appears to have been fixed along the way. But I know I
> was getting a message like:
> 
> [snip]
> NOTE: Tasks Summary: Attempted 133 tasks of which 0 didn't need to be
> rerun and 0 failed.

Can you file an enhancement bug to list the number of errors and
warnings shown in the summary please? :)

We need to make it more obvious how many warnings/errors are occurring
since errors change the exit code.

> Then it would stop after building pseudo-native. Maybe we should add a
> message to scripts/bitbake so we get an actual failure message when
> this occurs? Also, are these errors relevant if we built psuedo-native
> properly?

Hard to say without seeing what they were...

Cheers,

Richard
McClintock Matthew-B29882 - Sept. 29, 2011, 6:30 p.m.
On Thu, Sep 29, 2011 at 1:27 PM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>> NOTE: Tasks Summary: Attempted 133 tasks of which 0 didn't need to be
>> rerun and 0 failed.
>
> Can you file an enhancement bug to list the number of errors and
> warnings shown in the summary please? :)

http://bugzilla.yoctoproject.org/show_bug.cgi?id=1540

> We need to make it more obvious how many warnings/errors are occurring
> since errors change the exit code.

Feel free to drop this patch for now, since it appears not to be an
immediate issue.

-M

Patch

diff --git a/scripts/bitbake b/scripts/bitbake
index 587428c..4f4a179 100755
--- a/scripts/bitbake
+++ b/scripts/bitbake
@@ -61,13 +61,12 @@  if [ $buildpseudo = "1" ]; then
         TARTARGET=""
     fi
     bitbake pseudo-native $TARTARGET -c populate_sysroot
+    PSEUDOBINDIR=`bitbake -e | grep STAGING_BINDIR_NATIVE=\" | cut -d '=' -f2 | cut -d '"' -f2`
     ret=$?
     if [ "$ret" != "0" ]; then
         exit 1
     fi
-    PSEUDOBINDIR=`bitbake -e | grep STAGING_BINDIR_NATIVE=\" | cut -d '=' -f2 | cut -d '"' -f2`
-    ret=$?
-    if [ "$ret" != "0" ]; then
+    if [ ! -e $PSEUDOBINDIR/pseudo ]; then
         exit 1
     fi
     echo $PSEUDOBINDIR > $BUILDDIR/pseudodone