[oe] bitbake and OE opperation

Richard Purdie rpurdie at rpsys.net
Wed Mar 28 19:15:18 UTC 2007


On Wed, 2007-03-28 at 10:54 -0700, Tim Bird wrote:
> Richard Purdie wrote:
> >> What triggers do_configure to be executed and when?
> > 
> > Read base.bbclass. It sets up a number of tasks and a default task,
> > "build". You'd add configure after patch, before compile. compile would
> > be before build. "bitbake somefile" would cause the default task (and
> > its dependent tasks) to be executed. You could also do "bitbake somefile
> > -c configure" to specifically execute the configure task.
> 
> I'm sorry, but I don't understand most of that paragraph.
> 
> I've read the manuals - maybe I missed it, but I have the same question.
> 
> In <oe>/classes/base.bbclass I see:
> 
> BB_DEFAULT_TASK = "build"
> 
> at the top of the file.
> 
> There's no "def build()" or "def do_build()"
> There are the following lines - I don't know if they're related or not:
> 
> addtask build after do_populate_staging
> do_build = ""
> do_build[func] = "1"

These are very much related, it defines that there is a build task (with
an associated function which defaults to empty). It says this build task
depends on a "populate_staging" task.

> In <bitbake>/classes/base.bbclass I see:
> 
> addtask build
> do_build[dirs] = "${TOPDIR}"
> do_build[nostamp] = "1"
> python base_do_build () {
>         bb.note("The included, default BB base.bbclass does not define a useful default task.")
>         bb.note("Try running the 'listtasks' task against a .bb to see what tasks are defined.")
> }

Please ignore <bitbake>/classes/base.bbclass, they're examples in
bitbake and the files in OE take precedence.

> Maybe I'm thinking procedurally, and this is all declarative, but where
> the heck are the actual statements executed during a "build"?

Nothing is executed by "build" itself, the key is in the dependency on
"populate_staging".

> Back to Mark's point, how are the stages "fetch", "compile", "install"
> known to the system, and sequenced.  Are these hardcoded in bitbake?
> I'm guessing not, from the answer above and the structure of the
> "addtask <foo> before|after <bar>" statements.  But I can't find
> anywhere in the bbclass files where this is expressed.
> 
> Please help me understand this.

They're not hardcoded, the sequence is made through the definition of
tasks, each of which depend on each other. Very roughly:

build depends on populate_staging
populate_staging depends on package_write
package_write depends on package
package depends on install
install depends on compile
compile depends on configure
configure depends on patch
patch depends on unpack
unpack depends on fetch

This is all in base.bbclass, albeit rather difficult to isolate on its
own. Tasks like fetch, configure, compile etc. all have functions
associated with them and build is effectively a combination of all of
these.

Incidentally, don't be put off by the "do_" prefix, this is just to
highlight things as tasks when their usage might otherwise be
ambiguous. 

Does that make it clearer?

Regards,

Richard






More information about the Openembedded-devel mailing list