Bug 15129 - bitbake tracebacks for Python errors provide insufficient context
Summary: bitbake tracebacks for Python errors provide insufficient context
Status: NEW
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium enhancement
Target Milestone: 6.99
Assignee: Unassigned
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2023-06-01 13:32 UTC by Trevor Gamblin
Modified: 2026-08-20 15:11 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Trevor Gamblin 2023-06-01 13:32:47 UTC
When building and testing new recipes or changes to build processes for Python modules, error logs from bitbake can sometimes be cryptic and/or unhelpful. For example, a recent effort was made to change the python_hatchling class for cleaning up empty site-packages paths being left behind from previous builds, which had been breaking subsequent runs for recipes that relied on them (until TMPDIR was removed). This was done by adding a hatchling_rm_emptydirs() function, which had separate class-target and class-native versions (but no generic one without these specifiers). When testing with this change, I encountered the following error: 

NOTE: Executing Tasks
ERROR: python3-hatchling-native-1.17.0-r0 do_prepare_recipe_sysroot: AttributeError("'NoneType' object has no attribute 'get'")
ERROR: Logfile of failure stored in: /workspace/yocto/manual/openembedded-core/build/tmp-glibc/work/x86_64-linux/python3-hatchling-native/1.17.0-r0/temp/log.do_prepare_recipe_sysroot.3118241
Log data follows:
| DEBUG: Executing python function do_prepare_recipe_sysroot
| DEBUG: Executing python function extend_recipe_sysroot
| NOTE: Direct dependencies are ['virtual:native:/workspace/yocto/manual/openembedded-core/meta/recipes-devtools/python/python3-build_0.10.0.bb:do_populate_sysroot', 'virtual:native:/workspace/yocto/manual/openembedded-core/meta/recipes-devtools/python/python3-editables_0.3.bb:do_populate_sysroot', 'virtual:native:/workspace/yocto/manual/openembedded-core/meta/recipes-devtools/python/python3-installer_0.7.0.bb:do_populate_sysroot', 'virtual:native:/workspace/yocto/manual/openembedded-core/meta/recipes-devtools/python/python3-packaging_23.1.bb:do_populate_sysroot', 'virtual:native:/workspace/yocto/manual/openembedded-core/meta/recipes-devtools/python/python3-pathspec_0.11.1.bb:do_populate_sysroot', 'virtual:native:/workspace/yocto/manual/openembedded-core/meta/recipes-devtools/python/python3-pluggy_1.0.0.bb:do_populate_sysroot', 'virtual:native:/workspace/yocto/manual/openembedded-core/meta/recipes-devtools/python/python3-trove-classifiers_2023.5.2.bb:do_populate_sysroot', 'virtual:native:/workspace/yocto/manual/openembedded-core/meta/recipes-devtools/python/python3_3.11.2.bb:do_populate_sysroot']
| NOTE: Installed into sysroot: []
| NOTE: Skipping as already exists in sysroot: ['python3-build-native', 'python3-editables-native', 'python3-installer-native', 'python3-packaging-native', 'python3-pathspec-native', 'python3-pluggy-native', 'python3-trove-classifiers-native', 'python3-native', 'python3-flit-core-native', 'python3-wheel-native', 'python3-setuptools-native', 'python3-calver-native', 'python3-importlib-metadata-native', 'python3-setuptools-scm-native', 'python3-more-itertools-native', 'python3-pyproject-hooks-native', 'libffi-native', 'zlib-native', 'bzip2-native', 'libedit-native', 'libnsl2-native', 'openssl-native', 'util-linux-libuuid-native', 'sqlite3-native', 'xz-native', 'libtirpc-native', 'libtool-native', 'gdbm-native', 'ncurses-native', 'expat-native', 'unzip-native', 'python3-zipp-native', 'python3-pathlib2-native', 'python3-toml-native', 'python3-typing-extensions-native', 'python3-tomli-native', 'python3-pip-native', 'python3-pyparsing-native', 'texinfo-dummy-native', 'gettext-minimal-native', 'perl-native', 'cmake-native', 'python3-six-native', 'make-native', 'zstd-native']
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Python function do_prepare_recipe_sysroot finished
ERROR: Task (virtual:native:/workspace/yocto/manual/openembedded-core/meta/recipes-devtools/python/python3-hatchling_1.17.0.bb:do_prepare_recipe_sysroot) failed with exit code '1'
NOTE: Tasks Summary: Attempted 1124 tasks of which 1123 didn't need to be rerun and 1 failed.

It would be helpful to either make bitbake able to provide more context in these situations, and/or able to warn about needing a "default" version of such functions to be defined.
Comment 1 Randy MacLeod 2023-10-30 15:37:26 UTC
Build move to 5.0 -- ../Randy
Comment 2 Randy MacLeod 2024-04-25 01:13:53 UTC
Bulk move of 5.0 medium importance issues to 5.99.
Move to 5.1 if you want to actively work on an issue.
Comment 3 Randy MacLeod 2024-04-25 01:23:11 UTC
Move to 5.99 since no one is actively working on this issue.
Move to 5.x if you start on a task, please.