kernel.bbclass: fix parsing error with KERNEL_SPLIT_MODULES = '0' and multilib enabled
PATCH 1/1 kernel.bbclass: fix parsing error with KERNEL_SPLIT_MODULES = '0' and multilib enabled
From: Chen Qi <[email protected]>
The problem could be reproduced with the following settings:
MACHINE = "qemux86-64"KERNEL_SPLIT_MODULES = "0"
require conf/multilib.conf
MULTILIBS ?= "multilib:lib32" DEFAULTTUNE:virtclass-multilib-lib32 ?= "core2-32"
The error message is as below:
bb.data_smart.ExpansionError: Failure expanding variable KERNEL_VERSION_PKG_NAME, expression was ${@legitimize_package_name(d.getVar('KERNEL_VERSION'))} which triggered exception TypeError: expected string or bytes-like object The variable dependency chain for the failure is: KERNEL_VERSION_PKG_NAME -> RPROVIDES:kernel-modules
This is because multilib_virtclass_handler_global function in multilib_global.bbclass deletes KERNEL_VERSION. So we need to handle such situation.
The KERNEL_VERSION is defined as:KERNEL_VERSION = "${@get_kernelversion_headers('${B}')}" So in a clean build directory, its initial value is "None". We should sync other settings to this value. If we use '', then what we'll get error like below with the above settings:
ERROR: Required build target 'core-image-minimal' has no buildable providers.
Missing or unbuildable dependency chain was: ['core-image-minimal', 'virtual/kernel', 'kernel-modules-none']
--- meta/classes-recipe/kernel.bbclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
meta/classes-recipe/kernel.bbclass +2 -2
@@ -44,9 +44,9 @@ INITRAMFS_MULTICONFIG ?= "" # number and cause kernel to be rebuilt. To avoid this, make # KERNEL_VERSION_NAME and KERNEL_VERSION_PKG_NAME depend on # LINUX_VERSION which is a constant. -KERNEL_VERSION_NAME = "${@d.getVar('KERNEL_VERSION') or ""}" +KERNEL_VERSION_NAME = "${@d.getVar('KERNEL_VERSION') or 'None'}" KERNEL_VERSION_NAME[vardepvalue] = "${LINUX_VERSION}" -KERNEL_VERSION_PKG_NAME = "${@legitimize_package_name(d.getVar('KERNEL_VERSION'))}" +KERNEL_VERSION_PKG_NAME = "${@legitimize_package_name(d.getVar('KERNEL_VERSION') or 'None')}" KERNEL_VERSION_PKG_NAME[vardepvalue] = "${LINUX_VERSION}" python __anonymous () {
Signature · 1 line
2.34.1
Patchtest results for [OE-core][PATCH] kernel.bbclass: fix parsing error with KERNEL_SPLIT_MODULES = '0' and multilib enabled
Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information:
---
Testing patch /home/patchtest/share/mboxes/kernel.bbclass-fix-parsing-error-with-KERNEL_SPLIT_MODULES-0-and-multilib-enabled.patch
FAIL: test shortlog length: Edit shortlog so that it is 90 characters or less (currently 94 characters) (test_mbox.TestMbox.test_shortlog_length)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test max line length (test_metadata.TestMetadata.test_max_line_length)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: pretest src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.pretest_src_uri_left_files)
SKIP: test CVE check ignore: No modified recipes, skipping test (test_metadata.TestMetadata.test_cve_check_ignore)
SKIP: test CVE tag format: No new CVE patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new CVE patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new CVE patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum modified not mentioned: No modified recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.test_src_uri_left_files)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)
SKIP: test target mailing list: Series merged, no reason to check other mailing lists (test_mbox.TestMbox.test_target_mailing_list)
---
Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you!
Quoted 37 lines · Chen Qi via lists.openembedded.org
From: Chen Qi <[email protected]>
The problem could be reproduced with the following settings:
MACHINE = "qemux86-64"KERNEL_SPLIT_MODULES= "0"
requireconf/multilib.conf
MULTILIBS ?= "multilib:lib32" DEFAULTTUNE:virtclass-multilib-lib32 ?= "core2-32"The error message is as below:
bb.data_smart.ExpansionError: Failure expanding variableKERNEL_VERSION_PKG_NAME, expression was ${@legitimize_package_name(d.getVar('KERNEL_VERSION'))} which triggered exception TypeError: expected string or bytes-like object The variable dependency chain for the failure is:KERNEL_VERSION_PKG_NAME-> RPROVIDES:kernel-modulesThis is because
multilib_virtclass_handler_globalfunction in multilib_global.bbclass deletesKERNEL_VERSION. So we need to handle such situation.The
KERNEL_VERSIONis defined as:KERNEL_VERSION= "${@get_kernelversion_headers('${B}')}" So in a clean build directory, its initial value is "None". We should sync other settings to this value. If we use '', then what we'll get error like below with the above settings:ERROR: Required build target 'core-image-minimal' has no buildable providers.
Missing or unbuildable dependency chain was: ['core-image-minimal', 'virtual/kernel', 'kernel-modules-none']Signed-off-by Chen Qi <[email protected]>--- meta/classes-recipe/kernel.bbclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)meta/classes-recipe/kernel.bbclass +0
-0@@ -44,9 +44,9 @@ INITRAMFS_MULTICONFIG ?= "" # number and cause kernel to be rebuilt. To avoid this, make
meta/classes-recipe/kernel.bbclass INITRAMFS_MULTICONFIG ?= "" · line 52
Quoted 10 lines
meta/classes-recipe/kernel.bbclass +2
-2# KERNEL_VERSION_NAME and KERNEL_VERSION_PKG_NAME depend on # LINUX_VERSION which is a constant. -KERNEL_VERSION_NAME = "${@d.getVar('KERNEL_VERSION') or ""}" +KERNEL_VERSION_NAME = "${@d.getVar('KERNEL_VERSION') or 'None'}" KERNEL_VERSION_NAME[vardepvalue] = "${LINUX_VERSION}" -KERNEL_VERSION_PKG_NAME = "${@legitimize_package_name(d.getVar('KERNEL_VERSION'))}" +KERNEL_VERSION_PKG_NAME = "${@legitimize_package_name(d.getVar('KERNEL_VERSION') or 'None')}" KERNEL_VERSION_PKG_NAME[vardepvalue] = "${LINUX_VERSION}" python __anonymous () {
I'd prefer not to have "None" floating around as a string value since that will likely cause other problems, perhaps not now but in the future.
Also, the kernel should have a version by the time packaging runs yet this seems to be avoiding that.
The code in multilib_global only operates on a copy of the datastore for local expansions and the idea is that it would leave ${KERNEL_VERSION} placeholders. Clearly this doesn't work for the avoid anonymous python pieces.
I wonder what happens if we also delete the above two variables there?
Cheers,
Richard
Quoted 56 lines · Richard Purdie
Quoted 37 lines · Chen Qi via lists.openembedded.org
From: Chen Qi <[email protected]>
The problem could be reproduced with the following settings:
MACHINE = "qemux86-64"KERNEL_SPLIT_MODULES= "0"
requireconf/multilib.conf
MULTILIBS ?= "multilib:lib32" DEFAULTTUNE:virtclass-multilib-lib32 ?= "core2-32"The error message is as below:
bb.data_smart.ExpansionError: Failure expanding variableKERNEL_VERSION_PKG_NAME, expression was ${@legitimize_package_name(d.getVar('KERNEL_VERSION'))} which triggered exception TypeError: expected string or bytes-like object The variable dependency chain for the failure is:KERNEL_VERSION_PKG_NAME-> RPROVIDES:kernel-modulesThis is because
multilib_virtclass_handler_globalfunction in multilib_global.bbclass deletesKERNEL_VERSION. So we need to handle such situation.The
KERNEL_VERSIONis defined as:KERNEL_VERSION= "${@get_kernelversion_headers('${B}')}" So in a clean build directory, its initial value is "None". We should sync other settings to this value. If we use '', then what we'll get error like below with the above settings:ERROR: Required build target 'core-image-minimal' has no buildable providers.
Missing or unbuildable dependency chain was: ['core-image-minimal', 'virtual/kernel', 'kernel-modules-none']Signed-off-by Chen Qi <[email protected]>--- meta/classes-recipe/kernel.bbclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)meta/classes-recipe/kernel.bbclass +0
-0@@ -44,9 +44,9 @@ INITRAMFS_MULTICONFIG ?= "" # number and cause kernel to be rebuilt. To avoid this, makemeta/classes-recipe/kernel.bbclass INITRAMFS_MULTICONFIG ?= "" · line 52
Quoted 10 lines
meta/classes-recipe/kernel.bbclass +2
-2# KERNEL_VERSION_NAME and KERNEL_VERSION_PKG_NAME depend on # LINUX_VERSION which is a constant. -KERNEL_VERSION_NAME = "${@d.getVar('KERNEL_VERSION') or ""}" +KERNEL_VERSION_NAME = "${@d.getVar('KERNEL_VERSION') or 'None'}" KERNEL_VERSION_NAME[vardepvalue] = "${LINUX_VERSION}" -KERNEL_VERSION_PKG_NAME = "${@legitimize_package_name(d.getVar('KERNEL_VERSION'))}" +KERNEL_VERSION_PKG_NAME = "${@legitimize_package_name(d.getVar('KERNEL_VERSION') or 'None')}" KERNEL_VERSION_PKG_NAME[vardepvalue] = "${LINUX_VERSION}" python __anonymous () {I'd prefer not to have "None" floating around as a string value since that will likely cause other problems, perhaps not now but in the future.
Also, the kernel should have a version by the time packaging runs yet this seems to be avoiding that.
Quoted 6 lines
The code in
multilib_globalonly operates on a copy of the datastore for local expansions and the idea is that it would leave ${KERNEL_VERSION} placeholders. Clearly this doesn't work for the avoid anonymous python pieces.I wonder what happens if we also delete the above two variables there?
It works. Thanks. I'll send out V2.
Regards,
Qi
Quoted 8 lines
Cheers,
Richard