<?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>15393</bug_id>
          
          <creation_ts>2024-02-09 09:36:34 +0000</creation_ts>
          <short_desc>recipetool has poor python recipe failure mode</short_desc>
          <delta_ts>2024-04-11 14:55:25 +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>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.0 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Richard Purdie">richard.purdie</reporter>
          <assigned_to name="Ross Burton">ross.burton</assigned_to>
          <cc>adrian.freihofer</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>ross.burton</cc>
    
    <cc>tgamblin</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>98171</commentid>
    <comment_count>0</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2024-02-09 09:36:34 +0000</bug_when>
    <thetext>If tomllib doesn&apos;t exist and you run:

recipetool create -o /tmp https://github.com/mesonbuild/meson;rev=1.3.1

NOTE: Tasks Summary: Attempted 3 tasks of which 0 didn&apos;t need to be rerun and all succeeded.
ERROR: Neither &apos;tomllib&apos; nor &apos;tomli&apos; could be imported. Please use python3.11 or above or install tomli module
Traceback (most recent call last):
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/scripts/lib/recipetool/create_buildsys_python.py&quot;, line 814, in process
    import tomllib
ModuleNotFoundError: No module named &apos;tomllib&apos;

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/scripts/lib/recipetool/create_buildsys_python.py&quot;, line 817, in process
    import tomli as tomllib
ModuleNotFoundError: No module named &apos;tomli&apos;
INFO: Scanning paths for packages &amp; dependencies: .
INFO: Please add the following line for &apos;docs/markdown/legal.md&apos; to a &apos;lib/recipetool/licenses.csv&apos; and replace `Unknown` with the license:
000fe0dead3c0d575839e9d2bcfe2d5e,Unknown
INFO: Please add the following line for &apos;packaging/License.rtf&apos; to a &apos;lib/recipetool/licenses.csv&apos; and replace `Unknown` with the license:
074ef868ead2735d006e564c24e059c7,Unknown
INFO: Recipe /tmp/python3-meson_git.bb has been created; further editing may be required to make it fully functional

It fails, fine, but it says it did create a recipe when the file doesn&apos;t exist and exit code is zero.

We should fail if a file isn&apos;t written and not say one was when it was not.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98175</commentid>
    <comment_count>1</comment_count>
    <who name="Adrian">adrian.freihofer</who>
    <bug_when>2024-02-09 11:20:40 +0000</bug_when>
    <thetext>The related oe-selftest failure came in with 5206056589ca6b0671b0009393f526828e2c665a.
I can confirm that this commit was tested on a host where import tomllib in Python works.

Improving recipetool so that it exits with a correct error code should be done, I agree.

But that will not fix the error of the oe-selftest on the AB. The selftest checks if the bb file has been created. But this is not the case if recipetool has no tomllib or tomli available.

I see different possible solutions:
- Make tomllib a host dependency and fix the AB by installing this Python package
- Keep tomllib optional and let recipe tool ask the user for installing it when it is required. If this is the preferred solution, I need to improve the two test cases.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98176</commentid>
    <comment_count>2</comment_count>
    <who name="Adrian">adrian.freihofer</who>
    <bug_when>2024-02-09 12:10:38 +0000</bug_when>
    <thetext>Just saw the patches from RP on master-next. Looks like this problem is already solved. Thank you.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98179</commentid>
    <comment_count>3</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2024-02-09 15:41:47 +0000</bug_when>
    <thetext>I&apos;ve sent a patch to clean up the horrible exception dumping.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98187</commentid>
    <comment_count>4</comment_count>
    <who name="Adrian">adrian.freihofer</who>
    <bug_when>2024-02-12 07:46:38 +0000</bug_when>
    <thetext>Tested master-next with Python 3.12 on Fedora 39 again. Looks good! Thank you.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98738</commentid>
    <comment_count>5</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2024-04-11 14:55:25 +0000</bug_when>
    <thetext>Fixed in 1a3ba4c312844d80ae382912b319e60ad8b30737.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>