I am having trouble understanding the bitbake recipes. (I have some poorly written I need to modify, I usually would read and understand the whole mechanism but sadly I am on a tight schedule). Can you please help me understand the difference between RDEPENDS and DEPENDS. I read the reference and I know that they stand for runtime dependency and build dependency respectively, but what is the effect on it in a bitbake recipe? As far as I understand, if a package A depends on another B, B has to be built and ready to enable A to build. Bitbake isn't related to the runtime, it's only there for building and deploying the packages. So what is the difference?
1 Answers
As you say, bitbake is concerned with building and deploying the packages, and it needs to deploy all the packages that are needed to satisfy runtime dependencies on the target system.
If your recipe says that target T DEPENDS
on a target P, that tells
bitbake that it must build P before T, because T can't be
built without P.
If your recipe says that T RDEPENDS
on P, that tells
bitbake that it must deploy P to the target system if it
deploys T, because T can't be used without P.
For example, you can't build tar
without the C compiler, but
you don't need the C compiler to use tar
. You can deploy tar
without deploying the C compiler. So that's a DEPEND
.
On the other hand, you can't use tar
without the runtime C library.
If tar
is deployed, the runtime C library must also be deployed.
So that's an RDEPEND
.
The bitake technicalities are:
If T
DEPENDS
on P then T'sdo_configure
task is made to depend on P'sdo_populate_sysroot
task.If T
RDEPENDS
on P then T'sdo_build
task ia made to depend on P'sdo_package_write
task.

- 55,740
- 12
- 153
- 182
-
1Thank you sir! It's clear to me now. About the technicalities you mentioned: Is there a defined order of how a recipe calls those tasks? Are those tasks (do_configure, do_build etc) part of bitbake standard? – lulijeta Jun 15 '15 at 15:44
-
1Yes, there is a defined order which is, of course, the right order - although it is possible for you to override or extend any pre-defined behaviour if you want, or to define tasks of your own and insert them in between the predefined ones. See [From Bitbake Hello World to an Image](http://hambedded.org/blog/2012/11/24/from-bitbake-hello-world-to-an-image/) – Mike Kinghan Jun 15 '15 at 19:01
-
Excellent Answer – Vishnu N K Feb 07 '18 at 06:44
-
This is the best answer I have come across so far! – SH' Jun 16 '19 at 18:32