All of lore.kernel.org
 help / color / mirror / Atom feed
* Minimal BitBake template
@ 2013-01-14 14:04 Andrew Stubbs
  2013-01-14 14:23 ` Bill Traynor
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Stubbs @ 2013-01-14 14:04 UTC (permalink / raw)
  To: bitbake-devel

Hi all,

I'm trying to evaluate use of BitBake for projects other than OE.

As part of that I've been experimenting, and trying to learn how it 
works by writing a minimalist working recipe set starting from a blank 
slate. I had hoped that, with the documentation and error/warning 
messages, I would be able to do this step-by-step through trial and 
error, and thus learn more than doing a straight cut-and-paste. This 
works up to a point, but I've now hit a dead end:

> ERROR: An uncaught exception occured in runqueue, please see the failure below:
> ERROR: Running idle function
> Traceback (most recent call last):
>   File "/opt/bitbake/lib/bb/cooker.py", line 1152, in buildTargetsIdle(server=<ProcessServer(ProcessServer-1, started)>, rq=<bb.runqueue.RunQueue instance at 0x14654d0>, abort=False):
>                  try:
>     >                retval = rq.execute_runqueue()
>                  except runqueue.TaskFailure as exc:
>   File "/opt/bitbake/lib/bb/runqueue.py", line 934, in RunQueue.execute_runqueue():
>              try:
>     >            return self._execute_runqueue()
>              except bb.runqueue.TaskFailure:
>   File "/opt/bitbake/lib/bb/runqueue.py", line 901, in RunQueue._execute_runqueue():
>              if self.state is runQueueRunning:
>     >            retval = self.rqexe.execute()
>
>   File "/opt/bitbake/lib/bb/runqueue.py", line 1365, in RunQueueExecuteTasks.execute():
>
>     >            if self.rq.check_stamp_task(task, taskname, cache=self.stampcache):
>                      logger.debug(2, "Stamp current task %s (%s)", task,
>   File "/opt/bitbake/lib/bb/runqueue.py", line 821, in RunQueue.check_stamp_task(task=0, taskname='do_build', recurse=False, cache={}):
>              # If the stamp is missing its not current
>     >        if not os.access(stampfile, os.F_OK):
>                  logger.debug(2, "Stampfile %s not available", stampfile)
> TypeError: coercing to Unicode: need string or buffer, NoneType found

Apparently BitBake has some kind of internal assumption about what the 
recipes/classes will look like that it doesn't explicitly check, and I 
haven't satisfied, somehow? Googling around suggests that the problem 
might be related to loops in the dependency chain, or something, but my 
recipe only has one task.

Essentially, I have three files:

conf/bitbake.conf
---8<--------------->8---
BBFILES = "*.bb"
CACHE = "/tmp/bbcache"
---8<--------------->8---

classes/base.bbclass
---8<--------------->8---
addtask build

do_build () {
	:
}
---8<--------------->8---

hello.bb
---8<--------------->8---
PROVIDES="hello"

do_build () {
	echo "Hello, World!"
}
---8<--------------->8---

I then invoke "env BBPATH=$PWD bitbake hello" and get the above exception.

Clearly, I'm missing something crucial, but what? Can you help me figure 
out what the minimal "hello world" recipe might look like?

Thanks in advance

Andrew

P.S. I will probably end up using something based on a copy of the OE 
base-class, given there's no point in reinventing the wheel, but I'd 
like to understand how these things work from first-principles first.



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

* Re: Minimal BitBake template
  2013-01-14 14:04 Minimal BitBake template Andrew Stubbs
@ 2013-01-14 14:23 ` Bill Traynor
  2013-01-14 14:47   ` Andrew Stubbs
  0 siblings, 1 reply; 4+ messages in thread
From: Bill Traynor @ 2013-01-14 14:23 UTC (permalink / raw)
  To: Andrew Stubbs; +Cc: bitbake-devel

[-- Attachment #1: Type: text/plain, Size: 4057 bytes --]

On Mon, Jan 14, 2013 at 9:04 AM, Andrew Stubbs <ams@codesourcery.com> wrote:

> Hi all,
>
> I'm trying to evaluate use of BitBake for projects other than OE.
>
> As part of that I've been experimenting, and trying to learn how it works
> by writing a minimalist working recipe set starting from a blank slate. I
> had hoped that, with the documentation and error/warning messages, I would
> be able to do this step-by-step through trial and error, and thus learn
> more than doing a straight cut-and-paste. This works up to a point, but
> I've now hit a dead end:
>
>  ERROR: An uncaught exception occured in runqueue, please see the failure
>> below:
>> ERROR: Running idle function
>> Traceback (most recent call last):
>>   File "/opt/bitbake/lib/bb/cooker.**py", line 1152, in
>> buildTargetsIdle(server=<**ProcessServer(ProcessServer-1, started)>,
>> rq=<bb.runqueue.RunQueue instance at 0x14654d0>, abort=False):
>>                  try:
>>     >                retval = rq.execute_runqueue()
>>                  except runqueue.TaskFailure as exc:
>>   File "/opt/bitbake/lib/bb/runqueue.**py", line 934, in
>> RunQueue.execute_runqueue():
>>              try:
>>     >            return self._execute_runqueue()
>>              except bb.runqueue.TaskFailure:
>>   File "/opt/bitbake/lib/bb/runqueue.**py", line 901, in
>> RunQueue._execute_runqueue():
>>              if self.state is runQueueRunning:
>>     >            retval = self.rqexe.execute()
>>
>>   File "/opt/bitbake/lib/bb/runqueue.**py", line 1365, in
>> RunQueueExecuteTasks.execute()**:
>>
>>     >            if self.rq.check_stamp_task(task, taskname,
>> cache=self.stampcache):
>>                      logger.debug(2, "Stamp current task %s (%s)", task,
>>   File "/opt/bitbake/lib/bb/runqueue.**py", line 821, in
>> RunQueue.check_stamp_task(**task=0, taskname='do_build', recurse=False,
>> cache={}):
>>              # If the stamp is missing its not current
>>     >        if not os.access(stampfile, os.F_OK):
>>                  logger.debug(2, "Stampfile %s not available", stampfile)
>> TypeError: coercing to Unicode: need string or buffer, NoneType found
>>
>
> Apparently BitBake has some kind of internal assumption about what the
> recipes/classes will look like that it doesn't explicitly check, and I
> haven't satisfied, somehow? Googling around suggests that the problem might
> be related to loops in the dependency chain, or something, but my recipe
> only has one task.
>
> Essentially, I have three files:
>
> conf/bitbake.conf
> ---8<--------------->8---
> BBFILES = "*.bb"
> CACHE = "/tmp/bbcache"
> ---8<--------------->8---
>
> classes/base.bbclass
> ---8<--------------->8---
> addtask build
>
> do_build () {
>         :
> }
> ---8<--------------->8---
>
> hello.bb
> ---8<--------------->8---
> PROVIDES="hello"
>
> do_build () {
>         echo "Hello, World!"
> }
> ---8<--------------->8---
>
> I then invoke "env BBPATH=$PWD bitbake hello" and get the above exception.
>
> Clearly, I'm missing something crucial, but what? Can you help me figure
> out what the minimal "hello world" recipe might look like?
>
> Thanks in advance
>
> Andrew
>
> P.S. I will probably end up using something based on a copy of the OE
> base-class, given there's no point in reinventing the wheel, but I'd like
> to understand how these things work from first-principles first.
>

This doesn't answer your problem directy, and you may have seen this
tutorial already, but in case not:

http://hambedded.org/blog/2012/11/24/from-bitbake-hello-world-to-an-image/

Note that I'm including a hello world example in the new BitBake User
Manual I'm working on.


>
> ______________________________**_________________
> bitbake-devel mailing list
> bitbake-devel@lists.**openembedded.org<bitbake-devel@lists.openembedded.org>
> http://lists.linuxtogo.org/**cgi-bin/mailman/listinfo/**bitbake-devel<http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/bitbake-devel>
>

[-- Attachment #2: Type: text/html, Size: 5486 bytes --]

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

* Re: Minimal BitBake template
  2013-01-14 14:23 ` Bill Traynor
@ 2013-01-14 14:47   ` Andrew Stubbs
  2013-01-16 12:54     ` Richard Purdie
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Stubbs @ 2013-01-14 14:47 UTC (permalink / raw)
  To: Bill Traynor; +Cc: Andrew Stubbs, bitbake-devel

On 14/01/13 14:23, Bill Traynor wrote:
> This doesn't answer your problem directy, and you may have seen this
> tutorial already, but in case not:
>
> http://hambedded.org/blog/2012/11/24/from-bitbake-hello-world-to-an-image/
>
> Note that I'm including a hello world example in the new BitBake User
> Manual I'm working on.

Thanks!  That's a very useful resource. :)

It's surprisingly hard to find BitBake tutorials that do not assume that 
one is trying to insert something into OE. I wish I'd found this sooner.

The other think I wish I'd found sooner, that you page references, are 
the example conf and bbclass files inside the bitbake sources. I had 
assumed they were some sort of internal detail, and not for the likes of me.

Apparently my base.bbclass and hello.bb files are absolutely fine, but 
something, as yet unidentified, in the bitbake.conf from the sources has 
fixed my problem.

Andrew



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

* Re: Minimal BitBake template
  2013-01-14 14:47   ` Andrew Stubbs
@ 2013-01-16 12:54     ` Richard Purdie
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Purdie @ 2013-01-16 12:54 UTC (permalink / raw)
  To: Andrew Stubbs; +Cc: bitbake-devel

On Mon, 2013-01-14 at 14:47 +0000, Andrew Stubbs wrote:
> On 14/01/13 14:23, Bill Traynor wrote:
> > This doesn't answer your problem directy, and you may have seen this
> > tutorial already, but in case not:
> >
> > http://hambedded.org/blog/2012/11/24/from-bitbake-hello-world-to-an-image/
> >
> > Note that I'm including a hello world example in the new BitBake User
> > Manual I'm working on.
> 
> Thanks!  That's a very useful resource. :)
> 
> It's surprisingly hard to find BitBake tutorials that do not assume that 
> one is trying to insert something into OE. I wish I'd found this sooner.
> 
> The other think I wish I'd found sooner, that you page references, are 
> the example conf and bbclass files inside the bitbake sources. I had 
> assumed they were some sort of internal detail, and not for the likes of me.
> 
> Apparently my base.bbclass and hello.bb files are absolutely fine, but 
> something, as yet unidentified, in the bitbake.conf from the sources has 
> fixed my problem.

At a guess, did you set the STAMP variable?

We could certainly make bitbake give less obtuse errors if some of the
key variables aren't set. Its not been a priority since people don't do
that very often though...

Cheers,

Richard




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

end of thread, other threads:[~2013-01-16 13:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-14 14:04 Minimal BitBake template Andrew Stubbs
2013-01-14 14:23 ` Bill Traynor
2013-01-14 14:47   ` Andrew Stubbs
2013-01-16 12:54     ` 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.