diff mbox series

scarthgap: kernel build failure

Message ID 918f936e-68b2-449d-9521-3507c25f0a8b@electromag.com.au
State Not Applicable
Delegated to: Steve Sakoman
Headers show
Series scarthgap: kernel build failure | expand

Commit Message

Phil Reid Sept. 27, 2024, 12:59 a.m. UTC
G'day All,


Just started migrating our layer to scarthgap and ran into an issue building the kernel.
We maintian a local git repo with a custom branch with all our patches and build from that.
So no KMETA layer. In addition we're building a couple of kernels and packaging them into the image.
We're using linux-dummy kernel for the image and then building the kernel using bitbake.
Possibly the problem is we're doing something the wrong(tm) way.
  

Anyway after migrating we get the following when building a kernel.

================================
NOTE: Executing Tasks
ERROR: linux-tst-6.6.52+git-r0 do_kernel_configme: A KBUILD_DEFCONFIG 'socfpga_defconfig' was specified, but not present in the source tree (/home/preid/dev/v2024.09/tmp-glibc/work/cyclone5-emit-linux-gnueabi/linux-tst/6.6.52+git/kernel-source/arch/arm/configs/)
ERROR: linux-tst-6.6.52+git-r0 do_kernel_configme: ExecutionError('/home/preid/dev/v2024.09/tmp-glibc/work/cyclone5-emit-linux-gnueabi/linux-tst/6.6.52+git/temp/run.do_kernel_configme.8888', 1, None, None)
ERROR: Logfile of failure stored in: /home/preid/dev/v2024.09/tmp-glibc/work/cyclone5-emit-linux-gnueabi/linux-tst/6.6.52+git/temp/log.do_kernel_configme.8888
ERROR: Task (/home/preid/dev/v2024.09/layers/meta-emit/recipes/emit-linux/linux-tst_6.6.bb:do_kernel_configme) failed with exit code '1'
NOTE: Tasks Summary: Attempted 989 tasks of which 973 didn't need to be rerun and 1 failed.
NOTE: Writing buildhistory
NOTE: Writing buildhistory took: 1 seconds

Summary: 1 task failed:
   /home/preid/dev/v2024.09/layers/meta-emit/recipes/emit-linux/linux-tst_6.6.bb:do_kernel_configme
================================


I've managed to trace the change in behaviour to a change in archiver.bbclass.
Reverting the change to is_work_shared and everything is happy.

================================
================================




And here's a small reproducer kernel bb.
I've tested this with cyclone5 machine.

================================
KBRANCH ?= "v6.6/standard/base"

require recipes-kernel/linux/linux-yocto.inc

# CVE exclusions
include recipes-kernel/linux/cve-exclusion.inc
include recipes-kernel/linux/cve-exclusion_6.6.inc

# board specific branches
SRCREV_machine ?= "561bbd55f91a8e94576ca3fbf35a0c99ff70d4b2"

SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;name=machine;branch=${KBRANCH};protocol=https"

LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
LINUX_VERSION ?= "6.6.52"

PV = "${LINUX_VERSION}+git"

KCONF_BSP_AUDIT_LEVEL = "1"

COMPATIBLE_MACHINE = "^(qemux86-64|cyclone5)$"

# Functionality flags
KERNEL_FEATURES:append = " ${KERNEL_EXTRA_FEATURES}"

KERNEL_PACKAGE_NAME          = "kernel-tst"

KBUILD_DEFCONFIG:qemux86-64  = "x86_64_defconfig"
KCONFIG_MODE:qemux86-64      = "--alldefconfig"

KBUILD_DEFCONFIG:cyclone5    = "socfpga_defconfig"
KCONFIG_MODE:cyclone5        = "--alldefconfig"

=========================


The key trigger here I think is:
- PREFERRED_PROVIDER_virtual/kernel is not equal to the kernel package.
- KERNEL_PACKAGE_NAME is not equal to kernel

And therefore the source doesn't end up in work-shared.
But something somewhere expects the kernel-source folder to be in work-shared
and ends up deleting the kernel-source folder

After do_patch the kernel-source still contains the source files.
The git checkout folder has gone by this step.

Then during do_unpack_and_patch the kernel-source folder is cleaned of all files.
They've been moved to archiver-work/git

And after that kernel-source is empty.


So is the method we're using to build the kernel still supported?
Or are we doing something wrong...

Comments

patchtest@automation.yoctoproject.org Sept. 27, 2024, 1:18 a.m. UTC | #1
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/scarthgap-kernel-build-failure.patch

FAIL: test Signed-off-by presence: Mbox is missing Signed-off-by. Add it manually or with "git commit --amend -s" (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)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)

SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: pretest src uri left files: Patch cannot be merged (test_metadata.TestMetadata.pretest_src_uri_left_files)
SKIP: test CVE check ignore: No modified recipes or older target branch, 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: Patch cannot be merged (test_metadata.TestMetadata.test_src_uri_left_files)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)

---

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!
Phil Reid Sept. 27, 2024, 1:47 a.m. UTC | #2
patchtest has inadvertently detected the email question as a patch.
Email did contain a diff, but it was part of the query into the problem being encountered.


On 27/09/2024 09:18, patchtest@automation.yoctoproject.org wrote:
> 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/scarthgap-kernel-build-failure.patch
> 
> FAIL: test Signed-off-by presence: Mbox is missing Signed-off-by. Add it manually or with "git commit --amend -s" (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)
> PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
> PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)
> 
> SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
> SKIP: pretest src uri left files: Patch cannot be merged (test_metadata.TestMetadata.pretest_src_uri_left_files)
> SKIP: test CVE check ignore: No modified recipes or older target branch, 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: Patch cannot be merged (test_metadata.TestMetadata.test_src_uri_left_files)
> SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)
> 
> ---
> 
> 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!
> 
>
Jose Quaresma Sept. 27, 2024, 8:51 a.m. UTC | #3
Phil Reid via lists.openembedded.org <preid=
electromag.com.au@lists.openembedded.org> escreveu (sexta, 27/09/2024 à(s)
01:59):

> G'day All,
>
>
> Just started migrating our layer to scarthgap and ran into an issue
> building the kernel.
> We maintian a local git repo with a custom branch with all our patches and
> build from that.
> So no KMETA layer. In addition we're building a couple of kernels and
> packaging them into the image.
> We're using linux-dummy kernel for the image and then building the kernel
> using bitbake.
> Possibly the problem is we're doing something the wrong(tm) way.
>
>
> Anyway after migrating we get the following when building a kernel.
>
> ================================
> NOTE: Executing Tasks
> ERROR: linux-tst-6.6.52+git-r0 do_kernel_configme: A KBUILD_DEFCONFIG
> 'socfpga_defconfig' was specified, but not present in the source tree
> (/home/preid/dev/v2024.09/tmp-glibc/work/cyclone5-emit-linux-gnueabi/linux-tst/6.6.52+git/kernel-source/arch/arm/configs/)
> ERROR: linux-tst-6.6.52+git-r0 do_kernel_configme:
> ExecutionError('/home/preid/dev/v2024.09/tmp-glibc/work/cyclone5-emit-linux-gnueabi/linux-tst/6.6.52+git/temp/run.do_kernel_configme.8888',
> 1, None, None)
> ERROR: Logfile of failure stored in:
> /home/preid/dev/v2024.09/tmp-glibc/work/cyclone5-emit-linux-gnueabi/linux-tst/6.6.52+git/temp/log.do_kernel_configme.8888
> ERROR: Task
> (/home/preid/dev/v2024.09/layers/meta-emit/recipes/emit-linux/linux-tst_6.6.bb:do_kernel_configme)
> failed with exit code '1'
> NOTE: Tasks Summary: Attempted 989 tasks of which 973 didn't need to be
> rerun and 1 failed.
> NOTE: Writing buildhistory
> NOTE: Writing buildhistory took: 1 seconds
>
> Summary: 1 task failed:
>
>  /home/preid/dev/v2024.09/layers/meta-emit/recipes/emit-linux/linux-tst_6.6.bb:
> do_kernel_configme
> ================================
>
>
> I've managed to trace the change in behaviour to a change in
> archiver.bbclass.
> Reverting the change to is_work_shared and everything is happy.
>
> ================================
> diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
> index 9d286224d6..9bac870449 100644
> --- a/meta/classes/archiver.bbclass
> +++ b/meta/classes/archiver.bbclass
> @@ -472,9 +472,10 @@ def create_diff_gz(d, src_orig, src, ar_outdir):
>           os.chdir(cwd)
>
>   def is_work_shared(d):
> -    sharedworkdir = os.path.join(d.getVar('TMPDIR'), 'work-shared')
> -    sourcedir = os.path.realpath(d.getVar('S'))
> -    return sourcedir.startswith(sharedworkdir)
> +    pn = d.getVar('PN')
> +    return pn.startswith('gcc-source') or \
> +        bb.data.inherits_class('kernel', d) or \
> +        (bb.data.inherits_class('kernelsrc', d) and
> d.expand("${TMPDIR}/work-shared") in d.getVar('S'))
>

Looks like the issue comes from the archiver.bbclass but you may be misled
by that very fact.
Can you try to build the kernel without the archiver?

INHERIT:remove = "archiver"

This just confirms if there are no more problems.
If everything is fine, the problem is really with the archiver.bbclass.
However, I use the archiver.bbclass daily with several bsp in my distro and
I have no problems.

Jose



>
>   # Run do_unpack and do_patch
>   python do_unpack_and_patch() {
> ================================
>
>
>
>
> And here's a small reproducer kernel bb.
> I've tested this with cyclone5 machine.
>
> ================================
> KBRANCH ?= "v6.6/standard/base"
>
> require recipes-kernel/linux/linux-yocto.inc
>
> # CVE exclusions
> include recipes-kernel/linux/cve-exclusion.inc
> include recipes-kernel/linux/cve-exclusion_6.6.inc
>
> # board specific branches
> SRCREV_machine ?= "561bbd55f91a8e94576ca3fbf35a0c99ff70d4b2"
>
> SRC_URI = "git://
> git.yoctoproject.org/linux-yocto.git;name=machine;branch=${KBRANCH};protocol=https
> <http://git.yoctoproject.org/linux-yocto.git;name=machine;branch=$%7BKBRANCH%7D;protocol=https>
> "
>
> LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
> LINUX_VERSION ?= "6.6.52"
>
> PV = "${LINUX_VERSION}+git"
>
> KCONF_BSP_AUDIT_LEVEL = "1"
>
> COMPATIBLE_MACHINE = "^(qemux86-64|cyclone5)$"
>
> # Functionality flags
> KERNEL_FEATURES:append = " ${KERNEL_EXTRA_FEATURES}"
>
> KERNEL_PACKAGE_NAME          = "kernel-tst"
>
> KBUILD_DEFCONFIG:qemux86-64  = "x86_64_defconfig"
> KCONFIG_MODE:qemux86-64      = "--alldefconfig"
>
> KBUILD_DEFCONFIG:cyclone5    = "socfpga_defconfig"
> KCONFIG_MODE:cyclone5        = "--alldefconfig"
>
> =========================
>
>
> The key trigger here I think is:
> - PREFERRED_PROVIDER_virtual/kernel is not equal to the kernel package.
> - KERNEL_PACKAGE_NAME is not equal to kernel
>
> And therefore the source doesn't end up in work-shared.
> But something somewhere expects the kernel-source folder to be in
> work-shared
> and ends up deleting the kernel-source folder
>
> After do_patch the kernel-source still contains the source files.
> The git checkout folder has gone by this step.
>
> Then during do_unpack_and_patch the kernel-source folder is cleaned of all
> files.
> They've been moved to archiver-work/git
>
> And after that kernel-source is empty.
>
>
> So is the method we're using to build the kernel still supported?
> Or are we doing something wrong...
>
>
>
> --
> Regards
> Phil Reid
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#205001):
> https://lists.openembedded.org/g/openembedded-core/message/205001
> Mute This Topic: https://lists.openembedded.org/mt/108679274/5052612
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> quaresma.jose@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
Trevor Gamblin Sept. 27, 2024, 12:17 p.m. UTC | #4
On 2024-09-26 21:47, Phil Reid via lists.openembedded.org wrote:
> patchtest has inadvertently detected the email question as a patch.
> Email did contain a diff, but it was part of the query into the 
> problem being encountered.

Seems like maybe I should tweak it so it also check for a [PATCH] tag in 
the subject line.

Thanks!

>
>
> On 27/09/2024 09:18, patchtest@automation.yoctoproject.org wrote:
>> 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/scarthgap-kernel-build-failure.patch
>>
>> FAIL: test Signed-off-by presence: Mbox is missing Signed-off-by. Add 
>> it manually or with "git commit --amend -s" 
>> (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)
>> PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
>> PASS: test target mailing list 
>> (test_mbox.TestMbox.test_target_mailing_list)
>>
>> SKIP: pretest pylint: No python related patches, skipping test 
>> (test_python_pylint.PyLint.pretest_pylint)
>> SKIP: pretest src uri left files: Patch cannot be merged 
>> (test_metadata.TestMetadata.pretest_src_uri_left_files)
>> SKIP: test CVE check ignore: No modified recipes or older target 
>> branch, 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: Patch cannot be merged 
>> (test_metadata.TestMetadata.test_src_uri_left_files)
>> SKIP: test summary presence: No added recipes, skipping test 
>> (test_metadata.TestMetadata.test_summary_presence)
>>
>> ---
>>
>> 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!
>>
>>
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#205003): https://lists.openembedded.org/g/openembedded-core/message/205003
> Mute This Topic: https://lists.openembedded.org/mt/108679490/7611679
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [tgamblin@baylibre.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Steve Sakoman Sept. 27, 2024, 1:18 p.m. UTC | #5
On Fri, Sep 27, 2024 at 5:17 AM Trevor Gamblin via
lists.openembedded.org <tgamblin=baylibre.com@lists.openembedded.org>
wrote:
>
>
> On 2024-09-26 21:47, Phil Reid via lists.openembedded.org wrote:
> > patchtest has inadvertently detected the email question as a patch.
> > Email did contain a diff, but it was part of the query into the
> > problem being encountered.
>
> Seems like maybe I should tweak it so it also check for a [PATCH] tag in
> the subject line.

Not sure that is a good idea!  People don't always include PATCH in
the subject line.

I think I'd rather have the occasional  patchtest error than have
patches not checked.

Steve

> > On 27/09/2024 09:18, patchtest@automation.yoctoproject.org wrote:
> >> 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/scarthgap-kernel-build-failure.patch
> >>
> >> FAIL: test Signed-off-by presence: Mbox is missing Signed-off-by. Add
> >> it manually or with "git commit --amend -s"
> >> (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)
> >> PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
> >> PASS: test target mailing list
> >> (test_mbox.TestMbox.test_target_mailing_list)
> >>
> >> SKIP: pretest pylint: No python related patches, skipping test
> >> (test_python_pylint.PyLint.pretest_pylint)
> >> SKIP: pretest src uri left files: Patch cannot be merged
> >> (test_metadata.TestMetadata.pretest_src_uri_left_files)
> >> SKIP: test CVE check ignore: No modified recipes or older target
> >> branch, 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: Patch cannot be merged
> >> (test_metadata.TestMetadata.test_src_uri_left_files)
> >> SKIP: test summary presence: No added recipes, skipping test
> >> (test_metadata.TestMetadata.test_summary_presence)
> >>
> >> ---
> >>
> >> 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!
> >>
> >>
> >
> >
> >
> >
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#205017): https://lists.openembedded.org/g/openembedded-core/message/205017
> Mute This Topic: https://lists.openembedded.org/mt/108679490/3620601
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [steve@sakoman.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Phil Reid Sept. 27, 2024, 2:27 p.m. UTC | #6
G'day José,

On 27/09/2024 16:51, Jose Quaresma wrote:
> 
> 
> Phil Reid via lists.openembedded.org <http://lists.openembedded.org> <preid=electromag.com.au@lists.openembedded.org <mailto:electromag.com.au@lists.openembedded.org>> escreveu (sexta, 27/09/2024 à(s) 01:59):
> 
>     G'day All,
> 
> 
>     Just started migrating our layer to scarthgap and ran into an issue building the kernel.
>     We maintian a local git repo with a custom branch with all our patches and build from that.
>     So no KMETA layer. In addition we're building a couple of kernels and packaging them into the image.
>     We're using linux-dummy kernel for the image and then building the kernel using bitbake.
>     Possibly the problem is we're doing something the wrong(tm) way.
> 
> 
>     Anyway after migrating we get the following when building a kernel.
> 
>     ================================
>     NOTE: Executing Tasks
>     ERROR: linux-tst-6.6.52+git-r0 do_kernel_configme: A KBUILD_DEFCONFIG 'socfpga_defconfig' was specified, but not present in the source tree (/home/preid/dev/v2024.09/tmp-glibc/work/cyclone5-emit-linux-gnueabi/linux-tst/6.6.52+git/kernel-source/arch/arm/configs/)
>     ERROR: linux-tst-6.6.52+git-r0 do_kernel_configme: ExecutionError('/home/preid/dev/v2024.09/tmp-glibc/work/cyclone5-emit-linux-gnueabi/linux-tst/6.6.52+git/temp/run.do_kernel_configme.8888', 1, None, None)
>     ERROR: Logfile of failure stored in: /home/preid/dev/v2024.09/tmp-glibc/work/cyclone5-emit-linux-gnueabi/linux-tst/6.6.52+git/temp/log.do_kernel_configme.8888
>     ERROR: Task (/home/preid/dev/v2024.09/layers/meta-emit/recipes/emit-linux/linux-tst_6.6.bb:do_kernel_configme) failed with exit code '1'
>     NOTE: Tasks Summary: Attempted 989 tasks of which 973 didn't need to be rerun and 1 failed.
>     NOTE: Writing buildhistory
>     NOTE: Writing buildhistory took: 1 seconds
> 
>     Summary: 1 task failed:
>         /home/preid/dev/v2024.09/layers/meta-emit/recipes/emit-linux/linux-tst_6.6.bb:do_kernel_configme
>     ================================
> 
> 
>     I've managed to trace the change in behaviour to a change in archiver.bbclass.
>     Reverting the change to is_work_shared and everything is happy.
> 
>     ================================
>     diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
>     index 9d286224d6..9bac870449 100644
>     --- a/meta/classes/archiver.bbclass
>     +++ b/meta/classes/archiver.bbclass
>     @@ -472,9 +472,10 @@ def create_diff_gz(d, src_orig, src, ar_outdir):
>                os.chdir(cwd)
> 
>        def is_work_shared(d):
>     -    sharedworkdir = os.path.join(d.getVar('TMPDIR'), 'work-shared')
>     -    sourcedir = os.path.realpath(d.getVar('S'))
>     -    return sourcedir.startswith(sharedworkdir)
>     +    pn = d.getVar('PN')
>     +    return pn.startswith('gcc-source') or \
>     +        bb.data.inherits_class('kernel', d) or \
>     +        (bb.data.inherits_class('kernelsrc', d) and d.expand("${TMPDIR}/work-shared") in d.getVar('S'))
> 
> 
> Looks like the issue comes from the archiver.bbclass but you may be misled by that very fact.
> Can you try to build the kernel without the archiver?
> 
> INHERIT:remove = "archiver"

This didn't seem to do anything when I put it in the bb file

But removing archiver from the local / site conf file and the problem has gone away.
So I guess that narrows it down a little.

I'll try and track down the history of the change to is_work_shared next week to see if that enlightens me.
It allows me to progress with testing other parts of the update as well.

THanks
Phil



> 
> This just confirms if there are no more problems.
> If everything is fine, the problem is really with the archiver.bbclass.
> However, I use the archiver.bbclass daily with several bsp in my distro and I have no problems.
> 
> Jose
> 
> 
>        # Run do_unpack and do_patch
>        python do_unpack_and_patch() {
>     ================================
> 
> 
> 
> 
>     And here's a small reproducer kernel bb.
>     I've tested this with cyclone5 machine.
> 
>     ================================
>     KBRANCH ?= "v6.6/standard/base"
> 
>     require recipes-kernel/linux/linux-yocto.inc
> 
>     # CVE exclusions
>     include recipes-kernel/linux/cve-exclusion.inc
>     include recipes-kernel/linux/cve-exclusion_6.6.inc
> 
>     # board specific branches
>     SRCREV_machine ?= "561bbd55f91a8e94576ca3fbf35a0c99ff70d4b2"
> 
>     SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;name=machine;branch=${KBRANCH};protocol=https <http://git.yoctoproject.org/linux-yocto.git;name=machine;branch=$%7BKBRANCH%7D;protocol=https>"
> 
>     LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
>     LINUX_VERSION ?= "6.6.52"
> 
>     PV = "${LINUX_VERSION}+git"
> 
>     KCONF_BSP_AUDIT_LEVEL = "1"
> 
>     COMPATIBLE_MACHINE = "^(qemux86-64|cyclone5)$"
> 
>     # Functionality flags
>     KERNEL_FEATURES:append = " ${KERNEL_EXTRA_FEATURES}"
> 
>     KERNEL_PACKAGE_NAME          = "kernel-tst"
> 
>     KBUILD_DEFCONFIG:qemux86-64  = "x86_64_defconfig"
>     KCONFIG_MODE:qemux86-64      = "--alldefconfig"
> 
>     KBUILD_DEFCONFIG:cyclone5    = "socfpga_defconfig"
>     KCONFIG_MODE:cyclone5        = "--alldefconfig"
> 
>     =========================
> 
> 
>     The key trigger here I think is:
>     - PREFERRED_PROVIDER_virtual/kernel is not equal to the kernel package.
>     - KERNEL_PACKAGE_NAME is not equal to kernel
> 
>     And therefore the source doesn't end up in work-shared.
>     But something somewhere expects the kernel-source folder to be in work-shared
>     and ends up deleting the kernel-source folder
> 
>     After do_patch the kernel-source still contains the source files.
>     The git checkout folder has gone by this step.
> 
>     Then during do_unpack_and_patch the kernel-source folder is cleaned of all files.
>     They've been moved to archiver-work/git
> 
>     And after that kernel-source is empty.
> 
> 
>     So is the method we're using to build the kernel still supported?
>     Or are we doing something wrong...
> 
> 
> 
>     -- 
>     Regards
>     Phil Reid
> 
> 
> -- 
> Best regards,
> 
> José Quaresma
diff mbox series

Patch

diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index 9d286224d6..9bac870449 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -472,9 +472,10 @@  def create_diff_gz(d, src_orig, src, ar_outdir):
          os.chdir(cwd)
  
  def is_work_shared(d):
-    sharedworkdir = os.path.join(d.getVar('TMPDIR'), 'work-shared')
-    sourcedir = os.path.realpath(d.getVar('S'))
-    return sourcedir.startswith(sharedworkdir)
+    pn = d.getVar('PN')
+    return pn.startswith('gcc-source') or \
+        bb.data.inherits_class('kernel', d) or \
+        (bb.data.inherits_class('kernelsrc', d) and d.expand("${TMPDIR}/work-shared") in d.getVar('S'))
  
  # Run do_unpack and do_patch
  python do_unpack_and_patch() {