[bitbake-devel] DEPENDS vs RDEPENDS from bitbake PoV
Masahiro Yamada
masahiroy at kernel.org
Wed Dec 25 07:33:07 UTC 2019
Hi,
I think "the difference between DEPENDS and RDEPENDS"
is FAQ, but there is still something unclear to me.
I read the bitbake manual,
asked Google about this question,
and found lots of Q&A there, but
I could not find any answer that satisfied me.
Of course, I am not looking for the boilerplate answer
like "DEPENDS is build-time dependency,
whereas RDEPENDS is run-time dependency."
To clarify my question,
I'd like to know how DEPENDS and RDEPENDS
behave differently in the following sample code
if there is any difference.
Sample code
-----------
[base.bbclass]
addtask build
do_build[nostamp] = "1"
[bar.bb]
PN = 'bar'
python do_build() {
import time
bb.plain("bar.do_build START")
time.sleep(5)
bb.plain("bar.do_build END")
}
[foo.bb]
PN = 'foo'
python do_build() {
bb.plain("foo.do_build");
}
DEPENDS = "bar"
do_build[deptask] = "do_build"
Result
------
Running "bitbake foo" displays
the following in the terminal.
bar.do_build START
bar.do_build END
foo.do_build
So, foo.do_build starts after bar.do_build has completed.
If I replace the last twos lines in foo.bb:
DEPENDS = "bar"
do_build[deptask] = "do_build"
... with:
RDEPENDS = "bar"
do_build[rdeptask] = "do_build"
the result is the same.
foo.do_build still starts after bar.do_build has completed.
So, DEPENDS and RDEPENDS are fundamentally the same
from the bitbake point of view.
Is my understanding correct?
I know there is slight difference between them.
For the RDEPENDS variant, the form RDEPENDS_<pkg> is also supported.
(<pkg> is the element in ${PACKAGES}, or ${PN} if ${PACKAGES} is empty).
Other than that, the functionality looks the same between
DEPENDS and RDEPENDS.
--
Best Regards
Masahiro Yamada
More information about the bitbake-devel
mailing list