Bug 16451

Summary: containers: WARNING: Duplicate inclusion for defaultsetup.conf in bitbake.conf
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Mathieu Dubois-Briand <mathieu.dubois-briand>
Component: virtual machinesAssignee: Paul Barker <paul>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: bruce.ashfield, randy.macleod, tim.orling
Version: unspecified   
Target Milestone: 6.2 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Mathieu Dubois-Briand 2026-10-12 11:24:54 UTC
We have a new warning during container builds:

> WARNING: Duplicate inclusion for /srv/pokybuild/yocto-worker/containers-library/build/layers/openembedded-core/meta/conf/distro/defaultsetup.conf in /srv/pokybuild/yocto-worker/containers-library/build/layers/openembedded-core/meta/conf/bitbake.conf
> WARNING: Duplicate inclusion for /srv/pokybuild/yocto-worker/containers-library/build/layers/openembedded-core/meta/conf/distro/include/default-providers.inc in /srv/pokybuild/yocto-worker/containers-library/build/layers/openembedded-core/meta/conf/distro/defaultsetup.conf
> WARNING: Duplicate inclusion for /srv/pokybuild/yocto-worker/containers-library/build/layers/openembedded-core/meta/conf/distro/include/default-distrovars.inc in /srv/pokybuild/yocto-worker/containers-library/build/layers/openembedded-core/meta/conf/distro/defaultsetup.conf
> WARNING: Duplicate inclusion for /srv/pokybuild/yocto-worker/containers-library/build/layers/meta-yocto/meta-poky/conf/distro/include/maintainers.inc in /srv/pokybuild/yocto-worker/containers-library/build/layers/openembedded-core/meta/conf/distro/defaultsetup.conf
> WARNING: Duplicate inclusion for /srv/pokybuild/yocto-worker/containers-library/build/build/conf/distro/include/maintainers.inc in /srv/pokybuild/yocto-worker/containers-library/build/layers/openembedded-core/meta/conf/distro/defaultsetup.conf
> WARNING: Duplicate inclusion for /srv/pokybuild/yocto-worker/containers-library/build/layers/openembedded-core/meta/conf/distro/include/maintainers.inc in /srv/pokybuild/yocto-worker/containers-library/build/layers/openembedded-core/meta/conf/distro/defaultsetup.conf
> ...
Comment 1 Mathieu Dubois-Briand 2026-10-12 11:25:55 UTC
containers-library alma8-vk-1 master completed at 2026-10-11 04:53:50+00:00
https://autobuilder.yoctoproject.org/valkyrie/#/builders/117/builds/44/steps/15/logs/stdio

vcontainer-tarball debian12-vk-9 master completed at 2026-10-11 01:59:35+00:00
https://autobuilder.yoctoproject.org/valkyrie/#/builders/116/builds/18/steps/14/logs/stdio
Comment 2 Mathieu Dubois-Briand 2026-10-14 11:08:44 UTC
containers-library debian13-vk-2 master completed at 2026-10-14 04:49:40+00:00
https://autobuilder.yoctoproject.org/valkyrie/#/builders/117/builds/45/steps/14/logs/stdio

vcontainer-tarball fedora44-vk-3 master completed at 2026-10-14 01:46:25+00:00
https://autobuilder.yoctoproject.org/valkyrie/#/builders/116/builds/19/steps/14/logs/stdio
Comment 3 Randy MacLeod 2026-10-15 14:52:31 UTC
Bruce, Tim, 
Did anything change in meta-virt or Tim's containers to cause these new warnings?
Comment 5 Tim Orling 2026-10-18 23:34:07 UTC
This shows up in every update run on layerindex as well.
Comment 6 Tim Orling 2026-10-18 23:38:15 UTC
The layerindex is different and related to BBPATH, whereas meta-virtualization is related to the require.
Comment 7 Tim Orling 2026-10-18 23:43:39 UTC
There are two separate causes behind the "Duplicate inclusion" warnings.

1. Container builds (the warnings in the description)

Since meta-virtualization commit 86703e65 ("vruntime-base: base on
oe-core defaultsetup instead of poky.conf"),
conf/distro/include/vruntime-base.inc does:

  require conf/distro/defaultsetup.conf

But oe-core's bitbake.conf already includes it straight after the
distro configuration, for every distro:

  meta/conf/bitbake.conf:
    832: include conf/distro/${DISTRO}.conf
    833: include conf/distro/defaultsetup.conf

So for the vruntime/vcontainer distros defaultsetup.conf is parsed twice,
and with it everything it includes (default-providers.inc,
default-distrovars.inc, maintainers.inc, tcmode/tclibc, ...), which is
exactly the list of warnings above.

Suggested fix in meta-virtualization: drop the require. bitbake.conf
supplies defaultsetup.conf after the distro conf anyway, which is how
poky.conf works, and since defaultsetup.conf mostly uses ?= the values
pinned in vruntime-base.inc (PACKAGE_CLASSES, the kernel version) still
take precedence. tests/test_vcontainer_distro.py currently asserts the
require, so it would need adjusting too.

2. Layer index update runs (comment 5)

The layer index only warns about maintainers.inc:

  WARNING: Duplicate inclusion for .../meta/conf/distro/include/maintainers.inc
  in .../meta/conf/distro/defaultsetup.conf

That one is different: defaultsetup.conf uses "include_all" for
maintainers.inc, which includes the file from every BBPATH directory,
and the layer index ends up with the core layer in BBPATH twice (once
from its initial BBPATH, once from the core layer's layer.conf). BitBake
doesn't skip repeated BBPATH entries in include_all, so the same file is
included twice.

I have a BitBake patch that makes include_all search each BBPATH
directory only once, with a selftest; I'll send it to bitbake-devel.
That fixes the layer index case but not the container case above.
Comment 8 Tim Orling 2026-10-19 02:09:41 UTC
For the include_all case:
https://lore.kernel.org/bitbake-devel/20261019020422.14365-1-tim.orling@konsulko.com/
Comment 9 Tim Orling 2026-10-19 02:12:20 UTC
An example layerindex update run with the warnings:
https://layers.moto-timo.net/layerindex/updates/47280/
Comment 10 Bruce Ashfield 2026-10-19 02:36:31 UTC
Pushed to meta-virtualization master as 7b015441 ("vruntime-base: don't require defaultsetup.conf, let bitbake.conf supply it").

It drops the redundant "require conf/distro/defaultsetup.conf" from vruntime-base.inc. bitbake.conf already includes defaultsetup.conf immediately after conf/distro/${DISTRO}.conf for every distro, so for the vruntime/vcontainer distros it was being parsed twice -- that is the source of the container-build warnings in comment 0 (including the maintainers.inc duplicates, which were a side effect of defaultsetup's include_all running twice).
Comment 11 Mathieu Dubois-Briand 2026-10-19 07:36:05 UTC
containers-library opensuse160-vk-2 master completed at 2026-10-18 04:51:46+00:00
https://autobuilder.yoctoproject.org/valkyrie/#/builders/117/builds/46/steps/14/logs/stdio

vcontainer-tarball debian12-vk-6 master completed at 2026-10-18 01:57:53+00:00
https://autobuilder.yoctoproject.org/valkyrie/#/builders/116/builds/20/steps/14/logs/stdio
Comment 12 Paul Barker 2026-10-19 07:41:41 UTC
This should now be fixed by https://git.yoctoproject.org/meta-virtualization/commit/?id=7b0154418de3350fd23a0bd868742f2b570b24d3. I'll close this and we can reopen if the issue reoccurs.