Bug 15987 - Fragment enable/disable is confusing and can cause user error
Summary: Fragment enable/disable is confusing and can cause user error
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 0.0.0
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 5.3 M4
Assignee: Alexander Kanavin
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2025-10-02 11:34 UTC by Richard Purdie
Modified: 2025-10-10 15:36 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Yes (doc changes required)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Purdie 2025-10-02 11:34:54 UTC
Imagine running:

build-config-setup enable-fragment machine/qemuarm
build-config-setup enable-fragment machine/qemux86
build-config-setup enable-fragment machine/qemuarm

The enabled machine is still qemux86 despite the user thinking it might now be qemuarm.

I can understand why this happens but it is confusing for the user and there is no error code set for "fragment already enabled". Perhaps it should be moved to be last?

I think we may want some kind of option to remove all other machine/* options or allow the machine/ fragment to be changed.

Futher "proof"/debug output

$ bitbake-getvar MACHINE

NOTE: Starting bitbake server...
#
# $MACHINE [4 operations]
#   set /media/build/poky/build/conf/local.conf:38
#     [_defaultval] "qemux86-64"
#   set ast.py:367 [check_and_set_builtin_fragment]
#     "qemuarm"
#   set ast.py:367 [check_and_set_builtin_fragment]
#     "qemux86"
#   set /media/build/poky/meta/conf/documentation.conf:274
#     [doc] "Specifies the target device for which the image is built. You define MACHINE in the conf/local.conf file in the Build Directory."
# pre-expansion value:
#   "qemux86"
MACHINE="qemux86"


$ cat conf/auto.conf 

OE_FRAGMENTS += "core/yocto-autobuilder/autobuilder machine/qemuarm machine/qemux86"

$ bitbake-config-build enable-fragment machine/qemuarm

NOTE: Starting bitbake server...
Fragment machine/qemuarm already included in /media/build/poky/build/conf/auto.conf
richard@max:/media/build/poky/build$ bitbake-getvar MACHINE
NOTE: Starting bitbake server...
#
# $MACHINE [4 operations]
#   set /media/build/poky/build/conf/local.conf:38
#     [_defaultval] "qemux86-64"
#   set ast.py:367 [check_and_set_builtin_fragment]
#     "qemuarm"
#   set ast.py:367 [check_and_set_builtin_fragment]
#     "qemux86"
#   set /media/build/poky/meta/conf/documentation.conf:274
#     [doc] "Specifies the target device for which the image is built. You define MACHINE in the conf/local.conf file in the Build Directory."
# pre-expansion value:
#   "qemux86"
MACHINE="qemux86"
Comment 1 Alexander Kanavin 2025-10-02 16:24:49 UTC
Patch: https://lists.openembedded.org/g/openembedded-core/message/224372