From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: alex.kanavin@gmail.com, pmi183@gmail.com
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH] buildhistory: Fix do_package race issues
Date: Wed, 29 May 2024 23:35:14 +0100 [thread overview]
Message-ID: <9cecd2e09e975a1289a8862bddb35592ebd57745.camel@linuxfoundation.org> (raw)
In-Reply-To: <CANNYZj8tYDfh8r3QLtKoaQNUeiEy177PDxt88ao0Uce5y8fAeQ@mail.gmail.com>
On Wed, 2024-05-29 at 14:17 +0200, Alexander Kanavin via lists.openembedded.org wrote:
> On Wed, 29 May 2024 at 13:57, pmi183 via lists.openembedded.org
> <pmi183=gmail.com@lists.openembedded.org> wrote:
>
> > Patch 1 - fixes race condition detected while executing functions registered on `SSTATEPOSTINSTFUNCS`
>
> The patches needs to be sent as separate messages in a series, like
> every other patch submitted here ('git send-email' does it).
>
> > ---
> > meta/classes-global/sstate.bbclass | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/meta/classes-global/sstate.bbclass b/meta/classes-global/sstate.bbclass
> > index 76a7b59636..9887169e4f 100644
> > --- a/meta/classes-global/sstate.bbclass
> > +++ b/meta/classes-global/sstate.bbclass
> > @@ -403,7 +403,6 @@ def sstate_installpkgdir(ss, d):
> > for state in ss['dirs']:
> > prepdir(state[1])
> > bb.utils.rename(sstateinst + state[0], state[1])
> > - sstate_install(ss, d)
> >
> > for plain in ss['plaindirs']:
> > workdir = d.getVar('WORKDIR')
> > @@ -416,6 +415,8 @@ def sstate_installpkgdir(ss, d):
> > prepdir(dest)
> > bb.utils.rename(src, dest)
> >
> > + sstate_install(ss, d)
> > +
> > return True
> >
> > python sstate_hardcode_path_unpack () {
>
> sstate.bbclass is a highly sensitive piece in yocto, and any changes
> need to be strictly justified. Specifically, you need to explain what
> is racing against each other, demonstrate how to reproduce and observe
> the problem that the patch is fixing, and (ideally) provide a test
> case (in oe-selftest) that fails without the change and passes with
> it.
I did look at the sstate code and this part of the problem
specifically. I think there is an issue here and this probably is the
nearly the right fix.
This is the only call site for sstate_install and the "for plain in
ss['plaindirs']:" block probably needs to move into sstate_install
before the SSTATEPOSTINSTFUNCS function calls. I say that as the code
is then within the lock operations. It probably doesn't technically
need to be but it would be what most users would expect.
I'm not sure we've ever guaranteed that SSTATEPOSTINSTFUNCS can see
plaindirs but the buildhistory code clearly depends on that. Quite
often that would happen to work but I can see "from sstate" codepaths
where it wouldn't.
I haven't looked into the other patches in much detail but I did notice
that patch 2 has shell whitespace problems that one of the later
patches fixes.
Cheers,
Richard
prev parent reply other threads:[~2024-05-29 22:35 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-23 13:59 [PATCH] buildhistory: Fix do_package race issues Richard Purdie
2021-11-23 14:19 ` [OE-core] " Alexander Kanavin
2024-05-13 9:47 ` pmi183
2024-05-13 9:51 ` [OE-core] " Alexander Kanavin
2024-05-13 10:05 ` pmi183
2024-05-13 11:01 ` [OE-core] " Alexander Kanavin
2024-05-15 9:36 ` pmi183
2024-05-15 10:07 ` [OE-core] " Alexander Kanavin
2024-05-20 8:10 ` pmi183
2024-05-20 11:12 ` [OE-core] " Jose Quaresma
2024-05-21 10:24 ` Alexander Kanavin
2024-05-23 15:24 ` pmi183
2024-05-23 15:24 ` pmi183
[not found] ` <Groupsio.1.30216.1716477852755796076@lists.openembedded.org>
2024-05-24 8:13 ` [OE-core] " Alexander Kanavin
2024-05-29 8:56 ` pmi183
2024-05-29 9:01 ` pmi183
2024-05-29 10:22 ` [OE-core] " Alexander Kanavin
2024-05-29 11:57 ` pmi183
2024-05-29 12:17 ` [OE-core] " Alexander Kanavin
2024-05-29 22:35 ` Richard Purdie [this message]
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=9cecd2e09e975a1289a8862bddb35592ebd57745.camel@linuxfoundation.org \
--to=richard.purdie@linuxfoundation.org \
--cc=alex.kanavin@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=pmi183@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.