[OE-core] [PATCH] package.py: OEHasPackage: Add MLPREFIX to packagename

2023-12-23 Thread Saul Wold
FIXES [YOCTO #12342]

When testing a Multilib image, the package manifest list contains
the fully qualified package name which includes the Multilib Prefix.
This patch adds the MLPREFIX to the package names that are passed
into the @OEHasPackage() decorator to ensure the set isdisjoint()
matches correctly.

Signed-off-by: Saul Wold 
---
Tested with a lib32 image and without

 meta/lib/oeqa/runtime/decorator/package.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oeqa/runtime/decorator/package.py 
b/meta/lib/oeqa/runtime/decorator/package.py
index 8aba3f325bc..b78ac9fc388 100644
--- a/meta/lib/oeqa/runtime/decorator/package.py
+++ b/meta/lib/oeqa/runtime/decorator/package.py
@@ -38,11 +38,12 @@ class OEHasPackage(OETestDecorator):
 if isinstance(self.need_pkgs, str):
 self.need_pkgs = [self.need_pkgs,]
 
+mlprefix = self.case.td.get("MLPREFIX")
 for pkg in self.need_pkgs:
 if pkg.startswith('!'):
-unneed_pkgs.add(pkg[1:])
+unneed_pkgs.add(mlprefix + pkg[1:])
 else:
-need_pkgs.add(pkg)
+need_pkgs.add(mlprefix + pkg)
 
 if unneed_pkgs:
 msg = 'Checking if %s is not installed' % ', '.join(unneed_pkgs)
-- 
2.34.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#192889): 
https://lists.openembedded.org/g/openembedded-core/message/192889
Mute This Topic: https://lists.openembedded.org/mt/103342284/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-Core][PATCH] rust: Upgrade 1.71.1 -> 1.74.1

2023-12-23 Thread Alex Kiernan
On Sat, Dec 23, 2023 at 7:32 PM Alex Kiernan via
lists.openembedded.org 
wrote:
>
> On Fri, Dec 15, 2023 at 5:24 PM Khem Raj  wrote:
> >
> > On Fri, Dec 15, 2023 at 4:41 AM Alex Kiernan  wrote:
> > >
> > > On Thu, Dec 14, 2023 at 10:28 AM Ross Burton  wrote:
> > > >
> > > > On 13 Dec 2023, at 14:06, Richard Purdie via lists.openembedded.org 
> > > >  wrote:
> > > > > I've run this with this patch included:
> > > > >
> > > > > https://autobuilder.yoctoproject.org/typhoon/#/builders/117/builds/4082
> > > >
> > > > Same failure:
> > > >
> > > > https://autobuilder.yocto.io/pub/repro-fail/oe-reproducible-20231213-s13b67oz/packages/diff-html/
> > > >
> > > > Ross
> > >
> > > Thanks both.
> > >
> > > It does look like its just filename churn, but I cannot find where
> > > those names actually get generated :| Suspect this will be a report
> > > upstream and hope someone helps.
> > >
> >
> > I think its the cmdline options passed to compiler-builtins crate. So
> > looking closely at this crates build log can reveal the problem. If
> > somewhere we have builds
> > done in two different folders I can take a look
> >
>
> I think you're right... I've been looking in completely the wrong place :|
>

I think this is our problem:

https://github.com/rust-lang/cc-rs/commit/c4f414f449bb7cffba3bc923f277704d1d08a8ec

> --
> Alex Kiernan
>
> 
>


-- 
Alex Kiernan

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#192888): 
https://lists.openembedded.org/g/openembedded-core/message/192888
Mute This Topic: https://lists.openembedded.org/mt/103146651/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [kirkstone][PATCH] elfutils: Disable stringop-overflow warning for build host

2023-12-23 Thread Martin Jansa
From: Khem Raj 

Some distributions shipping gcc12 end up with stringop-overflow warnings
e.g.
/usr/include/bits/unistd.h:74:10: error: ‘__pread_alias’ specified size between 
9223372036854775813 and 18446744073709551615 exceeds maximum object size 
9223372036854775807 [-Werror=stringop-overflow=]
   74 |   return __glibc_fortify (pread, __nbytes, sizeof (char),
  |  ^~~

Until fixed, lets not treat this warning as hard error

MJ: this is needed e.g. on ubuntu 24.04 after gcc was upgraded
from 13.2.0-8ubuntu1 to 13.2.0-9ubuntu1 which includes
switch _FORTIFY_SOURCE to 3:

https://changelogs.ubuntu.com/changelogs/pool/main/g/gcc-13/gcc-13_13.2.0-9ubuntu1/changelog

elfutils config.log then shows:

configure:6762: checking whether to add -D_FORTIFY_SOURCE=2 to CFLAGS
configure:6779: gcc  -c -D_FORTIFY_SOURCE=2 
-isystem/work/x86_64-linux/elfutils-native/0.186-r0/recipe-sysroot-native/usr/include
 -O2 -pipe -Werror 
-isystem/work/x86_64-linux/elfutils-native/0.186-r0/recipe-sysroot-native/usr/include
 conftest.c >&5
: error: "_FORTIFY_SOURCE" redefined [-Werror]
: note: this is the location of the previous definition
cc1: all warnings being treated as errors
configure:6786: result: no

and -D_FORTIFY_SOURCE=2 missing in CFLAGS later causes the above error
in do_compile

Signed-off-by: Khem Raj 
Signed-off-by: Richard Purdie 
Signed-off-by: Martin Jansa 
---
 meta/recipes-devtools/elfutils/elfutils_0.186.bb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/recipes-devtools/elfutils/elfutils_0.186.bb 
b/meta/recipes-devtools/elfutils/elfutils_0.186.bb
index 46ee40cce6..d742a2e14e 100644
--- a/meta/recipes-devtools/elfutils/elfutils_0.186.bb
+++ b/meta/recipes-devtools/elfutils/elfutils_0.186.bb
@@ -35,6 +35,8 @@ PTEST_ENABLED:libc-musl = "0"
 
 EXTRA_OECONF = "--program-prefix=eu-"
 
+BUILD_CFLAGS += "-Wno-error=stringop-overflow"
+
 DEPENDS_BZIP2 = "bzip2-replacement-native"
 DEPENDS_BZIP2:class-target = "bzip2"
 
-- 
2.43.0


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#192887): 
https://lists.openembedded.org/g/openembedded-core/message/192887
Mute This Topic: https://lists.openembedded.org/mt/103339009/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-Core][PATCH] rust: Upgrade 1.71.1 -> 1.74.1

2023-12-23 Thread Alex Kiernan
On Fri, Dec 15, 2023 at 5:24 PM Khem Raj  wrote:
>
> On Fri, Dec 15, 2023 at 4:41 AM Alex Kiernan  wrote:
> >
> > On Thu, Dec 14, 2023 at 10:28 AM Ross Burton  wrote:
> > >
> > > On 13 Dec 2023, at 14:06, Richard Purdie via lists.openembedded.org 
> > >  wrote:
> > > > I've run this with this patch included:
> > > >
> > > > https://autobuilder.yoctoproject.org/typhoon/#/builders/117/builds/4082
> > >
> > > Same failure:
> > >
> > > https://autobuilder.yocto.io/pub/repro-fail/oe-reproducible-20231213-s13b67oz/packages/diff-html/
> > >
> > > Ross
> >
> > Thanks both.
> >
> > It does look like its just filename churn, but I cannot find where
> > those names actually get generated :| Suspect this will be a report
> > upstream and hope someone helps.
> >
>
> I think its the cmdline options passed to compiler-builtins crate. So
> looking closely at this crates build log can reveal the problem. If
> somewhere we have builds
> done in two different folders I can take a look
>

I think you're right... I've been looking in completely the wrong place :|

-- 
Alex Kiernan

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#192886): 
https://lists.openembedded.org/g/openembedded-core/message/192886
Mute This Topic: https://lists.openembedded.org/mt/103146651/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH 2/2] appstream: update 0.16.3 -> 1.0.1

2023-12-23 Thread Alexandre Belloni via lists.openembedded.org
On 23/12/2023 09:57:51+0100, Alexander Kanavin wrote:
> Thanks, there's a working patch from Markus that just landed in master.
> 

Yes, I tested it earlier but you had a better version ;)

> Alex
> 
> On Sat, 23 Dec 2023 at 05:56, Alexandre Belloni
>  wrote:
> >
> >
> > https://autobuilder.yoctoproject.org/typhoon/#/builders/108/builds/5512/steps/12/logs/errors
> >
> > On 22/12/2023 11:46:31+0100, Alexander Kanavin wrote:
> > > Signed-off-by: Alexander Kanavin 
> > > ---
> > >  ...-meson-do-not-rely-on-an-exe-wrapper.patch | 36 ---
> > >  .../0001-remove-hardcoded-path.patch  | 28 ---
> > >  ...appstream_0.16.3.bb => appstream_1.0.1.bb} | 10 +++---
> > >  3 files changed, 19 insertions(+), 55 deletions(-)
> > >  delete mode 100644 
> > > meta/recipes-support/appstream/appstream/0001-meson-do-not-rely-on-an-exe-wrapper.patch
> > >  rename meta/recipes-support/appstream/{appstream_0.16.3.bb => 
> > > appstream_1.0.1.bb} (78%)
> > >
> > > diff --git 
> > > a/meta/recipes-support/appstream/appstream/0001-meson-do-not-rely-on-an-exe-wrapper.patch
> > >  
> > > b/meta/recipes-support/appstream/appstream/0001-meson-do-not-rely-on-an-exe-wrapper.patch
> > > deleted file mode 100644
> > > index d4f2951e7a9..000
> > > --- 
> > > a/meta/recipes-support/appstream/appstream/0001-meson-do-not-rely-on-an-exe-wrapper.patch
> > > +++ /dev/null
> > > @@ -1,36 +0,0 @@
> > > -From 79bf322768990b28c29a9d907edcca52ff48e0b8 Mon Sep 17 00:00:00 2001
> > > -From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 
> > > -Date: Wed, 26 Jul 2023 23:21:10 +0400
> > > -Subject: meson: do not rely on an exe wrapper
> > > -MIME-Version: 1.0
> > > -Content-Type: text/plain; charset=UTF-8
> > > -Content-Transfer-Encoding: 8bit
> > > -
> > > -Signed-off-by: Marc-André Lureau 
> > > -
> > > -Upstream-Status: Backport 
> > > [https://github.com/ximion/appstream/commit/79bf322768990b28c29a9d907edcca52ff48e0b8]
> > > 
> > > - data/meson.build | 7 +++
> > > - 1 file changed, 7 insertions(+)
> > > -
> > > -diff --git a/data/meson.build b/data/meson.build
> > > -index aea0cb25..ec0e434f 100644
> > >  a/data/meson.build
> > > -+++ b/data/meson.build
> > > -@@ -7,6 +7,13 @@ install_data('its/metainfo.its',
> > > - install_data('its/metainfo.loc',
> > > -   install_dir: join_paths(get_option('datadir'), 'gettext', 
> > > 'its'))
> > > -
> > > -+# Do not rely on an exe wrapper for rel-info, use the system one in 
> > > that case
> > > -+if meson.is_cross_build()
> > > -+dependency('appstream', version: '>=' + as_version, native: true,
> > > -+   not_found_message: 'Native appstream required for 
> > > cross-building')
> > > -+ascli_exe = find_program('appstreamcli')
> > > -+endif
> > > -+
> > > - # NOTE: We do not translate the release notes on purpose here.
> > > - # If you do want to give translators a chance to translate them,
> > > - # ascli news-to-metainfo needs to produce a temporary file to translate
> > > ---
> > > -2.41.0
> > > -
> > > diff --git 
> > > a/meta/recipes-support/appstream/appstream/0001-remove-hardcoded-path.patch
> > >  
> > > b/meta/recipes-support/appstream/appstream/0001-remove-hardcoded-path.patch
> > > index 9cbfaca82f1..8f4cf1b82a4 100644
> > > --- 
> > > a/meta/recipes-support/appstream/appstream/0001-remove-hardcoded-path.patch
> > > +++ 
> > > b/meta/recipes-support/appstream/appstream/0001-remove-hardcoded-path.patch
> > > @@ -1,4 +1,4 @@
> > > -From 6ab00a4279823829a9b82dc9e4d055da4de88c6e Mon Sep 17 00:00:00 2001
> > > +From 93bc5c1b221e5a10c65d4a055181dc818dfe1aa8 Mon Sep 17 00:00:00 2001
> > >  From: Markus Volk 
> > >  Date: Mon, 12 Dec 2022 15:42:42 +0100
> > >  Subject: [PATCH] remove hardcoded path
> > > @@ -9,23 +9,25 @@ Dont include hardcoded path. This fixes:
> > >  | cc1: error: include location "/usr/include" is unsafe for 
> > > cross-compilation [-Werror=poison-system-directories]
> > >
> > >  Upstream-Status: Inappropriate [oe-specific]
> > > +
> > >  ---
> > > - meson.build   | 2 +-
> > > - 1 files changed, 1 insertions(+), 1 deletions(-)
> > > + meson.build | 4 ++--
> > > + 1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > >  diff --git a/meson.build b/meson.build
> > > -index fd0e3373..2f273ada 100644
> > > +index 0556b1e..d66919f 100644
> > >  --- a/meson.build
> > >  +++ b/meson.build
> > > -@@ -124,7 +124,7 @@ if get_option ('gir')
> > > - dependency('gobject-introspection-1.0', version: '>=1.56')
> > > - endif
> > > -
> > > --stemmer_inc_dirs = include_directories(['/usr/include'])
> > > -+stemmer_inc_dirs = include_directories([''])
> > > +@@ -185,10 +185,10 @@ endif
> > > + stemmer_inc_dirs = include_directories()
> > >   if get_option('stemming')
> > >   stemmer_lib = cc.find_library('stemmer', required: true)
> > > +-stemmer_inc_dirs = include_directories(['/usr/include'])
> > > ++stemmer_inc_dirs = include_directories()
> > >   if not cc.has_header('libstemmer.h')
> > > ---
> > > 

[OE-Core][RFC PATCH v2] sstate-cache-management: Rewrite in python

2023-12-23 Thread Alex Kiernan
This (should be) a drop in replacement for sstate-cache-management.sh.

Signed-off-by: Alex Kiernan 
---
This is hopefully an option compatible drop in for the existing shell
sstate-cache-management script. It's orders of magnitude faster, for
example removing duplicates, with a warmed cache across a more or less
vanilla poky build:

shell: 24.55s
python: 0.63s

Running on an NFS mount with 1000s of objects the improvement is even
more marked.

There are differences in the lists of things which are removed, but all
examples I've found are things where the shell failed to remove things
it could.

There's an additional option to remove orphan siginfo files, which I
found quite a lot of during testing.

The --extra-archs and --extra-layer options are unimplemented since, as
far as I could work out, they were really implementation artefacts of
the existing script - there's a couple of functions I implemented which
generate this data, but I really couldn't see anywhere I actually needed
it; these want deleting if this goes beyond RFC.

Similary the --follow-symlink option is unimplemented as that appears to
an sstate-cache implementation detail which is no longer used.

The couple of TODOs left are all about more parallelisation, I expect
neither of them is as big a win as parallelising the stat()ing of all
the paths was (especially when running over NFS).

Changes in v2:
- Actually send the right version with working unlink() :|

 scripts/sstate-cache-management.py | 329 +
 1 file changed, 329 insertions(+)
 create mode 100755 scripts/sstate-cache-management.py

diff --git a/scripts/sstate-cache-management.py 
b/scripts/sstate-cache-management.py
new file mode 100755
index ..09b7aa2aefd8
--- /dev/null
+++ b/scripts/sstate-cache-management.py
@@ -0,0 +1,329 @@
+#!/usr/bin/env python3
+#
+# Copyright OpenEmbedded Contributors
+#
+# SPDX-License-Identifier: MIT
+#
+
+import argparse
+import os
+import re
+import sys
+
+from collections import defaultdict
+from concurrent.futures import ThreadPoolExecutor
+from dataclasses import dataclass
+from pathlib import Path
+
+if sys.version_info < (3, 8, 0):
+raise RuntimeError("Sorry, python 3.8.0 or later is required for this 
script.")
+
+SSTATE_PREFIX = "sstate:"
+SSTATE_EXTENSION = ".tar.zst"
+# SSTATE_EXTENSION = ".tgz"
+# .siginfo.done files are mentioned in the original script?
+SSTATE_SUFFIXES = (
+SSTATE_EXTENSION,
+f"{SSTATE_EXTENSION}.siginfo",
+f"{SSTATE_EXTENSION}.done",
+)
+
+RE_SSTATE_PKGSPEC = re.compile(
+rf"""sstate:(?P[^:]*):
+ (?P[^:]*):
+ (?P[^:]*):
+ (?P[^:]*):
+ (?P[^:]*):
+ (?P[^_]*):
+ (?P[^_]*)_
+ (?P[^:]*)
+ (?P({"|".join([re.escape(s) for s in SSTATE_SUFFIXES])}))$""",
+re.X,
+)
+
+
+# Really we'd like something like a Path subclass which implements a stat
+# cache here, unfortunately there's no good way to do that transparently
+# (yet); see:
+#
+# https://github.com/python/cpython/issues/70219
+# https://discuss.python.org/t/make-pathlib-extensible/3428/77
+@dataclass
+class SstateEntry:
+"""Class for keeping track of an entry in sstate-cache."""
+
+path: Path
+match: re.Match
+stat_result: os.stat_result = None
+
+def __hash__(self):
+return self.path.__hash__()
+
+def __getattr__(self, name):
+return self.match.group(name)
+
+
+# this is what's in the original script; as far as I can tell, it's an
+# implementation artefact which we don't need?
+def find_archs():
+# all_archs
+builder_arch = os.uname().machine
+
+# FIXME
+layer_paths = [Path("../..")]
+
+tune_archs = set()
+re_tune = re.compile(r'AVAILTUNES .*=.*"(.*)"')
+for path in layer_paths:
+for tunefile in [
+p for p in path.glob("meta*/conf/machine/include/**/*") if 
p.is_file()
+]:
+with open(tunefile) as f:
+for line in f:
+m = re_tune.match(line)
+if m:
+tune_archs.update(m.group(1).split())
+
+# all_machines
+machine_archs = set()
+for path in layer_paths:
+for machine_file in path.glob("meta*/conf/machine/*.conf"):
+machine_archs.add(machine_file.parts[-1][:-5])
+
+extra_archs = set()
+all_archs = (
+set(
+arch.replace("-", "_")
+for arch in machine_archs | tune_archs | set(["allarch", 
builder_arch])
+)
+| extra_archs
+)
+
+print(all_archs)
+
+
+# again, not needed?
+def find_tasks():
+print(set([p.bb_task for p in paths]))
+
+
+def collect_sstate_paths(args):
+def scandir(path, paths):
+# Assume everything is a directory; by not checking we avoid needing an
+# additional stat which is potentially a synchronous roundtrip over NFS
+try:
+for p in path.iterdir():
+filename = p.parts[-1]
+if 

[OE-Core][RFC PATCH] sstate-cache-management: Rewrite in python

2023-12-23 Thread Alex Kiernan
This (should be) a drop in replacement for sstate-cache-management.sh.
Signed-off-by: Alex Kiernan 
---
This is hopefully an option compatible drop in for the existing shell
sstate-cache-management script. It's orders of magnitude faster, for
example removing duplicates, with a warmed cache across a more or less
vanilla poky build:

shell: 24.55s
python: 0.63s

Running on an NFS mount with 1000s of objects the improvement is even
more marked.

There are differences in the lists of things which are removed, but all
examples I've found are things where the shell failed to remove things
it could.

There's an additional option to remove orphan siginfo files, which I
found quite a lot of during testing.

The --extra-archs and --extra-layer options are unimplemented since, as
far as I could work out, they were really implementation artefacts of
the existing script - there's a couple of functions I implemented which
generate this data, but I really couldn't see anywhere I actually needed
it; these want deleting if this goes beyond RFC.

Similary the --follow-symlink option is unimplemented as that appears to
an sstate-cache implementation detail which is no longer used.

The couple of TODOs left are all about more parallelisation, I expect
neither of them is as big a win as parallelising the stat()ing of all
the paths was (especially when running over NFS).

 scripts/sstate-cache-management.py | 329 +
 1 file changed, 329 insertions(+)
 create mode 100755 scripts/sstate-cache-management.py

diff --git a/scripts/sstate-cache-management.py 
b/scripts/sstate-cache-management.py
new file mode 100755
index ..3ae3a7fa0515
--- /dev/null
+++ b/scripts/sstate-cache-management.py
@@ -0,0 +1,329 @@
+#!/usr/bin/env python3
+#
+# Copyright OpenEmbedded Contributors
+#
+# SPDX-License-Identifier: MIT
+#
+
+import argparse
+import os
+import re
+import sys
+
+from collections import defaultdict
+from concurrent.futures import ThreadPoolExecutor
+from dataclasses import dataclass
+from pathlib import Path
+
+if sys.version_info < (3, 8, 0):
+raise RuntimeError("Sorry, python 3.8.0 or later is required for this 
script.")
+
+SSTATE_PREFIX = "sstate:"
+SSTATE_EXTENSION = ".tar.zst"
+# SSTATE_EXTENSION = ".tgz"
+# .siginfo.done files are mentioned in the original script?
+SSTATE_SUFFIXES = (
+SSTATE_EXTENSION,
+f"{SSTATE_EXTENSION}.siginfo",
+f"{SSTATE_EXTENSION}.done",
+)
+
+RE_SSTATE_PKGSPEC = re.compile(
+rf"""sstate:(?P[^:]*):
+ (?P[^:]*):
+ (?P[^:]*):
+ (?P[^:]*):
+ (?P[^:]*):
+ (?P[^_]*):
+ (?P[^_]*)_
+ (?P[^:]*)
+ (?P({"|".join([re.escape(s) for s in SSTATE_SUFFIXES])}))$""",
+re.X,
+)
+
+
+# Really we'd like something like a Path subclass which implements a stat
+# cache here, unfortunately there's no good way to do that transparently
+# (yet); see:
+#
+# https://github.com/python/cpython/issues/70219
+# https://discuss.python.org/t/make-pathlib-extensible/3428/77
+@dataclass
+class SstateEntry:
+"""Class for keeping track of an entry in sstate-cache."""
+
+path: Path
+match: re.Match
+stat_result: os.stat_result = None
+
+def __hash__(self):
+return self.path.__hash__()
+
+def __getattr__(self, name):
+return self.match.group(name)
+
+
+# this is what's in the original script; as far as I can tell, it's an
+# implementation artefact which we don't need?
+def find_archs():
+# all_archs
+builder_arch = os.uname().machine
+
+# FIXME
+layer_paths = [Path("../..")]
+
+tune_archs = set()
+re_tune = re.compile(r'AVAILTUNES .*=.*"(.*)"')
+for path in layer_paths:
+for tunefile in [
+p for p in path.glob("meta*/conf/machine/include/**/*") if 
p.is_file()
+]:
+with open(tunefile) as f:
+for line in f:
+m = re_tune.match(line)
+if m:
+tune_archs.update(m.group(1).split())
+
+# all_machines
+machine_archs = set()
+for path in layer_paths:
+for machine_file in path.glob("meta*/conf/machine/*.conf"):
+machine_archs.add(machine_file.parts[-1][:-5])
+
+extra_archs = set()
+all_archs = (
+set(
+arch.replace("-", "_")
+for arch in machine_archs | tune_archs | set(["allarch", 
builder_arch])
+)
+| extra_archs
+)
+
+print(all_archs)
+
+
+# again, not needed?
+def find_tasks():
+print(set([p.bb_task for p in paths]))
+
+
+def collect_sstate_paths(args):
+def scandir(path, paths):
+# Assume everything is a directory; by not checking we avoid needing an
+# additional stat which is potentially a synchronous roundtrip over NFS
+try:
+for p in path.iterdir():
+filename = p.parts[-1]
+if filename.startswith(SSTATE_PREFIX):
+if 

[OE-core] [PATCH] lib/prservice: Improve lock handling robustness

2023-12-23 Thread Richard Purdie
It is possible we could crash holding a lock whilst parsing in this code.
Switch to use utils.fileslocked() in the with expression to avoid this.

This may be causing some of our strange intermittent failures in PRServ
tests.

Signed-off-by: Richard Purdie 
---
 meta/lib/oe/prservice.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/meta/lib/oe/prservice.py b/meta/lib/oe/prservice.py
index 2f2a0c128af..c41242c878d 100644
--- a/meta/lib/oe/prservice.py
+++ b/meta/lib/oe/prservice.py
@@ -78,8 +78,7 @@ def prserv_export_tofile(d, metainfo, datainfo, lockdown, 
nomax=False):
 bb.utils.mkdirhier(d.getVar('PRSERV_DUMPDIR'))
 df = d.getVar('PRSERV_DUMPFILE')
 #write data
-lf = bb.utils.lockfile("%s.lock" % df)
-with open(df, "a") as f:
+with open(df, "a") as f, bb.utils.fileslocked(["%s.lock" % df]) as locks:
 if metainfo:
 #dump column info
 f.write("#PR_core_ver = \"%s\"\n\n" % metainfo['core_ver']);
@@ -113,7 +112,6 @@ def prserv_export_tofile(d, metainfo, datainfo, lockdown, 
nomax=False):
 if not nomax:
 for i in idx:
 f.write("PRAUTO_%s_%s = \"%s\"\n" % 
(str(datainfo[idx[i]]['version']),str(datainfo[idx[i]]['pkgarch']),str(datainfo[idx[i]]['value'])))
-bb.utils.unlockfile(lf)
 
 def prserv_check_avail(d):
 host_params = list([_f for _f in (d.getVar("PRSERV_HOST") or 
'').split(':') if _f])
-- 
2.39.2


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#192882): 
https://lists.openembedded.org/g/openembedded-core/message/192882
Mute This Topic: https://lists.openembedded.org/mt/10187/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH 2/2] appstream: update 0.16.3 -> 1.0.1

2023-12-23 Thread Alexander Kanavin
Thanks, there's a working patch from Markus that just landed in master.

Alex

On Sat, 23 Dec 2023 at 05:56, Alexandre Belloni
 wrote:
>
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/108/builds/5512/steps/12/logs/errors
>
> On 22/12/2023 11:46:31+0100, Alexander Kanavin wrote:
> > Signed-off-by: Alexander Kanavin 
> > ---
> >  ...-meson-do-not-rely-on-an-exe-wrapper.patch | 36 ---
> >  .../0001-remove-hardcoded-path.patch  | 28 ---
> >  ...appstream_0.16.3.bb => appstream_1.0.1.bb} | 10 +++---
> >  3 files changed, 19 insertions(+), 55 deletions(-)
> >  delete mode 100644 
> > meta/recipes-support/appstream/appstream/0001-meson-do-not-rely-on-an-exe-wrapper.patch
> >  rename meta/recipes-support/appstream/{appstream_0.16.3.bb => 
> > appstream_1.0.1.bb} (78%)
> >
> > diff --git 
> > a/meta/recipes-support/appstream/appstream/0001-meson-do-not-rely-on-an-exe-wrapper.patch
> >  
> > b/meta/recipes-support/appstream/appstream/0001-meson-do-not-rely-on-an-exe-wrapper.patch
> > deleted file mode 100644
> > index d4f2951e7a9..000
> > --- 
> > a/meta/recipes-support/appstream/appstream/0001-meson-do-not-rely-on-an-exe-wrapper.patch
> > +++ /dev/null
> > @@ -1,36 +0,0 @@
> > -From 79bf322768990b28c29a9d907edcca52ff48e0b8 Mon Sep 17 00:00:00 2001
> > -From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 
> > -Date: Wed, 26 Jul 2023 23:21:10 +0400
> > -Subject: meson: do not rely on an exe wrapper
> > -MIME-Version: 1.0
> > -Content-Type: text/plain; charset=UTF-8
> > -Content-Transfer-Encoding: 8bit
> > -
> > -Signed-off-by: Marc-André Lureau 
> > -
> > -Upstream-Status: Backport 
> > [https://github.com/ximion/appstream/commit/79bf322768990b28c29a9d907edcca52ff48e0b8]
> > 
> > - data/meson.build | 7 +++
> > - 1 file changed, 7 insertions(+)
> > -
> > -diff --git a/data/meson.build b/data/meson.build
> > -index aea0cb25..ec0e434f 100644
> >  a/data/meson.build
> > -+++ b/data/meson.build
> > -@@ -7,6 +7,13 @@ install_data('its/metainfo.its',
> > - install_data('its/metainfo.loc',
> > -   install_dir: join_paths(get_option('datadir'), 'gettext', 
> > 'its'))
> > -
> > -+# Do not rely on an exe wrapper for rel-info, use the system one in that 
> > case
> > -+if meson.is_cross_build()
> > -+dependency('appstream', version: '>=' + as_version, native: true,
> > -+   not_found_message: 'Native appstream required for 
> > cross-building')
> > -+ascli_exe = find_program('appstreamcli')
> > -+endif
> > -+
> > - # NOTE: We do not translate the release notes on purpose here.
> > - # If you do want to give translators a chance to translate them,
> > - # ascli news-to-metainfo needs to produce a temporary file to translate
> > ---
> > -2.41.0
> > -
> > diff --git 
> > a/meta/recipes-support/appstream/appstream/0001-remove-hardcoded-path.patch 
> > b/meta/recipes-support/appstream/appstream/0001-remove-hardcoded-path.patch
> > index 9cbfaca82f1..8f4cf1b82a4 100644
> > --- 
> > a/meta/recipes-support/appstream/appstream/0001-remove-hardcoded-path.patch
> > +++ 
> > b/meta/recipes-support/appstream/appstream/0001-remove-hardcoded-path.patch
> > @@ -1,4 +1,4 @@
> > -From 6ab00a4279823829a9b82dc9e4d055da4de88c6e Mon Sep 17 00:00:00 2001
> > +From 93bc5c1b221e5a10c65d4a055181dc818dfe1aa8 Mon Sep 17 00:00:00 2001
> >  From: Markus Volk 
> >  Date: Mon, 12 Dec 2022 15:42:42 +0100
> >  Subject: [PATCH] remove hardcoded path
> > @@ -9,23 +9,25 @@ Dont include hardcoded path. This fixes:
> >  | cc1: error: include location "/usr/include" is unsafe for 
> > cross-compilation [-Werror=poison-system-directories]
> >
> >  Upstream-Status: Inappropriate [oe-specific]
> > +
> >  ---
> > - meson.build   | 2 +-
> > - 1 files changed, 1 insertions(+), 1 deletions(-)
> > + meson.build | 4 ++--
> > + 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> >  diff --git a/meson.build b/meson.build
> > -index fd0e3373..2f273ada 100644
> > +index 0556b1e..d66919f 100644
> >  --- a/meson.build
> >  +++ b/meson.build
> > -@@ -124,7 +124,7 @@ if get_option ('gir')
> > - dependency('gobject-introspection-1.0', version: '>=1.56')
> > - endif
> > -
> > --stemmer_inc_dirs = include_directories(['/usr/include'])
> > -+stemmer_inc_dirs = include_directories([''])
> > +@@ -185,10 +185,10 @@ endif
> > + stemmer_inc_dirs = include_directories()
> >   if get_option('stemming')
> >   stemmer_lib = cc.find_library('stemmer', required: true)
> > +-stemmer_inc_dirs = include_directories(['/usr/include'])
> > ++stemmer_inc_dirs = include_directories()
> >   if not cc.has_header('libstemmer.h')
> > ---
> > -2.34.1
> > -
> > + if cc.has_header('libstemmer/libstemmer.h')
> > +-stemmer_inc_dirs = 
> > include_directories('/usr/include/libstemmer')
> > ++stemmer_inc_dirs = include_directories()
> > + else
> > + error('Unable to find Snowball header "libstemmer.h". Please 
> > ensure libstemmer/Snowball is