Skip to contentSkip to conversation

should docs explain unversioned recipe files and unversioned append files?

DISCUSSION Robert P. J. Day 2 participants 4 messages Jan 7 – Jan 28

lore
Share & tools
lore
#0 lore raw

one more pedantic observation about append files and corresponding
recipe files. occasionally, one runs across an unversioned recipe file for which some other layer has an unversioned bbappend file, one example being the "mesa" recipe:

$ find . -name "mesa.bb*"
./meta-raspberrypi/recipes-graphics/mesa/mesa.bbappend
./meta-freescale/recipes-graphics/mesa/mesa.bbappend
./openembedded-core/meta/recipes-graphics/mesa/mesa.bb
$

so what is the rule here? if a recipe file is unversioned, then the
append file for it must also be unversioned to match? what if the mesa recipe were suddenly to become versioned? would that append file still be applied? the docs don't seem to cover this possibility.

rday

#1 lore raw

Hi Robert,

Quoted 12 lines · Robert P. J. Day via lists.yoctoproject.org

one more pedantic observation about append files and corresponding
recipe files. occasionally, one runs across an unversioned recipe file for which some other layer has an unversioned bbappend file, one example being the "mesa" recipe:

$ find . -name "mesa.bb*"
./meta-raspberrypi/recipes-graphics/mesa/mesa.bbappend
./meta-freescale/recipes-graphics/mesa/mesa.bbappend
./openembedded-core/meta/recipes-graphics/mesa/mesa.bb
$
Quoted 5 lines

so what is the rule here? if a recipe file is unversioned, then the
append file for it must also be unversioned to match? what if the mesa recipe were suddenly to become versioned? would that append file still be applied? the docs don't seem to cover this possibility.

Can you try and report to us?

- does mesa_%.bbappend apply to mesa.bb
- does mesa.bbappend apply to mesa_git.bb

Considering mesa.bbappend applies to mesa.bb, we should update https://docs.yoctoproject.org/dev-manual/layers.html#appending-other-layers-metadata-with-your-layer to mention that recipes without a version in their name can also have their own bbappend following the same naming scheme.

I know that u-boot%.bappend also applies to multiple u-boot recipes, see https://git.yoctoproject.org/meta-rockchip/commit/?id=ebfc42663d52f2247b7de5d6267b353887cc2d91.

It'd be nice to check (and document) whether mesa%.bbappend applies to mesa-foo.bb, mesa-foo_git.bb.

Cheers,
Quentin

#2 lore raw
Quoted 31 lines · Quentin Schulz

Hi Robert,

Quoted 12 lines · Robert P. J. Day via lists.yoctoproject.org

one more pedantic observation about append files and corresponding
recipe files. occasionally, one runs across an unversioned recipe file for which some other layer has an unversioned bbappend file, one example being the "mesa" recipe:

$ find . -name "mesa.bb*"
./meta-raspberrypi/recipes-graphics/mesa/mesa.bbappend
./meta-freescale/recipes-graphics/mesa/mesa.bbappend
./openembedded-core/meta/recipes-graphics/mesa/mesa.bb
$
Quoted 5 lines

so what is the rule here? if a recipe file is unversioned, then the
append file for it must also be unversioned to match? what if the mesa recipe were suddenly to become versioned? would that append file still be applied? the docs don't seem to cover this possibility.

Can you try and report to us?

- does mesa_%.bbappend apply to mesa.bb
- does mesa.bbappend apply to mesa_git.bb

Considering mesa.bbappend applies to mesa.bb, we should update
https://docs.yoctoproject.org/dev-manual/layers.html#appending-other-layers-metadata-with-your-layer
to mention that recipes without a version in their name can also have their own bbappend following the same naming scheme.

Quoted 5 lines

I know that u-boot%.bappend also applies to multiple u-boot recipes, see
https://git.yoctoproject.org/meta-rockchip/commit/?id=ebfc42663d52f2247b7de5d6267b353887cc2d91.

It'd be nice to check (and document) whether mesa%.bbappend applies to mesa-foo.bb, mesa-foo_git.bb.

i'll find some time this weekend to test the above, but is it
reasonable to ask how this feature *should* behave with unversioned recipe and bbappend files?

rday

#3 lore raw

Hi Robert,

Quoted 23 lines · Robert P. J. Day via lists.yoctoproject.org
Quoted 21 lines · Quentin Schulz

Hi Robert,

Quoted 17 lines · Robert P. J. Day via lists.yoctoproject.org

one more pedantic observation about append files and corresponding
recipe files. occasionally, one runs across an unversioned recipe file for which some other layer has an unversioned bbappend file, one example being the "mesa" recipe:

$ find . -name "mesa.bb*"
./meta-raspberrypi/recipes-graphics/mesa/mesa.bbappend
./meta-freescale/recipes-graphics/mesa/mesa.bbappend
./openembedded-core/meta/recipes-graphics/mesa/mesa.bb
$

so what is the rule here? if a recipe file is unversioned, then the
append file for it must also be unversioned to match? what if the mesa recipe were suddenly to become versioned? would that append file still be applied? the docs don't seem to cover this possibility.

Quoted 5 lines
Quoted 5 lines

Can you try and report to us?

- does mesa_%.bbappend apply to mesa.bb
- does mesa.bbappend apply to mesa_git.bb

No to both.

Quoted 8 lines
Quoted 8 lines

Considering mesa.bbappend applies to mesa.bb, we should update
https://docs.yoctoproject.org/dev-manual/layers.html#appending-other-layers-metadata-with-your-layer
to mention that recipes without a version in their name can also have their own bbappend following the same naming scheme.

I know that u-boot%.bappend also applies to multiple u-boot recipes, see
https://git.yoctoproject.org/meta-rockchip/commit/?id=ebfc42663d52f2247b7de5d6267b353887cc2d91.

Quoted 7 lines
Quoted 2 lines

It'd be nice to check (and document) whether mesa%.bbappend applies to mesa-foo.bb, mesa-foo_git.bb.

i'll find some time this weekend to test the above, but is it
reasonable to ask how this feature *should* behave with unversioned recipe and bbappend files?

Well, one needs to read the code to know how it should behave :) I didn't know so I went checking.

lib/bb/cooker.py in bitbake is where the magic happens, specifically in the get_file_appends() method.

def get_file_appends(self, fn):
"""
Returns a list of .bbappend files to apply to fn """
filelist = []
f = os.path.basename(fn)
for b in self.bbappends:
(bbappend, filename) = b
if (bbappend == f) or ('%' in bbappend and
bbappend.startswith(f[:bbappend.index('%')])):
filelist.append(filename)
return tuple(filelist)

Either an exact match (bbappend == f) or a partial match with everything before the % character. Note that bbappend is actually the bbappend filename *without* "append" at the end, so e.g. mesa.bbappend ends up being bbappend = mesa.bb and filename = /path/to/mesa.bbappend.

Pretty simple actually, so I'll get going and add that to the BitBake docs somewhere :)

Cheers,
Quentin