To follow this up, if there are indeed multiple providers, they are excluded even earlier in base.bbclass:
=====
            provs = (d.getVar("PROVIDES") or "").split()
            multiwhitelist = (d.getVar("MULTI_PROVIDER_WHITELIST") or "").split()
            for p in provs:
                if p.startswith("virtual/") and p not in multiwhitelist:
                    profprov = d.getVar("PREFERRED_PROVIDER_" + p)
                    if profprov and pn != profprov:
                        raise bb.parse.SkipRecipe("PREFERRED_PROVIDER_%s set to %s, not %s" % (p, profprov, pn))
=====

So the bitbake code only excludes the sole remaining option from world, which makes even less sense.

Alex

On Tue, 4 Jan 2022 at 08:43, Alexander Kanavin via lists.openembedded.org <alex.kanavin=gmail.com@lists.openembedded.org> wrote:
On Mon, 3 Jan 2022 at 23:38, Richard Purdie <richard.purdie@linuxfoundation.org> wrote:
The principle is that virtual/XXX should only be built if something actually
depends upon them as they're usually used to denote things which can be provided
from multiple sources.

I'm not sure I follow. The 'world' set is aiming to have the fullest amount of target items in it. If there are items which have the same 'virtual/x' provides in their recipes, why should the recipes be all excluded from the set?  They're not going to clash in package deploy, or in sysroots (since sysroots became recipe-specific). Note that it's not 'virtual/x' being excluded, but the parent recipes themselves.
 
I'd argue that the code is correct and wonder whether:

a) go-runtime should be providing a virtual
b) that OE-Core should have something depending on go-runtime for test purposes
 
go-runtime is how I spotted the issue, but there are actually a fair bit more items with the same problem, some of them major.

DEBUG: collating packages for "world"
DEBUG: World build skipping /home/alex/development/poky/meta/recipes-graphics/libsdl2/libsdl2_2.0.18.bb due to virtual/libsdl2 provider starting with virtual/
DEBUG: World build skipping /home/alex/development/poky/meta/recipes-devtools/make/make_4.3.bb due to virtual/make provider starting with virtual/
DEBUG: World build skipping /home/alex/development/poky/meta/recipes-extended/libtirpc/libtirpc_1.3.2.bb due to virtual/librpc provider starting with virtual/
DEBUG: World build skipping /home/alex/development/poky/meta/recipes-devtools/go/go-runtime_1.17.5.bb due to virtual/x86_64-poky-linux-go-runtime provider starting with virtual/
DEBUG: World build skipping /home/alex/development/poky/meta/recipes-core/libxcrypt/libxcrypt_4.4.26.bb due to virtual/crypt provider starting with virtual/
DEBUG: World build skipping /home/alex/development/poky/meta/recipes-graphics/xorg-xserver/xserver-xorg_21.1.1.bb due to virtual/xserver-xf86 provider starting with virtual/
DEBUG: World build skipping /home/alex/development/poky/meta/recipes-kernel/linux/linux-yocto_5.10.bb due to virtual/kernel provider starting with virtual/
DEBUG: World build skipping /home/alex/development/poky/meta/recipes-sato/rxvt-unicode/rxvt-unicode_9.30.bb due to virtual/x-terminal-emulator provider starting with virtual/
DEBUG: World build skipping /home/alex/development/poky/meta/recipes-core/gettext/gettext_0.21.bb due to virtual/libintl provider starting with virtual/
DEBUG: World build skipping /home/alex/development/poky/meta/recipes-core/glibc/glibc-locale_2.34.bb due to virtual/libc-locale provider starting with virtual/
DEBUG: World build skipping /home/alex/development/poky/meta/recipes-multimedia/libomxil/libomxil_0.9.3.bb due to virtual/libomxil provider starting with virtual/
DEBUG: World build skipping /home/alex/development/poky/meta/recipes-devtools/gcc/libgcc-initial_11.2.bb as task do_build doesn't exist
DEBUG: World build skipping /home/alex/development/poky/meta/recipes-core/glibc/glibc_2.34.bb due to virtual/libc provider starting with virtual/
DEBUG: World build skipping /home/alex/development/poky/meta/recipes-kernel/perf/perf.bb due to virtual/perf provider starting with virtual/
DEBUG: World build skipping /home/alex/development/poky/meta/recipes-bsp/u-boot/u-boot_2021.10.bb due to virtual/bootloader provider starting with virtual/
DEBUG: World build skipping /home/alex/development/poky/meta/recipes-graphics/mesa/mesa_21.3.1.bb due to virtual/libgl provider starting with virtual/
DEBUG: World build skipping /home/alex/development/poky/meta/recipes-kernel/linux/linux-yocto_5.15.bb due to virtual/kernel provider starting with virtual/
DEBUG: World build skipping /home/alex/development/poky/meta/recipes-devtools/dpkg/dpkg_1.21.1.bb due to virtual/update-alternatives provider starting with virtual/
DEBUG: World build skipping /home/alex/development/poky/meta/recipes-graphics/xorg-lib/libx11_1.7.3.1.bb due to virtual/libx11 provider starting with virtual/
DEBUG: World build skipping /home/alex/development/poky/meta/recipes-kernel/linux/linux-yocto_5.14.bb due to virtual/kernel provider starting with virtual/
DEBUG: World build skipping /home/alex/development/poky/meta/recipes-devtools/opkg-utils/opkg-utils_0.5.0.bb due to virtual/update-alternatives provider starting with virtual/
DEBUG: World build skipping /home/alex/development/poky/meta/recipes-devtools/gcc/gcc-runtime_11.2.bb due to virtual/x86_64-poky-linux-compilerlibs provider starting with virtual/
DEBUG: World build skipping /home/alex/development/poky/meta/recipes-devtools/pseudo/pseudo_git.bb due to virtual/fakeroot provider starting with virtual/

Alex

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#13215): https://lists.openembedded.org/g/bitbake-devel/message/13215
Mute This Topic: https://lists.openembedded.org/mt/88071309/1686489
Group Owner: bitbake-devel+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [alex.kanavin@gmail.com]
-=-=-=-=-=-=-=-=-=-=-=-