<?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>15108</bug_id>
          
          <creation_ts>2023-04-19 10:54:29 +0000</creation_ts>
          <short_desc>python3targetconfig.bbclass: PYTHONPATH is overwritten instead of extended</short_desc>
          <delta_ts>2023-06-20 10:28:43 +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>oe-core other</component>
          <version>unspecified</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>4.3 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Johannes Schrimpf">johannes.schrimpf</reporter>
          <assigned_to name="Johannes Schrimpf">johannes.schrimpf</assigned_to>
          <cc>alex.kanavin</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>tim.orling</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>95382</commentid>
    <comment_count>0</comment_count>
    <who name="Johannes Schrimpf">johannes.schrimpf</who>
    <bug_when>2023-04-19 10:54:29 +0000</bug_when>
    <thetext>I came over this error in poky, but see the same commit is present in openembedded-core as the change origins from there.

These commits set the PYTHONPATH in line 15, overwriting the current PYTHONPATH variable instead of extending the path as was the behaviour before the commit.

https://github.com/openembedded/openembedded-core/commit/c9617c03bceee54dc540318cada392799b137bd5
https://github.com/yoctoproject/poky/commit/af4284d39d8922ef1fcd884fe099aff52c7999f2

This leads to build errors of recipes where the PYTHONPATH is set before setup_target_config is run. I observed this error when building recipes from meta-ros.

I testet this in the poky repo: Adding :$PYTHONPATH (similar as with the PATH variable the line below) at the end of this line solves the problem and the recipes build without problem.

Example for a fix:

diff --git a/meta/classes-recipe/python3targetconfig.bbclass b/meta/classes-recipe/python3targetconfig.bbclass
index 22305fe176..08bc619398 100644
--- a/meta/classes-recipe/python3targetconfig.bbclass
+++ b/meta/classes-recipe/python3targetconfig.bbclass
@@ -12,7 +12,7 @@ DEPENDS:append = &quot; ${EXTRA_PYTHON_DEPENDS}&quot;
 
 setup_target_config() {
         export _PYTHON_SYSCONFIGDATA_NAME=&quot;_sysconfigdata&quot;
-        export PYTHONPATH=${STAGING_LIBDIR}/python-sysconfigdata
+        export PYTHONPATH=${STAGING_LIBDIR}/python-sysconfigdata:$PYTHONPATH
         export PATH=${STAGING_EXECPREFIXDIR}/python-target-config/:$PATH
 }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95388</commentid>
    <comment_count>1</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-04-20 14:49:14 +0000</bug_when>
    <thetext>Johannes, Seems like a good idea. Can you send a patch to the list?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95455</commentid>
    <comment_count>2</comment_count>
    <who name="Johannes Schrimpf">johannes.schrimpf</who>
    <bug_when>2023-04-25 10:35:58 +0000</bug_when>
    <thetext>I sent a patch to the openembedded-core mailing list.
https://patchwork.yoctoproject.org/project/oe-core/patch/20230425091532.8086-1-dev@loewen-email.de/

Are the patches automatically added to the poky repo as well or do I need to send the patch to an additional mailing list?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95458</commentid>
    <comment_count>3</comment_count>
    <who name="Alexander Kanavin">alex.kanavin</who>
    <bug_when>2023-04-26 10:59:10 +0000</bug_when>
    <thetext>It will get into poky automatically, oe-core is the only place you need to submit to.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95751</commentid>
    <comment_count>4</comment_count>
    <who name="Johannes Schrimpf">johannes.schrimpf</who>
    <bug_when>2023-06-20 10:28:43 +0000</bug_when>
    <thetext>Fixed in https://github.com/openembedded/openembedded-core/commit/2442ab92f8610784d28d8d83056b643bd95b0b4e</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>