<?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>14446</bug_id>
          
          <creation_ts>2021-06-21 18:44:28 +0000</creation_ts>
          <short_desc>devtool add malformed PACKAGECONFIG</short_desc>
          <delta_ts>2025-02-14 16:48:26 +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>Scripts and Tools</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>NEWCOMER</status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>4.1 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>aatir.manzur</reporter>
          <assigned_to name="Thomas Roos">thomas</assigned_to>
          <cc>abongwabonalais</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>ross.burton</cc>
    
    <cc>sgw</cc>
    
    <cc>thomas</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>90723</commentid>
    <comment_count>0</comment_count>
    <who name="">aatir.manzur</who>
    <bug_when>2021-06-21 18:44:28 +0000</bug_when>
    <thetext>devtool add python3-uvicorn https://files.pythonhosted.org/packages/e9/9e/25d59f5043cf763833b2581c8027fa92342c4cf8ee523b498ecdf460c16d/uvicorn-0.14.0.tar.gz

results in a recipe with malformed PACKAGECONFIG[]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90724</commentid>
    <comment_count>1</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2021-06-21 19:44:34 +0000</bug_when>
    <thetext>The malformed PACKAGECONFIG looks like this:

PACKAGECONFIG[:python_version &lt; &quot;3.8&quot;] = &quot;,,,python3-typing-extensions&quot;
PACKAGECONFIG[standard] = &quot;,,,python3-pyyaml python3-httptools python3-python-dotenv python3-watchgod python3-websockets&quot;
PACKAGECONFIG[standard:sys_platform != &quot;win32&quot; and (sys_platform != &quot;cygwin&quot; and platform_python_implementation != &quot;pypy&quot;)] = &quot;,,,python3-uvloop!&quot;
PACKAGECONFIG[standard:sys_platform == &quot;win32&quot;] = &quot;,,,python3-colorama&quot;


Which is taken from the extras_require parameter to setuptools.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92973</commentid>
    <comment_count>2</comment_count>
    <who name="Abongwa Bonalais Amahnui">abongwabonalais</who>
    <bug_when>2022-04-11 09:11:10 +0000</bug_when>
    <thetext>Hello Ross, I wish to ask if this bug is resolved since its been almost a year since this was put up.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93026</commentid>
    <comment_count>3</comment_count>
    <who name="Abongwa Bonalais Amahnui">abongwabonalais</who>
    <bug_when>2022-04-13 11:12:36 +0000</bug_when>
    <thetext>And also, I would like to know how to reproduce this bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93029</commentid>
    <comment_count>4</comment_count>
    <who name="Saul Wold">saul.wold</who>
    <bug_when>2022-04-13 13:24:10 +0000</bug_when>
    <thetext>Abongwa,

Yes it still reproduces with master, the way to see this is run the devtool command that is listed in the first comment.  I tested this yesterday.

The problem is that pysetuptools sees the uvicorn.egg-info/requires.txt as extra requirements.  Recipetool parses this information to generate the PACKAGECONFIG lines, specifically the python parsing function in create_buildsys_python.py (in scripts/lib/recipetool). There is a set of characters in the replacements variable and code in apply_info_replacements(). This code probably needs to be fixed to handle the &quot;bad&quot; lines:

[:python_version &lt; &quot;3.8&quot;]
typing-extensions

[standard:sys_platform != &quot;win32&quot; and (sys_platform != &quot;cygwin&quot; and platform_pyt
hon_implementation != &quot;PyPy&quot;)]
uvloop!=0.15.0,!=0.15.1,&gt;=0.14.0

[standard:sys_platform == &quot;win32&quot;]
colorama&gt;=0.4

Are you interested in helping out on this, if so, you can assign the bug to yourself.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93474</commentid>
    <comment_count>5</comment_count>
    <who name="Thomas Roos">thomas</who>
    <bug_when>2022-06-10 09:26:30 +0000</bug_when>
    <thetext>did pick this bug as my first to solve (NEWCOMER)
I think I found a solution, but I&apos;m a bit unsure what the expected behavior is.
I don&apos;t see any support for expressions in PACKAGECONFIG eg. 
PACKAGECONFIG[:python_version &lt; &quot;3.8&quot;] so those should not be added to the bb recipe.
I add a simple check to exclude any PACKAGECONFIG, which contains an expression.
Is this the right way to go or is something else expected?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93496</commentid>
    <comment_count>6</comment_count>
    <who name="Saul Wold">saul.wold</who>
    <bug_when>2022-06-10 17:14:53 +0000</bug_when>
    <thetext>Yes, that would be the general approach, it would be good if possible to provide a warning saying that recipetool was unable to parse or add those PACKAGECONFIG either as output or as a comment in the new recipe bb file.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93556</commentid>
    <comment_count>7</comment_count>
    <who name="Thomas Roos">thomas</who>
    <bug_when>2022-06-20 12:21:15 +0000</bug_when>
    <thetext>I did rework my patch (https://bpa.st/SXEQ) instead of just omitting that malformed lines my current approach is to replace the expression (parsed from requires.txt) by a parsable replacement that can be enabled manually. 
E.g.
#PACKAGECONFIG ?= &quot;pythonversionsmaller3dot8 standard standardsysplatformnotequalswin32andsysplatformnotequalscygwinandplatformpythonimplementationnotequalspypy standardsysplatformequalsequalswin32&quot;
PACKAGECONFIG[pythonversionsmaller3dot8] = &quot;,,,python3-typing-extensions&quot;
PACKAGECONFIG[standard] = &quot;,,,python3-pyyaml python3-httptools python3-python-dotenv python3-watchgod python3-websockets&quot;
PACKAGECONFIG[standardsysplatformnotequalswin32andsysplatformnotequalscygwinandplatformpythonimplementationnotequalspypy] = &quot;,,,python3-uvloop!&quot;
PACKAGECONFIG[standardsysplatformequalsequalswin32] = &quot;,,,python3-colorama&quot;

This will work for the uvicorn package. Is there any test to check that my modifications do not break anything?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93564</commentid>
    <comment_count>8</comment_count>
    <who name="Saul Wold">saul.wold</who>
    <bug_when>2022-06-22 14:19:56 +0000</bug_when>
    <thetext>(In reply to comment #7)
&gt; I did rework my patch (https://bpa.st/SXEQ) instead of just omitting that
&gt; malformed lines my current approach is to replace the expression (parsed
&gt; from requires.txt) by a parsable replacement that can be enabled manually. 
&gt; E.g.
&gt; #PACKAGECONFIG ?= &quot;pythonversionsmaller3dot8 standard
&gt; standardsysplatformnotequalswin32andsysplatformnotequalscygwinandplatformpyth
&gt; onimplementationnotequalspypy standardsysplatformequalsequalswin32&quot;
&gt; PACKAGECONFIG[pythonversionsmaller3dot8] = &quot;,,,python3-typing-extensions&quot;
&gt; PACKAGECONFIG[standard] = &quot;,,,python3-pyyaml python3-httptools
&gt; python3-python-dotenv python3-watchgod python3-websockets&quot;
&gt; PACKAGECONFIG[standardsysplatformnotequalswin32andsysplatformnotequalscygwina
&gt; ndplatformpythonimplementationnotequalspypy] = &quot;,,,python3-uvloop!&quot;
&gt; PACKAGECONFIG[standardsysplatformequalsequalswin32] = &quot;,,,python3-colorama&quot;
&gt; 
&gt; This will work for the uvicorn package. Is there any test to check that my
&gt; modifications do not break anything?

I would suggest adding spaces for better readability.  You could just change the replace lines to add a space for the &quot;&quot; or add spaces around the words your replacing.

No, but you should consider adding a test using the uvicorn package to ensure it&apos;s parsed correctly.  Take a look at meta-selftest.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93565</commentid>
    <comment_count>9</comment_count>
    <who name="Thomas Roos">thomas</who>
    <bug_when>2022-06-22 15:13:54 +0000</bug_when>
    <thetext>spaces are not allowed, but - (hyphens) are ok. Should improve the readability as lot as well:

#PACKAGECONFIG ?= &quot;python-version-smaller-3-dot-8 standard standardsys-platform-not--equals-win32andsys-platform-not--equals-cygwinandplatform-python-implementation-not--equals-pypy standardsys-platform-equals--equals-win32&quot;
PACKAGECONFIG[python-version-smaller-3-dot-8] = &quot;,,,python3-typing-extensions&quot;
PACKAGECONFIG[standard] = &quot;,,,python3-pyyaml python3-httptools python3-python-dotenv python3-watchgod python3-websockets&quot;
PACKAGECONFIG[standardsys-platform-not--equals-win32andsys-platform-not--equals-cygwinandplatform-python-implementation-not--equals-pypy] = &quot;,,,python3-uvloop!&quot;
PACKAGECONFIG[standardsys-platform-equals--equals-win32] = &quot;,,,python3-colorama&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93634</commentid>
    <comment_count>10</comment_count>
    <who name="Thomas Roos">thomas</who>
    <bug_when>2022-07-05 07:21:37 +0000</bug_when>
    <thetext>unsure about the bugzilla workflow
I did send my patch to the mailing list. It got merged into master-next and master
https://lists.openembedded.org/g/openembedded-core/message/167334?p=%2C%2C%2C20%2C0%2C0%2C0%3A%3ACreated%2C%2CPACKAGECONFIG%2C20%2C2%2C0%2C92039954
- so what is next? 
- Who should close the bug?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93635</commentid>
    <comment_count>11</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2022-07-05 09:43:38 +0000</bug_when>
    <thetext>You can, as you sent the patch, but I&apos;ll do it now.

Fixed in oe-core a854d95a79e64f3f82abfa4cc1daec750abf4249</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100970</commentid>
    <comment_count>12</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2025-02-14 16:46:24 +0000</bug_when>
    <thetext>bulk change to add Saul&apos;s non-WR address.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101076</commentid>
    <comment_count>13</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2025-02-14 16:48:26 +0000</bug_when>
    <thetext>Bulk change: Remove Saul&apos;s old WR address.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>