On Wed, 2023-09-06 at 22:28 +0200, Alexander Kanavin wrote: > On Wed, 6 Sept 2023 at 22:13, Richard Purdie > <[email protected]> wrote: > > Firstly, that recipe was a bit of a hack. In bygone times, we had a > > shared sysroot and this was effectively creating it for the places we > > hadn't converted to use recipe specific sysroots. There should only be > > a small number of places it is used where we haven't found a better > > way. > > > > When you use it, the calling code first has to ensure the things it > > wants in the sysroots have been built. The caller is therefore expected > > to build the right set of dependencies. > > > > Putting ordering constraints into the recipe is going to make people > > think it all happens by magic. It doesn't and the caller has to be > > careful. > > > > I'm reluctant to add any dependencies when it should be clear the > > caller is entirely responsible for this. > > This commit was prompted by seeing these intermittent races with the > upgraded shadow: > > https://autobuilder.yoctoproject.org/typhoon/#/builders/146/builds/468/steps/12/logs/stdio > https://autobuilder.yoctoproject.org/typhoon/#/builders/147/builds/467/steps/12/logs/stdio > > What happens here is: > - target sysroot population relies on being able to run useradd > without errors. It will also skip the useradd execution if useradd is > not present. > - useradd comes from the native sysroot > - native sysroot is being populated at the same time as target sysroot > is because the build-sysroots recipe doesn't constrain that > - this can result in races where useradd executable is already there, > but the libraries it needs (libbsd, libattr, libmd) are not > > How would the caller ensure this doesn't happen? I think it's > reasonable to assume 'bitbake build-sysroots' should complete without > intermittent failures.
That test/calls were fairly recently added: https://git.yoctoproject.org/poky/commit/meta/lib/oeqa/selftest/cases/meta_ide.py?id=9b3fcb0d91648ae3b53ec8ffcb31fb6eac9209dd That test should probably call: bitbake("build-sysroots -c build_native_sysroot") bitbake("build-sysroots -c build_target_sysroot") om the setup case and then just call the target piece again in the specific test. We could drop the "before do_build" in the build-sysroots recipe. Note that the tasks are nostamp so they will always rerun. It does make sense to have a way to regenerate the target sysroot only but if you change it as you suggest, that becomes impossible. Cheers, Richard
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#187355): https://lists.openembedded.org/g/openembedded-core/message/187355 Mute This Topic: https://lists.openembedded.org/mt/101197363/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
