Re: [bitbake-devel] [PATCH] bitbake-setup: preserve build config when init script is missing

Giancarlo Cicellyn Comneno <[email protected]>
Newsgroups org.openembedded.lists.bitbake-devel
Message-ID <CAK46CgSuNHHqd8Nm_9KTEiiad1+4LoQB9sJ-5v89uhzjCcP8Bg@mail.gmail.com>
Hi Alex,

Thanks for questioning this. This came from auditing the failure paths
in `bitbake-setup`, rather than from a reported OE-Core incident.

I went back and checked whether the scenario used by the test is
actually permitted by the setup/update model.

`checkout_layers()` updates configured git sources and selects the
repository providing the setup helpers based on the presence of
`scripts/oe-setup-build`. It then creates `oe-init-build-env-dir`
pointing at that repository, but there is no invariant or
configuration validation requiring that repository to also contain
`oe-init-build-env`.

For a configuration using `bb-layers` rather than `oe-template`,
`setup_bitbake_build()` does explicitly handle a missing
`oe-init-build-env`, so that state is already considered possible by
the code.

The problematic ordering is that on update an existing `build/conf` is
renamed and a new one is generated before that check happens. If the
updated source revision no longer provides `oe-init-build-env`, the
function logs the error and returns, leaving the regenerated
configuration in place; the caller then continues as though setup
succeeded.

The test removes `oe-init-build-env` from the next revision
specifically to reproduce that transition. I don't have evidence that
OE-Core itself has made such a transition, and I should have made that
clear in the commit message.

So the motivation is defensive handling of a supported source-update
failure path, not a failure I've observed in OE-Core.

If you consider the disappearance of `oe-init-build-env` outside the
supported contract despite the current handling for it, then I agree
the patch shouldn't be kept.

Giancarlo

On Wed, 19 Aug 2026 10:36:32 +0200, Alexander Kanavin
<[email protected]> wrote:
> On Wed, 19 Aug 2026 at 06:24, Giancarlo Cicellyn Comneno via
> lists.openembedded.org
> <[email protected]> wrote:
> > + os.remove(os.path.join(self.testrepopath, 'oe-init-build-env'))
>
> This seems like a contrived scenario, so I'd like to understand it
> better. What prompted you to ask AI to write a patch for it? How can
> this happen in actual usage?
>
> Alex
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.