<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>15987</bug_id>
          
          <creation_ts>2025-10-02 11:34:54 +0000</creation_ts>
          <short_desc>Fragment enable/disable is confusing and can cause user error</short_desc>
          <delta_ts>2025-10-10 15:36:12 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>0.0.0</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>5.3 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Richard Purdie">richard.purdie</reporter>
          <assigned_to name="Alexander Kanavin">alex.kanavin</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Yes (doc changes required)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>102861</commentid>
    <comment_count>0</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2025-10-02 11:34:54 +0000</bug_when>
    <thetext>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 &quot;fragment already enabled&quot;. 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 &quot;proof&quot;/debug output

$ bitbake-getvar MACHINE

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


$ cat conf/auto.conf 

OE_FRAGMENTS += &quot;core/yocto-autobuilder/autobuilder machine/qemuarm machine/qemux86&quot;

$ 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] &quot;qemux86-64&quot;
#   set ast.py:367 [check_and_set_builtin_fragment]
#     &quot;qemuarm&quot;
#   set ast.py:367 [check_and_set_builtin_fragment]
#     &quot;qemux86&quot;
#   set /media/build/poky/meta/conf/documentation.conf:274
#     [doc] &quot;Specifies the target device for which the image is built. You define MACHINE in the conf/local.conf file in the Build Directory.&quot;
# pre-expansion value:
#   &quot;qemux86&quot;
MACHINE=&quot;qemux86&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102878</commentid>
    <comment_count>1</comment_count>
    <who name="Alexander Kanavin">alex.kanavin</who>
    <bug_when>2025-10-02 16:24:49 +0000</bug_when>
    <thetext>Patch: https://lists.openembedded.org/g/openembedded-core/message/224372</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102910</commentid>
    <comment_count>2</comment_count>
    <who name="Alexander Kanavin">alex.kanavin</who>
    <bug_when>2025-10-10 15:36:12 +0000</bug_when>
    <thetext>https://git.openembedded.org/openembedded-core/commit/?id=aea2d69d0533bf005cd58eb91fd9b3a3ae194610</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>