On Thu, 2026-04-30 at 09:39 +0100, Sam Kent wrote:
> BBLAYERS and BBPATH contain host-specific paths which contaminate the
> hash and result in unnecessary cache misses.
> 
> Exclude BBLAYERS and BBPATH from vardeps and instead enumerate the wic
> plugin .py files tracking them via file-checksums.
> 
> The hash now only changes when a plugin file is actually added, removed,
> or modified.
> 
> Fixes [YOCTO #15662]
> 
> Signed-off-by: Sam Kent <[email protected]>
> ---
>  meta/classes-recipe/image_types_wic.bbclass | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/meta/classes-recipe/image_types_wic.bbclass 
> b/meta/classes-recipe/image_types_wic.bbclass
> index ea8c1c9..e6f77e9 100644
> --- a/meta/classes-recipe/image_types_wic.bbclass
> +++ b/meta/classes-recipe/image_types_wic.bbclass
> @@ -68,6 +68,22 @@ def wks_checksums(files, search_path):
>              ret = ret + " " + found + ":True"
>      return ret
>  
> +def wic_plugin_checksums(bblayers, bbpath):
> +    entries = []
> +    seen = set()
> +    paths = (bblayers or "").split() + [p for p in (bbpath or "").split(":") 
> if p]
> +    for path in paths:
> +        if path in seen:
> +            continue
> +        seen.add(path)
> +        plugin_dir = os.path.join(path, "lib", "wic", "plugins")
> +        if os.path.isdir(plugin_dir):
> +            for root, dirs, files in os.walk(plugin_dir):
> +                dirs.sort()
> +                for f in sorted(files):
> +                    if f.endswith(".py"):
> +                        entries.append(os.path.join(root, f) + ":True")
> +    return " ".join(entries)

Re-implementing the wic plugin search logic here is likely to lead to
inconsistencies. For example, wic currently searches for plugins based
on BBLAYERS but not BBPATH, and it looks in both scripts/lib/wic/plugins
and lib/wic/plugins. Even if we align the two implementations now, it
will be very easy for them to drift apart again in the future.

Could we instead rely on wic to perform the plugin search? There is
currently a `wic list source-plugins` command, we could add a `wic list
imager-plugins` command or perhaps a `wic list plugins` command to list
all plugins. We could then call that here to get the list.

We should also move this to an event handler so that we don't
unnecessarily re-run this search whenever the bitbake data store is
updated. See image-postinst-intercepts.bbclass for an example of how to
do this.

Best regards,

-- 
Paul Barker

Attachment: signature.asc
Description: This is a digitally signed message part

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#236796): 
https://lists.openembedded.org/g/openembedded-core/message/236796
Mute This Topic: https://lists.openembedded.org/mt/119078158/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to