Skip to contentSkip to conversation

significance of leading slash in BBMASK examples?

DISCUSSION Robert P. J. Day 2 participants 2 messages Dec 18, 2025 – Jan 12

lore
Share & tools
lore
#0 lore raw

here:

https://docs.yoctoproject.org/ref-manual/variables.html#term-BBMASK

the first sample usage of BBMASK does not include a leading slash:

BBMASK = "meta-ti/recipes-misc/"

while the next few examples do:

BBMASK += "/meta-ti/recipes-misc/ meta-ti/recipes-ti/packagegroup/" BBMASK += "/meta-oe/recipes-support/"
BBMASK += "/meta-foo/.*/openldap"

that section doesn't really clarify whether that leading slash is significant.

rday

#1 lore raw

Hi Robert,

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

here:

https://docs.yoctoproject.org/ref-manual/variables.html#term-BBMASK

the first sample usage of BBMASK does not include a leading slash:

BBMASK = "meta-ti/recipes-misc/"

Quoted 9 lines

while the next few examples do:

   BBMASK += "/meta-ti/recipes-misc/ meta-ti/recipes-ti/packagegroup/"
   BBMASK += "/meta-oe/recipes-support/"
   BBMASK += "/meta-foo/.*/openldap"

that section doesn't really clarify whether that leading slash is significant.

Looking at the code (starting here https://git.openembedded.org/bitbake/tree/lib/bb/cooker.py#n1893), it *is*, but to a different extent that you were probably thinking.

These paths are passed to the Python re engine, compiled into one big RE (with | between them) and then .search() is called on the big RE.

Then BitBake reads into BBFILES (which is a list of absolute glob paths) and keeps a list of all files matching any of the absolute glob paths to use.

For each file in the list, the big RE is run against its filepath. If it matches, it's skipped.

Now, imagine two layers meta-my-meta-ti and meta-ti both with a recipes-misc. If I don't put the leading slash in BBMASK, then recipes-misc in meta-my-meta-ti will be masked whereas if I add the leading slash as in the example, then only meta-ti's will be masked. That wouldn't get rid of the case of meta-my/meta-ti still matching though. I'm wondering if we shouldn't be using ${LAYERDIR} in most cases like for BBFILES? How many meta-bsp will we find in the wild for example :)

This is only from reading the code, so maybe I got it wrong. Should probably create a small example to verify all the above claims.

Cheers,
Quentin