public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Paul Barker <paul@pbarker.dev>
To: "Marko, Peter" <Peter.Marko@siemens.com>,
	 "openembedded-core@lists.openembedded.org"
	<openembedded-core@lists.openembedded.org>
Cc: Alexander Kanavin <alex.kanavin@gmail.com>
Subject: Re: [OE-core] [PATCH] pseudo: Add hard sstate dependencies for pseudo-native
Date: Mon, 03 Nov 2025 18:40:00 +0000	[thread overview]
Message-ID: <40ce73594b181aae5b257455efea360186b35ec0.camel@pbarker.dev> (raw)
In-Reply-To: <AS1PR10MB569703DA3934BF136F05AF3BFDFDA@AS1PR10MB5697.EURPRD10.PROD.OUTLOOK.COM>

[-- Attachment #1: Type: text/plain, Size: 3931 bytes --]

On Tue, 2025-10-28 at 14:02 +0000, Marko, Peter wrote:
> 
> > -----Original Message-----
> > From: openembedded-core@lists.openembedded.org <openembedded-
> > core@lists.openembedded.org> On Behalf Of Paul Barker
> > Sent: Thursday, October 16, 2025 21:11
> > To: openembedded-core@lists.openembedded.org
> > Cc: Alexander Kanavin <alex.kanavin@gmail.com>; Paul Barker
> > <paul@pbarker.dev>
> > Subject: [OE-core] [PATCH] pseudo: Add hard sstate dependencies for pseudo-
> > native
> > 
> > Where a task (such as do_package) runs under fakeroot, the corresponding
> > setscene task (do_package_setscene) will also run under fakeroot when
> > restoring from sstate. Assuming pseudo is used as the fakeroot
> > implementation, we need pseudo-native and all its runtime dependencies
> > to be available in the sysroot before running any setscene tasks under
> > fakeroot.
> > 
> > We already add a hard dependency from all do_package_setscene tasks to
> > virtual/fakeroot-native:do_populate_sysroot in base.bbclass, but this
> > does not cover transitive dependencies. So, extend the dependencies of
> > pseudo-native:do_populate_sysroot_setscene to ensure that the sqlite3
> > library and attr binaries are also available in the sysroot before
> > running fakeroot setscene tasks.
> > 
> > [YOCTO #15963]
> > 
> > Signed-off-by: Paul Barker <paul@pbarker.dev>
> > ---
> >  meta/recipes-devtools/pseudo/pseudo.inc | 7 +++++++
> >  1 file changed, 7 insertions(+)
> > 
> > diff --git a/meta/recipes-devtools/pseudo/pseudo.inc b/meta/recipes-
> > devtools/pseudo/pseudo.inc
> > index 22c934977d9b..82499cdd74da 100644
> > --- a/meta/recipes-devtools/pseudo/pseudo.inc
> > +++ b/meta/recipes-devtools/pseudo/pseudo.inc
> > @@ -155,3 +155,10 @@ do_install:append:class-nativesdk () {
> >  }
> > 
> >  BBCLASSEXTEND = "native nativesdk"
> > +
> > +# Setscene tasks which run under fakeroot must not be executed before
> > +# pseudo-native and *all* its runtime dependencies are available in the
> > +# sysroot.
> > +PSEUDO_SETSCENE_DEPS = ""
> > +PSEUDO_SETSCENE_DEPS:class-native = "sqlite3-native:do_populate_sysroot
> > attr-native:do_populate_sysroot"
> 
> I have a doubt here.
> 
> $ grep -rI 'setscene[[]depends[]]'
> bitbake/lib/bb/tests/runqueue-tests/recipes/d1.bb:do_package_setscene[depends] = "a1:do_populate_sysroot_setscene"
> bitbake/lib/bb/runqueue.py:    # e.g. do_sometask_setscene[depends] = "targetname:do_someothertask_setscene"
> meta/classes/useradd.bbclass:do_package_setscene[depends] += "${USERADDSETSCENEDEPS}"
> meta/classes/useradd.bbclass:do_populate_sysroot_setscene[depends] += "${USERADDSETSCENEDEPS}"
> meta/recipes-core/sysvinit/sysvinit_3.14.bb:do_package_setscene[depends] = "${MLPREFIX}base-passwd:do_populate_sysroot"
> 
> useradd.bbclass with USERADDSETSCENEDEPS also resolves into depending on setscene tasks.
> 
> So tests and useradd depend on setscene which is also documented and handled in requeue.
> To me it looks like sysvinit (where this fix for pseudo was presumable coped from) uses wrong task dependency which works only by chance.
> But this is deep bitbake stuff which may have special nuances.
> What is the difference between using these two variants?

The hard setscene dependency on do_populate_sysroot definitely works, it's used
in base.bbclass for do_package_setscene:

    d.appendVarFlag('do_package_setscene', 'depends', ' virtual/fakeroot-native:do_populate_sysroot')

And looking in runqueue.py in bitbake, there is a line to trim '_setscene' off
the end of the task we're depending on if it is present:

    deptid = depfn + ":" + idependtask.replace("_setscene", "")

So both variants work and result in the same hard dependencies within bitbake.
As "_setscene" is removed if present, I'd say it's slightly more correct to
specify the dependency without it.

Thanks,

-- 
Paul Barker

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

  reply	other threads:[~2025-11-03 18:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-16 19:11 [PATCH] pseudo: Add hard sstate dependencies for pseudo-native Paul Barker
2025-10-18 11:35 ` [OE-core] " Gyorgy Sarvari
2025-10-28 14:02 ` Marko, Peter
2025-11-03 18:40   ` Paul Barker [this message]
2025-11-03 19:46 ` Paul Barker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40ce73594b181aae5b257455efea360186b35ec0.camel@pbarker.dev \
    --to=paul@pbarker.dev \
    --cc=Peter.Marko@siemens.com \
    --cc=alex.kanavin@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox