On Wed, 29 May 2024 at 13:57, pmi183 via lists.openembedded.org
<[email protected]> 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.

> Patch 2 - fixes `find` usage, avoiding hiding errors on the command execution 
> and creates buildhistory output folder if doesnt exist.
>  buildhistory_list_pkg_files() {
>         # Create individual files-in-package for each recipe's package
> -       for pkgdir in $(find ${PKGDEST}/* -maxdepth 0 -type d); do
> +    pkgdirlist=$(find ${PKGDEST}/* -maxdepth 0 -type d)
> +       for pkgdir in $pkgdirlist; do
>                 pkgname=$(basename $pkgdir)
>                 outfolder="${BUILDHISTORY_DIR_PACKAGE}/$pkgname"
>                 outfile="$outfolder/files-in-package.txt"
>                 # Make sure the output folder exists so we can create the file
> -               if [ ! -d $outfolder ] ; then
> -                       bbdebug 2 "Folder $outfolder does not exist, file 
> $outfile not created"
> -                       continue
> -               fi
> +        mkdir -p $outfolder
>                 buildhistory_list_files $pkgdir $outfile fakeroot
>         done

Indentation problems here. Is the folder is supposed to be created
elsewhere, and sometimes it is not? Why?

>  }
> --
> 2.25.1
>
> Patch 3 - fixes usage of 2 features combined, `BUILDHISTORY_PRESERVE` and 
> `BUILDHISTORY_RESET`, restoring files to buildhistory main folder.

Needs a better explanation too. What wasn't previously working? How
does the code change address it?

Don't be afraid to be verbose and write multiple paragraphs in your
commit messages.

> Patch 4 - adds unit tests to validate files-in-package.txt generation and 
> feature combination from patch 3.
> ---
>  meta/lib/oeqa/selftest/cases/buildoptions.py | 26 ++++++++++++++++++++
>  1 file changed, 26 insertions(+)
>
> diff --git a/meta/lib/oeqa/selftest/cases/buildoptions.py 
> b/meta/lib/oeqa/selftest/cases/buildoptions.py
> index 31dafaa9c5..e05bac7c6c 100644
> --- a/meta/lib/oeqa/selftest/cases/buildoptions.py
> +++ b/meta/lib/oeqa/selftest/cases/buildoptions.py
> @@ -176,6 +176,32 @@ class BuildhistoryTests(BuildhistoryBase):
>              self.assertEqual(data['FILELIST'], '')
>          self.assertEqual(int(data['PKGSIZE']), 0)
>
> +    def test_files_in_package_txt_creation(self):
> +        self.config_buildhistory()
> +        bitbake('xcursor-transparent-theme -c cleansstate')

Thanks for taking the trouble to write the tests, it's good to see.
Sadly cleansstate is not allowed in selftests because that operation
must be performed offline with no other builds running. Is it possible
to test without that?

Alex
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#200004): 
https://lists.openembedded.org/g/openembedded-core/message/200004
Mute This Topic: https://lists.openembedded.org/mt/87258776/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to