bitbake-devel.lists.openembedded.org archive mirror
 help / color / mirror / Atom feed
* how bitbake works
@ 2021-07-17  2:55 Mayank Agarwal
  2021-07-17 19:57 ` [bitbake-devel] " Chuck Wolber
  0 siblings, 1 reply; 2+ messages in thread
From: Mayank Agarwal @ 2021-07-17  2:55 UTC (permalink / raw)
  To: bitbake-devel

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

Hi,

I am new to yocto.I have following doubts.

a) How bitbake decides the order of  compiling and executing modules.
b) Is it possible to compile 1 module before or after another one
c) Is there any file where we can see the complete list of all tasks that
bitbake executes in the order of execution.
d) How can we use logging mechanism in bitbake.Is it possible to put log
statements in recipe files and see the logs on terminal
during compilation and execution.
e) Optmization of bitbake steps.Is there any guide that tells how can we
optimize.For me 1 module takes close to 3 hrs in executing
Is there any method that i can reduce build time by pre compiling that
module.


Best Regards
Mayank

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

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

* Re: [bitbake-devel] how bitbake works
  2021-07-17  2:55 how bitbake works Mayank Agarwal
@ 2021-07-17 19:57 ` Chuck Wolber
  0 siblings, 0 replies; 2+ messages in thread
From: Chuck Wolber @ 2021-07-17 19:57 UTC (permalink / raw)
  To: Mayank Agarwal; +Cc: bitbake-devel

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

On Sat, Jul 17, 2021 at 2:12 AM Mayank Agarwal <mayank77fromindia@gmail.com>
wrote:

>
> a) How bitbake decides the order of  compiling and executing modules.
>

You generally build images. Images have dependencies. If you map out the
dependencies as a big giant graph, the dependencies with no child nodes get
built first. The build continues from there as all dependencies are met and
then the core image can be assembled.

There are also some intrinsic dependencies like the sysroot compiler, etc
that always have to be built first. Bitbake caches dependencies and reuses
them in subsequent builds if it does not detect any changes to them.


> b) Is it possible to compile 1 module before or after another one
>

Think of it in terms of dependencies. If A depends on B, then B gets built
first. You would use the DEPENDS (build time dependency) and the
RDEPDENDS_${PN} (runtime dependencies) variables for this.



> c) Is there any file where we can see the complete list of all tasks that
> bitbake executes in the order of execution.
>

Yes, you can generate a graph of the entire execution with the --graphviz
argument, e.g. "bitbake core-image-sato --graphviz". This generates a build
graph document in the build directory.



> d) How can we use logging mechanism in bitbake.Is it possible to put log
> statements in recipe files and see the logs on terminal during compilation
> and execution.
>

Yes, but that is out of scope for a quick email reply like this.

You should read the manuals at https://docs.yoctoproject.org. They are a
very rich source of information. The more you read them, the smarter your
questions will get, and the more likely you are to get help when you
experience complex problems.

You might also want to take a look at the FAQ (
https://wiki.yoctoproject.org/wiki/FAQ) and the Technical FAQ (
https://wiki.yoctoproject.org/wiki/Technical_FAQ).


e) Optmization of bitbake steps.Is there any guide that tells how can we
> optimize.For me 1 module takes close to 3 hrs in executing
> Is there any method that i can reduce build time by pre compiling that
> module.
>

Faster hardware? It really depends on the specifics of what you are
building. There is no magic formula.

I have one build that takes 28 hours on a 2 core machine. It builds in 2-3
hours now on a 20 Core machine. My developers only require a subset of that
build so they can cache an initial build on their 4 core laptops in about 8
hours. There is also an option to use shared cache if that works for your
particular situation.

Also, I normally dedicate about 2.5 gigs of RAM per core to avoid crashes
due to RAM starvation. Otherwise you may experience random "difficult to
explain" build crashes.

..Ch:W..

-- 
*"Perfection must be reached by degrees; she requires the slow hand of
time." - Voltaire*

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

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

end of thread, other threads:[~2021-07-17 19:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-17  2:55 how bitbake works Mayank Agarwal
2021-07-17 19:57 ` [bitbake-devel] " Chuck Wolber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).