Bug 5476 - [yocto-bsp] find_bblayers fails with Python error if bitbake_env_cmd fails
Summary: [yocto-bsp] find_bblayers fails with Python error if bitbake_env_cmd fails
Status: RESOLVED FIXED
Alias: None
Product: Meta-yocto
Classification: Build System, Metadata & Runtime
Component: configuration (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.6
Assignee: Tom Zanussi
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2013-11-05 15:14 UTC by Bastien JAUNY
Modified: 2013-12-18 16:47 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments
Proposed patch (451 bytes, patch)
2013-11-05 15:16 UTC, Bastien JAUNY
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Bastien JAUNY 2013-11-05 15:14:38 UTC
In scripts/lib/bsp/kernel.py, find_bblayers() fails in case bitbake_env_cmd doesn't output BBLAYERS. This is due to a bad Python formatted string on line 66.

To reproduce:
1)In your build directory, set up an unexisting layer in conf/bblayers.conf (that will make 'bitbake -e' fail)
2)Call yocto-bsp create with any target arch.

Actual results:
The script fails with a TypeError.

Expected results:
The script fails with an error message describing the cause.

Here's a proposed patch:

--- /home/bjauny/yocto/poky-dora/scripts/lib/bsp/kernel.py	2013-11-05 16:13:38.250129173 +0100
+++ /home/bjauny/yocto/poky-dora/scripts/lib/bsp/kernel.py.new	2013-11-05 16:13:17.042128497 +0100
@@ -62,7 +62,7 @@
             break
 
     if not bblayers:
-        print "Couldn't find BBLAYERS in 'bitbake -e' output, exiting." % \
+        print "Couldn't find BBLAYERS in %s output, exiting." % \
             bitbake_env_cmd
         sys.exit(1)
 

Seen on dora head revision.
Comment 1 Bastien JAUNY 2013-11-05 15:16:53 UTC
Created attachment 1608 [details]
Proposed patch

Attached proposed patch.
Comment 2 Tom Zanussi 2013-11-13 14:34:43 UTC
Hi, I've verified the problem and the patch looks good - feel free to submit it to the poky mailing list, or if you'd rather, I can do that (and give you credit).
Comment 3 Bastien JAUNY 2013-11-13 15:08:05 UTC
Hi Tom,
I'm not used to the mailing list process. Should I just post a new thread describing this bug or do I also need to commit my patch? Sorry if these are noob questions but I'm brand new to this, even if I used yocto intensively the last months.

(In reply to comment #2)
> Hi, I've verified the problem and the patch looks good - feel free to submit
> it to the poky mailing list, or if you'd rather, I can do that (and give you
> credit).
Comment 4 Tom Zanussi 2013-11-13 15:31:23 UTC
(In reply to comment #3)
> Hi Tom,
> I'm not used to the mailing list process. Should I just post a new thread
> describing this bug or do I also need to commit my patch? Sorry if these are
> noob questions but I'm brand new to this, even if I used yocto intensively
> the last months.
> 
> (In reply to comment #2)
> > Hi, I've verified the problem and the patch looks good - feel free to submit
> > it to the poky mailing list, or if you'd rather, I can do that (and give you
> > credit).

You can just submit the patch to the poky mailing list - the patch itself should describe teh problem and what you did to fix it.  Here are some basic instructions on how you can do that - let me know if you need help with any of it.

https://wiki.yoctoproject.org/wiki/Poky_Contributions

If you don't want to go to the trouble of getting poky-contrib access, since this is such a simple patch, you could just send the patch in e-mail only e.g. make your change in git, 'tit commit -s' the change, then do 'git format-patch -1' and send that patch to the list.
Comment 5 Bastien JAUNY 2013-11-13 18:07:36 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > Hi Tom,
> > I'm not used to the mailing list process. Should I just post a new thread
> > describing this bug or do I also need to commit my patch? Sorry if these are
> > noob questions but I'm brand new to this, even if I used yocto intensively
> > the last months.
> > 
> > (In reply to comment #2)
> > > Hi, I've verified the problem and the patch looks good - feel free to submit
> > > it to the poky mailing list, or if you'd rather, I can do that (and give you
> > > credit).
> 
> You can just submit the patch to the poky mailing list - the patch itself
> should describe teh problem and what you did to fix it.  Here are some basic
> instructions on how you can do that - let me know if you need help with any
> of it.
> 
> https://wiki.yoctoproject.org/wiki/Poky_Contributions
> 
> If you don't want to go to the trouble of getting poky-contrib access, since
> this is such a simple patch, you could just send the patch in e-mail only
> e.g. make your change in git, 'tit commit -s' the change, then do 'git
> format-patch -1' and send that patch to the list.

Just did your latest suggestion. Screwed up a little bit my mail, but I'll correct that. Thanks!
Comment 6 Tom Zanussi 2013-12-18 16:47:32 UTC
Fixed by poky/master commit: d60b4ff3517487bd111c6d7e1410882280229377