diff mbox series

meta-ide-support: depend recursively on populate_sysroot

Message ID 20240313174844.3580697-1-peter.marko@siemens.com
State New
Headers show
Series meta-ide-support: depend recursively on populate_sysroot | expand

Commit Message

Peter Marko March 13, 2024, 5:48 p.m. UTC
From: Peter Marko <peter.marko@siemens.com>

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.

Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
 meta/recipes-core/meta/meta-ide-support.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Richard Purdie March 13, 2024, 10:04 p.m. UTC | #1
On Wed, 2024-03-13 at 18:48 +0100, Peter Marko via
lists.openembedded.org wrote:
> From: Peter Marko <peter.marko@siemens.com>
> 
> 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.
> 
> Signed-off-by: Peter Marko <peter.marko@siemens.com>
> ---
>  meta/recipes-core/meta/meta-ide-support.bb | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-core/meta/meta-ide-support.bb
> b/meta/recipes-core/meta/meta-ide-support.bb
> index d85aa120c0..9aa87f3056 100644
> --- a/meta/recipes-core/meta/meta-ide-support.bb
> +++ b/meta/recipes-core/meta/meta-ide-support.bb
> @@ -37,4 +37,4 @@ do_deploy () {
>  
>  addtask deploy before do_build
>  
> -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
Peter Marko March 13, 2024, 11:16 p.m. UTC | #2
-----Original Message-----
From: Richard Purdie <richard.purdie@linuxfoundation.org> 
Sent: Wednesday, March 13, 2024 23:04
To: Marko, Peter (ADV D EU SK BFS1) <Peter.Marko@siemens.com>; openembedded-core@lists.openembedded.org
Subject: Re: [OE-core][PATCH] meta-ide-support: depend recursively on populate_sysroot

> On Wed, 2024-03-13 at 18:48 +0100, Peter Marko via
> lists.openembedded.org wrote:
> > From: Peter Marko <peter.marko@siemens.com>
> > 
> > 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.
> > 
> > Signed-off-by: Peter Marko <peter.marko@siemens.com>
> > ---
> >  meta/recipes-core/meta/meta-ide-support.bb | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/meta/recipes-core/meta/meta-ide-support.bb
> > b/meta/recipes-core/meta/meta-ide-support.bb
> > index d85aa120c0..9aa87f3056 100644
> > --- a/meta/recipes-core/meta/meta-ide-support.bb
> > +++ b/meta/recipes-core/meta/meta-ide-support.bb
> > @@ -37,4 +37,4 @@ do_deploy () {
> >  
> >  addtask deploy before do_build
> >  
> > -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

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
diff mbox series

Patch

diff --git a/meta/recipes-core/meta/meta-ide-support.bb b/meta/recipes-core/meta/meta-ide-support.bb
index d85aa120c0..9aa87f3056 100644
--- a/meta/recipes-core/meta/meta-ide-support.bb
+++ b/meta/recipes-core/meta/meta-ide-support.bb
@@ -37,4 +37,4 @@  do_deploy () {
 
 addtask deploy before do_build
 
-do_build[deptask] += "do_prepare_recipe_sysroot"
+do_build[recrdeptask] += "do_populate_sysroot"