is it worth expanding sec 3.3.6, "Unpacking Code," in dev manual?
i am sorely tempted to expand that section in the dev manual as, in
my experience (from just this last week, in fact), a lot of people don't understand the rationale for setting S in a recipe, what it means, and *when* they need to set it. i would approach it this way.
first, emphasize that, in any recipe (let's stick with tarballs), S
must have the value of where the downloaded tarball will be untarred under WORKDIR. not where the developer *wants* it unloaded, but based on the actual directory structure of the tarball. so if the tarball has the internal structure of, say:
pkg-1.0/
pkg-1.0/... entire tarball contents ...
then S would clearly need to be set to match that. (it is curious how many people don't seem to grasp that -- that one must examine the downloaded content and set S to match that.)
i would then point to the default values used in bitbake.conf:
S = "${WORKDIR}/${BP}"
BP = "${BPN}-${PV}"and emphasize that, if these values are appropriate, then there is no need to set S, while adding that many recipes might set it anyway unnecessarily. a simple example using libxslt_1.1.34.bb (as long as i am not misreading this):
S = "${WORKDIR}/libxslt-${PV}"while it seems trivial to point this out, i think it's useful since, if beginners are trying to learn by RTFS and see the above, they may very well think, "hang on, i thought that was the default, why is it being set?" and conclude there must be more here than they understand and walk away confused.
i would next present an example that *does* require setting S;
here's libpcre2_10.34.bb:
S = "${WORKDIR}/pcre2-${PV}"so that drives home an instance where setting S is essential to match the directory structure of the tarball.
finally (and i actually used this example this week to explain S), i
would cover multiple recipe files in the same directory that are based off the same downloaded tarball, where one has to set S individually for each recipe file separately. the example i used was grub, where grub2.inc establishes the single SRC_URI:
SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gzwherein the default value of S is fine for the base recipe grub_2.04.bb, but is *not* for grub-efi_2.04.bb, which needs to set it explicitly to match the very same tarball structure:
S = "${WORKDIR}/grub-${PV}"i used this example earlier this week, and there was that moment of "AHA" when the person finally understood the proper usage of S.
finally (you hope), cover the case where the downloaded tarball has
no top-level directory structure where everything is dumped straight into WORKDIR, in which case one needs to:
S = ${WORKDIR}lots of examples of that, i can pick something simple.
is this too much for that section? is there a better place for it?
rday