<?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>15361</bug_id>
          
          <creation_ts>2024-01-19 18:31:04 +0000</creation_ts>
          <short_desc>libxml2 fails with missing python</short_desc>
          <delta_ts>2024-01-23 15:56:02 +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>5.99</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Undecided</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>0.0.0</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Patrick Williams">patrick</reporter>
          <assigned_to name="Unassigned">unassigned</assigned_to>
          <cc>Martin.Jansa</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>richard.purdie</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>97927</commentid>
    <comment_count>0</comment_count>
    <who name="Patrick Williams">patrick</who>
    <bug_when>2024-01-19 18:31:04 +0000</bug_when>
    <thetext>I think this problem is related to the `inherit_defer` changes that went in recently.  It doesn&apos;t seem like they&apos;re working appropriately for the necessary inherit of python3native.

Observed this as of poky commit 6e00774a79b3df07c5e6732c6929ee2e77950592 when building libxml2:

```
10:22:14 | checking for python2... no
10:22:14 | checking for python3... /data0/jenkins/workspace/ci-openbmc-2/distro/ubuntu/label/docker-builder/target/p10bmc/build/hosttools/python3
10:22:14 | checking for python version... 3.10
10:22:14 | checking for python platform... linux
10:22:14 | checking for GNU default python prefix... ${prefix}
10:22:14 | checking for GNU default python exec_prefix... ${exec_prefix}
10:22:14 | checking for python script directory (pythondir)... ${libdir}/python3.10/site-packages
10:22:14 | checking for python extension module directory (pyexecdir)... ${libdir}/python3.10/site-packages
10:22:14 | checking for python-3.10... no
10:22:14 | configure: error: Package requirements (python-3.10) were not met:
10:22:14 | 
10:22:14 | No package &apos;python-3.10&apos; found
```

Looking earlier in the log, I notice that the `--with-python` is pointing to the `/usr/bin/python` which is incorrect:

```
10:22:14 | NOTE: Running ../libxml2-2.11.5/configure  --build=x86_64-linux 		  --host=x86_64-linux 		  --target=x86_64-linux 		  --prefix=/data0/jenkins/workspace/ci-openbmc-2/distro/ubuntu/label/docker-builder/target/p10bmc/build/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/usr 		  --exec_prefix=/data0/jenkins/workspace/ci-openbmc-2/distro/ubuntu/label/docker-builder/target/p10bmc/build/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/usr 		  --bindir=/data0/jenkins/workspace/ci-openbmc-2/distro/ubuntu/label/docker-builder/target/p10bmc/build/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/usr/bin 		  --sbindir=/data0/jenkins/workspace/ci-openbmc-2/distro/ubuntu/label/docker-builder/target/p10bmc/build/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/usr/sbin 		  --libexecdir=/data0/jenkins/workspace/ci-openbmc-2/distro/ubuntu/label/docker-builder/target/p10bmc/build/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/usr/libexec 		  --datadir=/data0/jenkins/workspace/ci-openbmc-2/distro/ubuntu/label/docker-builder/target/p10bmc/build/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/usr/share 		  --sysconfdir=/data0/jenkins/workspace/ci-openbmc-2/distro/ubuntu/label/docker-builder/target/p10bmc/build/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/etc 		  --sharedstatedir=/data0/jenkins/workspace/ci-openbmc-2/distro/ubuntu/label/docker-builder/target/p10bmc/build/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/com 		  --localstatedir=/data0/jenkins/workspace/ci-openbmc-2/distro/ubuntu/label/docker-builder/target/p10bmc/build/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/var 		  --libdir=/data0/jenkins/workspace/ci-openbmc-2/distro/ubuntu/label/docker-builder/target/p10bmc/build/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/usr/lib 		  --includedir=/data0/jenkins/workspace/ci-openbmc-2/distro/ubuntu/label/docker-builder/target/p10bmc/build/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/usr/include 		  --oldincludedir=/data0/jenkins/workspace/ci-openbmc-2/distro/ubuntu/label/docker-builder/target/p10bmc/build/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/usr/include 		  --infodir=/data0/jenkins/workspace/ci-openbmc-2/distro/ubuntu/label/docker-builder/target/p10bmc/build/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/usr/share/info 		  --mandir=/data0/jenkins/workspace/ci-openbmc-2/distro/ubuntu/label/docker-builder/target/p10bmc/build/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/usr/share/man 		  --disable-silent-rules 		  --disable-dependency-tracking 		   --without-legacy --with-c14n --without-lzma --with-zlib --disable-static  --enable-ipv6 --with-python=/usr/bin/python3
```

The libxml2 `--with-python` comes from the PACKAGECONFIG in the recipe:
```
meta/recipes-core/libxml/libxml2_2.11.5.bb
33:PACKAGECONFIG[python] = &quot;--with-python=${PYTHON},--without-python,python3&quot;
```


The python3native.bbclass should have been inherited, which would have set PYTHON to the python3-native version:
```
meta/classes-recipe/python3native.bbclass
9:PYTHON=&quot;${STAGING_BINDIR_NATIVE}/python3-native/python3&quot;
```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97931</commentid>
    <comment_count>1</comment_count>
    <who name="Martin Jansa">Martin.Jansa</who>
    <bug_when>2024-01-22 16:16:37 +0000</bug_when>
    <thetext>Works for me with latest oe-core/master

...
NOTE: Running ../libxml2-2.11.5/configure  --build=x86_64-linux                   --host=x86_64-linux             --target=x86_64-linux                   --prefix=/OE/build/luneos-scarthgap/tmp-glibc/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/usr                 --exec_prefix=/OE/build/luneos-scarthgap/tmp-glibc/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/usr            --bindir=/OE/build/luneos-scarthgap/tmp-glibc/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/usr/bin             --sbindir=/OE/build/luneos-scarthgap/tmp-glibc/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/usr/sbin                   --libexecdir=/OE/build/luneos-scarthgap/tmp-glibc/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/usr/libexec             --datadir=/OE/build/luneos-scarthgap/tmp-glibc/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/usr/share                  --sysconfdir=/OE/build/luneos-scarthgap/tmp-glibc/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/etc             --sharedstatedir=/OE/build/luneos-scarthgap/tmp-glibc/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/com                 --localstatedir=/OE/build/luneos-scarthgap/tmp-glibc/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/var                  --libdir=/OE/build/luneos-scarthgap/tmp-glibc/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/usr/lib             --includedir=/OE/build/luneos-scarthgap/tmp-glibc/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/usr/include             --oldincludedir=/OE/build/luneos-scarthgap/tmp-glibc/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/usr/include                  --infodir=/OE/build/luneos-scarthgap/tmp-glibc/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/usr/share/info             --mandir=/OE/build/luneos-scarthgap/tmp-glibc/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/usr/share/man               --disable-silent-rules                  --disable-dependency-tracking                    --without-legacy --with-c14n --without-lzma --with-zlib --disable-static  --enable-ipv6 --with-python=/OE/build/luneos-scarthgap/tmp-glibc/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/usr/bin/python3-native/python3
...
checking for python version... 3.12
checking for python platform... linux
checking for GNU default python prefix... ${prefix}
checking for GNU default python exec_prefix... ${exec_prefix}
checking for python script directory (pythondir)... ${libdir}/python3.12/site-packages
checking for python extension module directory (pyexecdir)... ${libdir}/python3.12/site-packages
checking for python-3.12... yes

Use bitbake -e or bitbake-getvar to figure out why PYTHON variable is incorrectly set in your build.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97934</commentid>
    <comment_count>2</comment_count>
    <who name="Patrick Williams">patrick</who>
    <bug_when>2024-01-22 16:28:12 +0000</bug_when>
    <thetext>The previous job was ran on CI server, but I recreated it locally with similar behavior.

# $PYTHON
#   set /home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/meta/conf/bitbake.conf:575
#     &quot;${@sys.executable}&quot;
PYTHON=&quot;/usr/lib/python-exec/python3.11/python3&quot;

# $PACKAGECONFIG_CONFARGS [2 operations]
#   set /home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/meta/classes-global/base.bbclass:18
#     [_defaultval] &quot;&quot;
#   append base.bbclass:474 [appendVar]
#     &quot; --enable-ipv6 --with-python=${PYTHON}&quot;
# pre-expansion value:
#   &quot; --enable-ipv6 --with-python=${PYTHON}&quot;
PACKAGECONFIG_CONFARGS=&quot; --enable-ipv6 --with-python=/usr/lib/python-exec/python3.11/python3&quot;

# $EXTRA_OECONF [8 operations]
#   set /home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/meta/conf/bitbake.conf:594
#     &quot;&quot;
#   :append /home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/meta/conf/distro/include/no-static-libs.inc:29
#     &quot;${DISABLE_STATIC}&quot;
#   set /home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/meta/conf/documentation.conf:166
#     [doc] &quot;Additional configure script options.&quot;
#   :append /home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/meta/classes-recipe/autotools.bbclass:141
#     &quot; ${PACKAGECONFIG_CONFARGS}&quot;
#   set /home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/meta/recipes-core/libxml/libxml2_2.11.5.bb:54
#     &quot;--without-debug --without-legacy --with-catalog --with-c14n --without-lzma --with-fexceptions&quot;
#   override[class-native]:set /home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/meta/recipes-core/libxml/libxml2_2.11.5.bb:55
#     &quot;--without-legacy --with-c14n --without-lzma --with-zlib&quot;
#   override[class-nativesdk]:set /home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/meta/recipes-core/libxml/libxml2_2.11.5.bb:56
#     &quot;--without-legacy --with-c14n --without-lzma --with-zlib&quot;
#   override[linuxstdbase]:set /home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/meta/recipes-core/libxml/libxml2_2.11.5.bb:57
#     &quot;--with-debug --with-legacy --with-c14n --without-lzma --with-zlib&quot;
# pre-expansion value:
#   &quot;--without-legacy --with-c14n --without-lzma --with-zlib${DISABLE_STATIC} ${PACKAGECONFIG_CONFARGS}&quot;
EXTRA_OECONF=&quot;--without-legacy --with-c14n --without-lzma --with-zlib --disable-static  --enable-ipv6 --with-python=/usr/lib/python-exec/python3.11/python3&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97936</commentid>
    <comment_count>3</comment_count>
    <who name="Martin Jansa">Martin.Jansa</who>
    <bug_when>2024-01-22 16:42:10 +0000</bug_when>
    <thetext>oe-core $ bitbake-getvar -r libxml2-native PYTHON
#
# $PYTHON [3 operations]
#   set /OE/build/oe-core/openembedded-core/meta/conf/bitbake.conf:575
#     &quot;${@sys.executable}&quot;
#   set /OE/build/oe-core/openembedded-core/meta/classes-recipe/python3native.bbclass:9
#     &quot;${STAGING_BINDIR_NATIVE}/python3-native/python3&quot;
#   exported ast.py:52 [eval]
#     [export] &quot;1&quot;
# pre-expansion value:
#   &quot;${STAGING_BINDIR_NATIVE}/python3-native/python3&quot;
export PYTHON=&quot;/OE/build/oe-core/tmp-glibc/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/usr/bin/python3-native/python3&quot;

oe-core $ bitbake-getvar -r libxml2-native --value BBINCLUDED | sed &quot;s/ /\n/g&quot; | grep python
/OE/build/oe-core/classes-recipe/python3targetconfig.bbclass
/OE/build/oe-core/meta-openembedded/meta-oe/classes-recipe/python3targetconfig.bbclass
/OE/build/oe-core/openembedded-core/meta/classes-recipe/python3targetconfig.bbclass
/OE/build/oe-core/classes-recipe/python3native.bbclass
/OE/build/oe-core/meta-openembedded/meta-oe/classes-recipe/python3native.bbclass
/OE/build/oe-core/openembedded-core/meta/classes-recipe/python3native.bbclass
/OE/build/oe-core/classes-recipe/python3-dir.bbclass
/OE/build/oe-core/meta-openembedded/meta-oe/classes-recipe/python3-dir.bbclass
/OE/build/oe-core/openembedded-core/meta/classes-recipe/python3-dir.bbclass

oe-core $ ls -lah /OE/build/oe-core/meta-openembedded/meta-oe/classes-recipe/python3native.bbclass /OE/build/oe-core/openembedded-core/meta/classes-recipe/python3native.bbclass /OE/build/oe-core/classes-recipe/pyt
hon3native.bbclass
ls: cannot access &apos;/OE/build/oe-core/meta-openembedded/meta-oe/classes-recipe/python3native.bbclass&apos;: No such file or directory
ls: cannot access &apos;/OE/build/oe-core/classes-recipe/python3native.bbclass&apos;: No such file or directory
-rw-r--r-- 1 martin martin 863 Jul 26 10:36 /OE/build/oe-core/openembedded-core/meta/classes-recipe/python3native.bbclass</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97937</commentid>
    <comment_count>4</comment_count>
    <who name="Patrick Williams">patrick</who>
    <bug_when>2024-01-22 17:14:52 +0000</bug_when>
    <thetext>I added some dirty debug statements to bitbake:

--- a/poky/bitbake/lib/bb/parse/parse_py/BBHandler.py
+++ b/poky/bitbake/lib/bb/parse/parse_py/BBHandler.py
@@ -45,6 +45,8 @@ def inherit(files, fn, lineno, d, deferred=False):
     __inherit_cache = d.getVar(&apos;__inherit_cache&apos;, False) or []
     #if &quot;${&quot; in files and not deferred:
     #    bb.warn(&quot;%s:%s has non deferred conditional inherit&quot; % (fn, lineno))
+    if &quot;${&quot; in files:
+        bb.warn(&quot;HERE: files = %s, expand = %s, packageconfig = %s&quot; % (files, d.expand(files), d.getVar(&quot;PACKAGECONFIG&quot;)))
     files = d.expand(files).split()
     for file in files:
         classtype = d.getVar(&quot;__bbclasstype&quot;, False)

This results in:

WARNING: HERE: files = ${USERADDEXTENSION}, expand = , packageconfig = None
Loading cache...done.
Loaded 4612 entries from dependency cache.
Parsing recipes...done.
Parsing of 2840 .bb files complete (2839 cached, 1 parsed). 4613 targets, 599 skipped, 0 masked, 0 errors.
WARNING: HERE: files = ${USERADDEXTENSION}, expand = , packageconfig = None
NOTE: Resolving any missing task queue dependencies
WARNING: HERE: files = ${GNOMEBASEBUILDCLASS}, expand = autotools, packageconfig = 
WARNING: HERE: files = ${@bb.utils.contains(&apos;PACKAGECONFIG&apos;, &apos;python&apos;, &apos;python3targetconfig&apos;, &apos;&apos;, d)}, expand = , packageconfig = 

But... in the -e output:

# $PACKAGECONFIG [7 operations]
#   :append[pn-qemu-system-native] /home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/.build-yosemite/conf/local.conf:219
#     &quot; sdl&quot;
#   :remove[pn-btrfs-tools] /home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/meta-phosphor/conf/distro/include/phosphor-pkg-tweaks.inc:7
#     &quot;python&quot;
#   set /home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/meta/conf/documentation.conf:320
#     [doc] &quot;This variable provides a means of enabling or disabling features of a recipe on a per-recipe basis.&quot;
#   set /home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/meta/recipes-core/libxml/libxml2_2.11.5.bb:32
#     [_defaultval] &quot;python     ${@bb.utils.filter(&apos;DISTRO_FEATURES&apos;, &apos;ipv6&apos;, d)} &quot;
#   set /home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/meta/recipes-core/libxml/libxml2_2.11.5.bb:33
#     [python] &quot;--with-python=${PYTHON},--without-python,python3&quot;
#   set /home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/meta/recipes-core/libxml/libxml2_2.11.5.bb:34
#     [ipv6] &quot;--enable-ipv6,--disable-ipv6,&quot;
#   override[openbmc-phosphor:class-target]:set /home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/meta-phosphor/recipes-core/libxml2/libxml2_%.bbappend:2
#     &quot;&quot;
# pre-expansion value:
#   &quot;python     ${@bb.utils.filter(&apos;DISTRO_FEATURES&apos;, &apos;ipv6&apos;, d)} &quot;
PACKAGECONFIG=&quot;python     ipv6 &quot;

Not sure how we end up with `d.expand()` not evaluating properly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97938</commentid>
    <comment_count>5</comment_count>
    <who name="Patrick Williams">patrick</who>
    <bug_when>2024-01-22 17:16:02 +0000</bug_when>
    <thetext>New data point:

We have a bbappend for this recipe:

PACKAGECONFIG:openbmc-phosphor:class-target = &quot;&quot;


If I remove that then the expand works correctly:

WARNING: HERE: files = ${@bb.utils.contains(&apos;PACKAGECONFIG&apos;, &apos;python&apos;, &apos;python3targetconfig&apos;, &apos;&apos;, d)}, expand = python3targetconfig, packageconfig = python     ipv6 


Something must be wrong in the `expand` call that isn&apos;t including the overrides?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97939</commentid>
    <comment_count>6</comment_count>
    <who name="Patrick Williams">patrick</who>
    <bug_when>2024-01-22 17:21:33 +0000</bug_when>
    <thetext>Adding another hint:
        bb.warn(&quot;HERE2: %s&quot; % (d.getVar(&quot;CLASSOVERRIDE&quot;)))

With the bbappend removed:

WARNING: HERE: files = ${@bb.utils.contains(&apos;PACKAGECONFIG&apos;, &apos;python&apos;, &apos;python3targetconfig&apos;, &apos;&apos;, d)}, expand = python3targetconfig, packageconfig = python     ipv6 
WARNING: HERE2: class-target

With the bbappend present:

WARNING: HERE: files = ${@bb.utils.contains(&apos;PACKAGECONFIG&apos;, &apos;python&apos;, &apos;python3targetconfig&apos;, &apos;&apos;, d)}, expand = , packageconfig = 
WARNING: HERE2: class-target


This is a native recipe... how&apos;d we get class-target?

# $CLASSOVERRIDE [4 operations]
#   set? /home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/meta/conf/bitbake.conf:815
#     &quot;class-target&quot;
#   set /home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/meta/conf/documentation.conf:111
#     [doc] &quot;An internal variable specifying the special class override that should currently apply (e.g. &quot;class-target&quot;, &quot;class-native&quot;, and so forth).&quot;
#   set? /home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/meta/classes-global/base.bbclass:8
#     &quot;class-target&quot;
#   set /home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/meta/classes-recipe/native.bbclass:113
#     &quot;class-native&quot;
# pre-expansion value:
#   &quot;class-native&quot;
CLASSOVERRIDE=&quot;class-native&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97940</commentid>
    <comment_count>7</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2024-01-22 19:20:54 +0000</bug_when>
    <thetext>(In reply to Patrick Williams from comment #6)
&gt; Adding another hint:
&gt;         bb.warn(&quot;HERE2: %s&quot; % (d.getVar(&quot;CLASSOVERRIDE&quot;)))
&gt; 
&gt; With the bbappend removed:
&gt; 
&gt; WARNING: HERE: files = ${@bb.utils.contains(&apos;PACKAGECONFIG&apos;, &apos;python&apos;,
&gt; &apos;python3targetconfig&apos;, &apos;&apos;, d)}, expand = python3targetconfig, packageconfig
&gt; = python     ipv6 
&gt; WARNING: HERE2: class-target
&gt; 
&gt; With the bbappend present:
&gt; 
&gt; WARNING: HERE: files = ${@bb.utils.contains(&apos;PACKAGECONFIG&apos;, &apos;python&apos;,
&gt; &apos;python3targetconfig&apos;, &apos;&apos;, d)}, expand = , packageconfig = 
&gt; WARNING: HERE2: class-target
&gt; 
&gt; 
&gt; This is a native recipe... how&apos;d we get class-target?
&gt; 
&gt; # $CLASSOVERRIDE [4 operations]
&gt; #   set?
&gt; /home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/meta/conf/
&gt; bitbake.conf:815
&gt; #     &quot;class-target&quot;
&gt; #   set
&gt; /home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/meta/conf/
&gt; documentation.conf:111
&gt; #     [doc] &quot;An internal variable specifying the special class override that
&gt; should currently apply (e.g. &quot;class-target&quot;, &quot;class-native&quot;, and so forth).&quot;
&gt; #   set?
&gt; /home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/meta/
&gt; classes-global/base.bbclass:8
&gt; #     &quot;class-target&quot;
&gt; #   set
&gt; /home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/meta/
&gt; classes-recipe/native.bbclass:113
&gt; #     &quot;class-native&quot;
&gt; # pre-expansion value:
&gt; #   &quot;class-native&quot;
&gt; CLASSOVERRIDE=&quot;class-native&quot;


classes-global/base.bbclass:CLASSOVERRIDE ?= &quot;class-target&quot;

i.e. the default is class-target

and:

classes-recipe/native.bbclass:CLASSOVERRIDE = &quot;class-native&quot;

so native.bbclass sets it later. It is possible to get the target version if you expand before the native class is inherited. That inherit happens right at the of parsing with BBCLASSEXTEND.

The trouble is that there is immediate expansion involved to decide whether to process the inherit. That was the case before inherit_defer and is the case afterwards, the point of the inherit just becomes more deterministic and is later with inherit_defer.


So whilst inherit_defer improves many things, it looks like it still does not interact well with class-XXX overrides in variables.

It isn&apos;t a bug in bitbake, it is just unfortunate the way things are working toegther.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97942</commentid>
    <comment_count>8</comment_count>
    <who name="Patrick Williams">patrick</who>
    <bug_when>2024-01-22 20:29:16 +0000</bug_when>
    <thetext>&gt; So whilst inherit_defer improves many things, it looks like it still does not interact well with class-XXX overrides in variables.

Practically speaking, what should be done with libxml2?  If I revert to `inherit` directly the parsing works and with `inherit_defer` it doesn&apos;t.  I assume we don&apos;t want this to be inherit though.  I&apos;m not following why `inherit_defer` makes things worse in this particular instance.


If I change it back to inherit I get PYTHON correct:

# $PYTHON [3 operations]
#   set /home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/meta/conf/bitbake.conf:575
#     &quot;${@sys.executable}&quot;
#   set /home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/meta/classes-recipe/python3native.bbclass:9
#     &quot;${STAGING_BINDIR_NATIVE}/python3-native/python3&quot;
#   exported ast.py:52 [eval]
#     [export] &quot;1&quot;
# pre-expansion value:
#   &quot;${STAGING_BINDIR_NATIVE}/python3-native/python3&quot;
export PYTHON=&quot;/home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/.build-yosemite/tmp/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/usr/bin/python3-native/python3&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97943</commentid>
    <comment_count>9</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2024-01-22 21:26:14 +0000</bug_when>
    <thetext>(In reply to Patrick Williams from comment #8)
&gt; &gt; So whilst inherit_defer improves many things, it looks like it still does not interact well with class-XXX overrides in variables.
&gt; 
&gt; Practically speaking, what should be done with libxml2?  If I revert to
&gt; `inherit` directly the parsing works and with `inherit_defer` it doesn&apos;t.  I
&gt; assume we don&apos;t want this to be inherit though.  I&apos;m not following why
&gt; `inherit_defer` makes things worse in this particular instance.
&gt; 
&gt; 
&gt; If I change it back to inherit I get PYTHON correct:
&gt; 
&gt; # $PYTHON [3 operations]
&gt; #   set
&gt; /home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/meta/conf/
&gt; bitbake.conf:575
&gt; #     &quot;${@sys.executable}&quot;
&gt; #   set
&gt; /home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/meta/
&gt; classes-recipe/python3native.bbclass:9
&gt; #     &quot;${STAGING_BINDIR_NATIVE}/python3-native/python3&quot;
&gt; #   exported ast.py:52 [eval]
&gt; #     [export] &quot;1&quot;
&gt; # pre-expansion value:
&gt; #   &quot;${STAGING_BINDIR_NATIVE}/python3-native/python3&quot;
&gt; export
&gt; PYTHON=&quot;/home/apwillia/local/sync/openbmc-sources/openbmc-config/openbmc/.
&gt; build-yosemite/tmp/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-
&gt; native/usr/bin/python3-native/python3&quot;

I&apos;m not convinced we&apos;re comparing the same things before and after, particularly as it now appears there is some bbappend at play.

Can you turn this into some simple reproducer for OE-Core which shows the issue?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97944</commentid>
    <comment_count>10</comment_count>
      <attachid>5006</attachid>
    <who name="Patrick Williams">patrick</who>
    <bug_when>2024-01-22 21:44:33 +0000</bug_when>
    <thetext>Created attachment 5006
Patch to aggravate issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97945</commentid>
    <comment_count>11</comment_count>
      <attachid>5007</attachid>
    <who name="Patrick Williams">patrick</who>
    <bug_when>2024-01-22 21:44:53 +0000</bug_when>
    <thetext>Created attachment 5007
Revert inherit_defer for libxml.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97946</commentid>
    <comment_count>12</comment_count>
    <who name="Patrick Williams">patrick</who>
    <bug_when>2024-01-22 21:47:05 +0000</bug_when>
    <thetext>&gt; Can you turn this into some simple reproducer for OE-Core which shows the issue?

Applying https://bugzilla.yoctoproject.org/attachment.cgi?id=5006 and running `bitbake libxml2-native -ne` results in:

# $PYTHON
#   set /home/apwillia/local/sync/openbmc-sources/openembedded-core/meta/conf/bitbake.conf:575
#     &quot;${@sys.executable}&quot;
PYTHON=&quot;/usr/lib/python-exec/python3.11/python3&quot;

Applying https://bugzilla.yoctoproject.org/attachment.cgi?id=5007 on top of that results in:

# $PYTHON [3 operations]
#   set /home/apwillia/local/sync/openbmc-sources/openembedded-core/meta/conf/bitbake.conf:575
#     &quot;${@sys.executable}&quot;
#   set /home/apwillia/local/sync/openbmc-sources/openembedded-core/meta/classes-recipe/python3native.bbclass:9
#     &quot;${STAGING_BINDIR_NATIVE}/python3-native/python3&quot;
#   exported ast.py:52 [eval]
#     [export] &quot;1&quot;
# pre-expansion value:
#   &quot;${STAGING_BINDIR_NATIVE}/python3-native/python3&quot;
export PYTHON=&quot;/home/apwillia/local/sync/openbmc-sources/openembedded-core/build/tmp-glibc/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/usr/bin/python3-native/python3&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97947</commentid>
    <comment_count>13</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2024-01-22 22:29:06 +0000</bug_when>
    <thetext>The patches you attached were the same thing.

Anyhow, adding:

PACKAGECONFIG:remove:class-target = &quot;python&quot;

to the libxml recipe was enough to see what you&apos;re referring to. You can swap the inherit_defer back to inherit to restore the old behaviour. It really is just happening to work through luck :/.

With inherit, the class is always inherited even in the target case. This is because at the time the line is evaluated, the PACKAGECONFIG in the bbappend (or at the end of the bb file) hasn&apos;t been seen.

The configure command is dynamically adjusted rather than immediately evaluated so it can change to --without-python even though the class was innherited and the DEPENDS were added.

With inherit_defer, the line is parsed after the bbappend or bb but before native.bbclass. This means that it has seen the PACKAGECONFIG line but class-native isn&apos;t set yet.

So yes, there is a change of behaviour but it wasn&apos;t doing what you thought before. I agree the new behaviour isn&apos;t ideal either though. We should be clear that there was a bug even before this though which inherit_defer does improve by not adding the DEPENDS.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97958</commentid>
    <comment_count>14</comment_count>
    <who name="Patrick Williams">patrick</who>
    <bug_when>2024-01-23 15:56:02 +0000</bug_when>
    <thetext>Marking as WONTFIX for now.  I&apos;ll just add an explicit inherit in the bbappend on our end, which gets us past the problem, and refer to this issue for reference.

Thank you Richard for the explanation.  I understand now what is going on and why the observed change of behavior.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>5006</attachid>
            <date>2024-01-22 21:44:33 +0000</date>
            <delta_ts>2024-01-22 21:44:33 +0000</delta_ts>
            <desc>Patch to aggravate issue.</desc>
            <filename>0001-libxml2-bbappend-with-class-target.patch</filename>
            <type>text/plain</type>
            <size>1256</size>
            <attacher name="Patrick Williams">patrick</attacher>
            
              <data encoding="base64">RnJvbSBiMzJjMjg5YjQzMTY5MmJiN2Q3OGU4ZWMyZDI1Yzc0NmQyM2YyYjgwIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBQYXRyaWNrIFdpbGxpYW1zIDxwYXRyaWNrQHN0d2N4Lnh5ej4K
RGF0ZTogTW9uLCAyMiBKYW4gMjAyNCAxNTo0MTozNiAtMDYwMApTdWJqZWN0OiBbUEFUQ0ggMS8y
XSBsaWJ4bWwyIGJiYXBwZW5kIHdpdGggY2xhc3MgdGFyZ2V0CgpTaWduZWQtb2ZmLWJ5OiBQYXRy
aWNrIFdpbGxpYW1zIDxwYXRyaWNrQHN0d2N4Lnh5ej4KLS0tCiBtZXRhL2NvbmYvbGF5ZXIuY29u
ZiAgICAgICAgICAgICAgICAgICAgICAgIHwgMiArLQogbWV0YS9yZWNpcGVzLWNvcmUvbGlieG1s
L2xpYnhtbDJfJS5iYmFwcGVuZCB8IDEgKwogMiBmaWxlcyBjaGFuZ2VkLCAyIGluc2VydGlvbnMo
KyksIDEgZGVsZXRpb24oLSkKIGNyZW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09ORklHOnJlbW92ZTpjbGFzcy10YXJnZXQgPSAicHl0aG9uIgotLSAKMi40My4w
Cgo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>5007</attachid>
            <date>2024-01-22 21:44:53 +0000</date>
            <delta_ts>2024-01-22 21:44:53 +0000</delta_ts>
            <desc>Revert inherit_defer for libxml.</desc>
            <filename>0001-libxml2-bbappend-with-class-target.patch</filename>
            <type>text/plain</type>
            <size>1256</size>
            <attacher name="Patrick Williams">patrick</attacher>
            
              <data encoding="base64">RnJvbSBiMzJjMjg5YjQzMTY5MmJiN2Q3OGU4ZWMyZDI1Yzc0NmQyM2YyYjgwIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBQYXRyaWNrIFdpbGxpYW1zIDxwYXRyaWNrQHN0d2N4Lnh5ej4K
RGF0ZTogTW9uLCAyMiBKYW4gMjAyNCAxNTo0MTozNiAtMDYwMApTdWJqZWN0OiBbUEFUQ0ggMS8y
XSBsaWJ4bWwyIGJiYXBwZW5kIHdpdGggY2xhc3MgdGFyZ2V0CgpTaWduZWQtb2ZmLWJ5OiBQYXRy
aWNrIFdpbGxpYW1zIDxwYXRyaWNrQHN0d2N4Lnh5ej4KLS0tCiBtZXRhL2NvbmYvbGF5ZXIuY29u
ZiAgICAgICAgICAgICAgICAgICAgICAgIHwgMiArLQogbWV0YS9yZWNpcGVzLWNvcmUvbGlieG1s
L2xpYnhtbDJfJS5iYmFwcGVuZCB8IDEgKwogMiBmaWxlcyBjaGFuZ2VkLCAyIGluc2VydGlvbnMo
KyksIDEgZGVsZXRpb24oLSkKIGNyZWF0ZSBtb2RlIDEwMDY0NCBtZXRhL3JlY2lwZXMtY29yZS9s
aWJ4bWwvbGlieG1sMl8lLmJiYXBwZW5kCgpkaWZmIC0tZ2l0IGEvbWV0YS9jb25mL2xheWVyLmNv
bmYgYi9tZXRhL2NvbmYvbGF5ZXIuY29uZgppbmRleCBiYjh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