If tomllib doesn'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't need to be rerun and all succeeded. ERROR: Neither 'tomllib' nor 'tomli' could be imported. Please use python3.11 or above or install tomli module Traceback (most recent call last): File "/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/scripts/lib/recipetool/create_buildsys_python.py", line 814, in process import tomllib ModuleNotFoundError: No module named 'tomllib' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/scripts/lib/recipetool/create_buildsys_python.py", line 817, in process import tomli as tomllib ModuleNotFoundError: No module named 'tomli' INFO: Scanning paths for packages & dependencies: . INFO: Please add the following line for 'docs/markdown/legal.md' to a 'lib/recipetool/licenses.csv' and replace `Unknown` with the license: 000fe0dead3c0d575839e9d2bcfe2d5e,Unknown INFO: Please add the following line for 'packaging/License.rtf' to a 'lib/recipetool/licenses.csv' 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't exist and exit code is zero. We should fail if a file isn't written and not say one was when it was not.
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.
Just saw the patches from RP on master-next. Looks like this problem is already solved. Thank you.
I've sent a patch to clean up the horrible exception dumping.
Tested master-next with Python 3.12 on Fedora 39 again. Looks good! Thank you.
Fixed in 1a3ba4c312844d80ae382912b319e60ad8b30737.