Skip to contentSkip to conversation

meta-ide-support: depend recursively on populate_sysroot

PATCH In review Peter Marko 2 participants 3 messages Mar 13, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 meta-ide-support: depend recursively on populate_sysroot

From: Peter Marko <[email protected]>

Following workflow is broken when built from sstate-cache:
https://docs.yoctoproject.org/singleindex.html#setting-up-the-extensible-sdk-environment-directly-in-a-yocto-build
This is already broken in kirkstone.

Reproducer:

$ bitbake meta-ide-support && bitbake build-sysroots -c build_native_sysroot
$ ls -1 build/tmp/sysroots/*/*gdb-cross* && echo OK || echo FAIL # succeeds from scratch
build/tmp/sysroots/x86_64/manifest-x86_64-gdb-cross-x86_64.populate_sysroot
OK
$ rm -rf build/tmp
$ bitbake meta-ide-support && bitbake build-sysroots -c build_native_sysroot
$ ls -1 build/tmp/sysroots/*/*gdb-cross* && echo OK || echo FAIL # fails from sstate-cache
ls: cannot access 'build/tmp/sysroots/*/*gdb-cross*': No such file or directory
FAIL

build-sysroot populates sysroot with recipes which run populate_sysroot or populate_sysroot_setscene.
Dependency on its own populate_sysroot does not seem to work when building from sstate-cache as this task is not executed. This seem to becaused by inheriting nopackages class which deletes tasks thus messing the setscene dependencies.

Depend explicitly recursively on prepare_recipe_sysroot.

---
 meta/recipes-core/meta/meta-ide-support.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/meta/meta-ide-support.bb +1 -1
index d85aa120c0..9aa87f3056 100644
@@ -37,4 +37,4 @@ do_deploy () {
 
 addtask deploy before do_build
 
-do_build[deptask] += "do_prepare_recipe_sysroot"
+do_build[recrdeptask] += "do_populate_sysroot"
Signature · 1 line
2.30.2
#1 lore raw
Quoted 47 lines · Peter Marko via lists.openembedded.org

From: Peter Marko <[email protected]>

Following workflow is broken when built from sstate-cache:
https://docs.yoctoproject.org/singleindex.html#setting-up-the-extensible-sdk-environment-directly-in-a-yocto-build
This is already broken in kirkstone.

Reproducer:

$ bitbake meta-ide-support && bitbake build-sysroots -c
build_native_sysroot
$ ls -1 build/tmp/sysroots/*/*gdb-cross* && echo OK || echo FAIL #
succeeds from scratch
build/tmp/sysroots/x86_64/manifest-x86_64-gdb-cross-
x86_64.populate_sysroot
OK
$ rm -rf build/tmp
$ bitbake meta-ide-support && bitbake build-sysroots -c
build_native_sysroot
$ ls -1 build/tmp/sysroots/*/*gdb-cross* && echo OK || echo FAIL #
fails from sstate-cache
ls: cannot access 'build/tmp/sysroots/*/*gdb-cross*': No such file or
directory
FAIL

build-sysroot populates sysroot with recipes which run populate_sysroot or populate_sysroot_setscene. Dependency on its own populate_sysroot does not seem to work when building from sstate-cache as this task is not executed. This seem to becaused by inheriting nopackages class which deletes tasks
thus messing the setscene dependencies.

Depend explicitly recursively on prepare_recipe_sysroot.

---
 meta/recipes-core/meta/meta-ide-support.bb | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/meta/meta-ide-support.bb +0 -0
index d85aa120c0..9aa87f3056 100644
@@ -37,4 +37,4 @@ do_deploy () {


 addtask deploy before do_build

meta/recipes-core/meta/meta-ide-support.bb do_deploy () { · line 40

Quoted 2 lines
meta/recipes-core/meta/meta-ide-support.bb +1 -1
-do_build[deptask] += "do_prepare_recipe_sysroot"
+do_build[recrdeptask] += "do_populate_sysroot"

Whilst I can agree there is likely a problem, this does not look like the right fix. This is running a lot of other sstate task do_populate_sysroot tasks which we simply don't care about in the context of this recipe.

Which tasks is nopackages deleting which this recipe needs? Can we add in the missing dependencies that are needed?

Cheers,

Richard

#2 lore raw

-----Original Message-----
From: Richard Purdie <[email protected]>
Sent: Wednesday, March 13, 2024 23:04
To: Marko, Peter (ADV D EU SK BFS1) <[email protected]>; [email protected]
Subject: Re: [OE-core][PATCH] meta-ide-support: depend recursively on populate_sysroot

Quoted 57 lines
Quoted 47 lines · Peter Marko via lists.openembedded.org

From: Peter Marko <[email protected]>

Following workflow is broken when built from sstate-cache:
https://docs.yoctoproject.org/singleindex.html#setting-up-the-extensible-sdk-environment-directly-in-a-yocto-build
This is already broken in kirkstone.

Reproducer:

$ bitbake meta-ide-support && bitbake build-sysroots -c
build_native_sysroot
$ ls -1 build/tmp/sysroots/*/*gdb-cross* && echo OK || echo FAIL #
succeeds from scratch
build/tmp/sysroots/x86_64/manifest-x86_64-gdb-cross-
x86_64.populate_sysroot
OK
$ rm -rf build/tmp
$ bitbake meta-ide-support && bitbake build-sysroots -c
build_native_sysroot
$ ls -1 build/tmp/sysroots/*/*gdb-cross* && echo OK || echo FAIL #
fails from sstate-cache
ls: cannot access 'build/tmp/sysroots/*/*gdb-cross*': No such file or
directory
FAIL

build-sysroot populates sysroot with recipes which run populate_sysroot or populate_sysroot_setscene. Dependency on its own populate_sysroot does not seem to work when building from sstate-cache as this task is not executed. This seem to becaused by inheriting nopackages class which deletes tasks
thus messing the setscene dependencies.

Depend explicitly recursively on prepare_recipe_sysroot.

---
 meta/recipes-core/meta/meta-ide-support.bb | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/meta/meta-ide-support.bb +0 -0
index d85aa120c0..9aa87f3056 100644
@@ -37,4 +37,4 @@ do_deploy () {


 addtask deploy before do_build

meta/recipes-core/meta/meta-ide-support.bb do_deploy () { · line 40

Quoted 2 lines
meta/recipes-core/meta/meta-ide-support.bb +1 -1
-do_build[deptask] += "do_prepare_recipe_sysroot"
+do_build[recrdeptask] += "do_populate_sysroot"

Whilst I can agree there is likely a problem, this does not look like the right fix. This is running a lot of other sstate task do_populate_sysroot tasks which we simply don't care about in the context of this recipe.

Quoted 6 lines

Which tasks is nopackages deleting which this recipe needs? Can we add in the missing dependencies that are needed?

Cheers,

Richard

Unfortunately, I still can see the problem when I remove nopackages class.
I could swear that it worked for me before, but most probably I didn't run from sstate-cache.

Thinking about it again, I think that deptask is different from task ordering by addtask before/after. It is not run because it's covered by do_package_setscene.
This statement is based on fact that following patch also fixes this problem:
-do_build[deptask] += "do_prepare_recipe_sysroot"
+addtask prepare_recipe_sysroot after do_patch before do_build

I agree that root of this problem is hidden deeper in bitbake/setscene code, but I have no idea how to fix it at that level. So I could just offer to resubmit with an updated commit message if that would be acceptable (temporary) solution.

Peter