Yocto, deploy.bbclass and dependencies

I noticed that the Yocto recipes of a few colleagues inherit a
bbclass named 'deploy.bbclass'.

This feature has ramification in a few variables[1][2], but I couldn't really
grasp the point of it without a query on the #yocto IRC channel.
After asking, I understood what follows, although I still have to verify
personally how things work.


Notes on the discussion:

1. A dependency Y -> X (Y depends on X) will ensure that the sysroot of Y
  will be populated with the artefacts installed (do_install) by the
  recipe X.

2. The sysroot is meant for things that should appear on the filesystem in
  the linux userspace.  This is not the case for the kernel, or u-boot
  (quoting qshultz)

3. There's no guarrantee that the files of X would be deployed by the
  time do_configure starts in Y (quoting vm1).
  DEPENDS doesn't give warranty binaries are deployed (confirmed by qshultz)

4. If deployed artifacts from X are needed in Y's do_compile, a dependency
  can be specified in a way that looks like this (quoting qshultz, not
  verified):

    do_compile[depends] += "do_deploy:recipeX"

Example: trusted firmware needed for compiling u-boot, not meaningful in the
sysroot.


[1] https://docs.yoctoproject.org/ref-manual/variables.html#term-DEPLOYDIR
[2] https://docs.yoctoproject.org/ref-manual/variables.html#term-DEPLOY_DIR_IMAGE