Re: [OE-core] [PATCH v9 4/5] wic: move canned *wks files

Richard Purdie
2026-04-04T07:27:21Z

On Fri, 2026-04-03 at 18:23 -0400, Trevor Woerner wrote:
> On Fri 2026-04-03 @ 10:13:00 PM, Richard Purdie wrote:
> > On Fri, 2026-04-03 at 14:35 -0400, Trevor Woerner via lists.openembedded.org wrote:
> > > When "wic create ..." is invoked with a bare *wks name (i.e. without the
> > > `.wks` extension), wic calls engine.py:find_canned_images() to find the
> > > fully qualified *wks file. This function searches every directory formed by:
> > >     - permutating all BBLAYERS with `/wic`
> > >     - permutating all BBLAYERS with `/scripts/lib/wic/canned-wks`
> > >     - checking `<scripts_path>/lib/wic/canned-wks`
> > > Where `<scripts_path>` is the directory containing the wic program.
> >
> > It doesn't. I just looked at the code and it uses BBPATH. That can be
> > similar to BBLAYERS but it is different and the commit messages really
> > should refer to BBPATH.
>
> In the oe-selftest wic tests, most of the "wic create ..." commands
> are called with bare *wks files (i.e. *wks files without the `.wks`
> extension). When this happens, as "wic create..." is called, it starts
> by running the code found here:
>
> https://git.openembedded.org/openembedded-core/tree/scripts/wic#n206
>
> which calls:
>
> https://git.openembedded.org/openembedded-core/tree/scripts/lib/wic/engine.py#n46
>
> which follows the algorithm that I have described above.
>
> So for the oe-selftests to pass I wanted to move them.

You are right, it is using BBLAYERS. This is very confusing since the
wks files are using BBPATH, which is similar but subtly different.

Is there any reason it can't use BBPATH to match?

I agree the files need to move but I'd like them to end up in
meta/files/wic, not meta/wic. Whilst it complicates the migration a
little, I think it would be best to move them once and get them into
the right place.

The questions are then firstly, how to do that simply, then secondly,
how to clean up the rest of this (and when to do that).

Adding files/wic into the search path is trivial. Deprecating the
existing search paths with appropriate warnings is a bit trickier and
there is the question of when we should do that, before or after the
current release. "after" would seem more obvious, but it will mean two
different behaviours before and after release and with a standalone
tool, this does become harder.

> > I don't understand why these need to move given WKS_SEARCH_PATH remains
> > unchanged, unless wic is going to ignore WKS_SEARCH_PATH going forward?
>
> As an independent tool, these *wks files are rather oe-core-specific,
> so I thought they should stay with the oe-core/meta layer, the same way
> that, say, raspberry pi-specific *wks files stay in the raspberry pi
> layer.
>
> My first thought was to remove them from the standalone wic repository
> altogether, but then decided I could keep them as examples.
>
> I thought it would be dangerous to leave them in the wic source
> tree where the above algorithm could find them. If I leave them in
> src/wic/canned-wks, someone uses the tool and creates a *wks file with a
> similar name to one of the canned-wks files, but they have a typo and
> the canned one gets used instead of theirs...
>
> ...maybe I'm overthinking it?

It is definitely dangerous to leave them in the search paths so I agree
with that. The files do belong in OE-Core too. It is still a little
dangerous having files lying around which have the same names as the
ones in core since this kind of duplication still can confuse people
when they edit the wrong file. We have bigger issues I guess but some
renaming of the examples might help.

Cheers,

Richard