[OE-core] [PATCH] shadow: install manpages

2024-04-04 Thread Dan McGregor
From: Daniel McGregor 

Install the manpages for shadow, and also make the conflicting manpages
alternatives in util-linux.

Signed-off-by: Daniel McGregor 
---
 meta/recipes-core/util-linux/util-linux_2.39.3.bb | 3 +++
 meta/recipes-extended/shadow/shadow.inc   | 8 
 2 files changed, 11 insertions(+)

diff --git a/meta/recipes-core/util-linux/util-linux_2.39.3.bb 
b/meta/recipes-core/util-linux/util-linux_2.39.3.bb
index 83b3f4e05b3..a3f9badbd97 100644
--- a/meta/recipes-core/util-linux/util-linux_2.39.3.bb
+++ b/meta/recipes-core/util-linux/util-linux_2.39.3.bb
@@ -282,8 +282,11 @@ blkid.8 eject.1 findfs.8 fsck.8 kill.1 last.1 lastb.1 
libblkid.3 logger.1 mesg.1
 mountpoint.1 nologin.8 rfkill.8 sulogin.8 utmpdump.1 uuid.3 wall.1\
 "
 ALTERNATIVE:${PN}-doc += "${@bb.utils.contains('PACKAGECONFIG', 'pam', 'su.1', 
'', d)}"
+ALTERNATIVE:${PN}-doc += "${@bb.utils.contains('PACKAGECONFIG', 'chfn-chsh', 
'chfn.1 chsh.1', '', d)}"
 
 ALTERNATIVE_LINK_NAME[blkid.8] = "${mandir}/man8/blkid.8"
+ALTERNATIVE_LINK_NAME[chfn.1] = "${mandir}/man1/chfn.1"
+ALTERNATIVE_LINK_NAME[chsh.1] = "${mandir}/man1/chsh.1"
 ALTERNATIVE_LINK_NAME[eject.1] = "${mandir}/man1/eject.1"
 ALTERNATIVE_LINK_NAME[findfs.8] = "${mandir}/man8/findfs.8"
 ALTERNATIVE_LINK_NAME[fsck.8] = "${mandir}/man8/fsck.8"
diff --git a/meta/recipes-extended/shadow/shadow.inc 
b/meta/recipes-extended/shadow/shadow.inc
index 40e6ab0b30e..0029d848bf1 100644
--- a/meta/recipes-extended/shadow/shadow.inc
+++ b/meta/recipes-extended/shadow/shadow.inc
@@ -168,6 +168,10 @@ do_install:append:class-native() {
 SYSROOT_DIRS:append:class-native = " ${STAGING_DIR_NATIVE}/lib-shadow-deps/"
 INSANE_SKIP:${PN}:class-native = "already-stripped"
 
+do_install:append:class-target() {
+   oe_runmake -C ${B}/man DESTDIR="${D}" sbindir="${base_sbindir}" 
usbindir="${sbindir}" install-man
+}
+
 PACKAGES =+ "${PN}-base"
 FILES:${PN}-base = "\
 ${base_bindir}/login.shadow \
@@ -193,6 +197,10 @@ ALTERNATIVE_LINK_NAME[vipw] = "${base_sbindir}/vipw"
 ALTERNATIVE_LINK_NAME[vigr] = "${base_sbindir}/vigr"
 ALTERNATIVE_LINK_NAME[nologin] = "${base_sbindir}/nologin"
 
+ALTERNATIVE:${PN}-doc = "chfn.1 chsh.1"
+ALTERNATIVE_LINK_NAME[chfn.1] = "${mandir}/man1/chfn.1"
+ALTERNATIVE_LINK_NAME[chsh.1] = "${mandir}/man1/chsh.1"
+
 ALTERNATIVE:${PN}-base = "newgrp groups login su"
 ALTERNATIVE_LINK_NAME[login] = "${base_bindir}/login"
 ALTERNATIVE_LINK_NAME[su] = "${base_bindir}/su"
-- 
2.41.0


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



[OE-core] [PATCH 2/2][RFC] perf: make bpf asm include arch conditional

2024-04-04 Thread Bruce Ashfield
From: Bruce Ashfield 

To keep the perf source copying as small as possible, we can
further refine the arch/uapi copy to the single file that we
currently need.

To avoid a warning from the general perf source copy routine,
we make the .h conditional based on the architecture.

The supported architectures will not change often, so updating
this arch list is very minimal effort. Alternatively, we could
add a PERF_OPTIONAL_SRC variable and not warn if a file isn't
available for a given architecture.

Signed-off-by: Bruce Ashfield 
---

This is a further refinement of the perf header that
is required outside of tools.

I'm trying it this way first, versus making the perf
source copy not warn on missing files, since we risk
skipping warnings we want to see!

Bruce

 meta/recipes-kernel/perf/perf.bb | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
index 2f540cd54b..3cc7f63610 100644
--- a/meta/recipes-kernel/perf/perf.bb
+++ b/meta/recipes-kernel/perf/perf.bb
@@ -129,7 +129,9 @@ EXTRA_OEMAKE += "\
 # honour a JOBS variable.
 EXTRA_OEMAKE:append:task-configure = " JOBS=1"
 
-# include/uapi/asm is for: include/uapi/asm/bpf_perf_event.h
+# the architectures that need this file can be found in
+# ./tools/include/uapi/asm/bpf_perf_event.h
+PERF_BPF_EVENT_SRC ?= '${@bb.utils.contains_any("ARCH", [ "riscv", "arm64", 
"powerpc" ], "arch/${ARCH}/include/uapi/asm/bpf_perf_event.h", "", d)}'
 PERF_SRC ?= "Makefile \
  tools/arch \
  tools/build \
@@ -140,7 +142,7 @@ PERF_SRC ?= "Makefile \
  tools/scripts \
  scripts/ \
  arch/arm64/tools \
- arch/${ARCH}/include/uapi/asm/ \
+ ${PERF_BPF_EVENT_SRC} \
  arch/${ARCH}/Makefile \
 "
 
-- 
2.39.2


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



[OE-core] [PATCH 1/2] perf: add asm include required for v6.9+

2024-04-04 Thread Bruce Ashfield
From: Max Krummenacher 

Kernel commit 9eea8fafe33e ("libbpf: fix __arg_ctx type enforcement for
perf_event programs") added with 6.9-rc1 tools/include/uapi/asm/bpf_perf_event.h
which for arc, arm64, loongarch, riscv and s390 includes headers from
the arch/${ARCH}/... directories.

Which results in:

  ERROR: perf-1.0-r0 do_compile: oe_runmake failed
  | In file included from 
1.0/perf-1.0/tools/include/uapi/linux/bpf_perf_event.h:11,
  |  from libbpf.c:36:
  | perf/1.0/perf-1.0/tools/include/uapi/asm/bpf_perf_event.h:2:10: fatal 
error: ../../arch/arm64/include/uapi/asm/bpf_perf_event.h: No such file or 
directory
  | 2 | #include "../../arch/arm64/include/uapi/asm/bpf_perf_event.h"
  |   |  ^~~~

We copy the uapi/asm directory to make sure the header file is
present.

Signed-off-by: Max Krummenacher 
Signed-off-by: Bruce Ashfield 
---

This is a tweak of the commit from max to only include the uapi/asm
directory.

A second patch will further refine it.

Bruce

 meta/recipes-kernel/perf/perf.bb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
index 2c6ab060e3..2f540cd54b 100644
--- a/meta/recipes-kernel/perf/perf.bb
+++ b/meta/recipes-kernel/perf/perf.bb
@@ -129,6 +129,7 @@ EXTRA_OEMAKE += "\
 # honour a JOBS variable.
 EXTRA_OEMAKE:append:task-configure = " JOBS=1"
 
+# include/uapi/asm is for: include/uapi/asm/bpf_perf_event.h
 PERF_SRC ?= "Makefile \
  tools/arch \
  tools/build \
@@ -139,6 +140,7 @@ PERF_SRC ?= "Makefile \
  tools/scripts \
  scripts/ \
  arch/arm64/tools \
+ arch/${ARCH}/include/uapi/asm/ \
  arch/${ARCH}/Makefile \
 "
 
-- 
2.39.2


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#197972): 
https://lists.openembedded.org/g/openembedded-core/message/197972
Mute This Topic: https://lists.openembedded.org/mt/105337223/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] util-linux: Set the license for util-linux-fcntl-lock to MIT

2024-04-04 Thread Richard Purdie
On Thu, 2024-04-04 at 17:25 +, Peter Kjellerstedt wrote:
> > -Original Message-
> > From: Alexandre Belloni 
> > Sent: den 4 april 2024 01:45
> > To: Peter Kjellerstedt 
> > Cc: openembedded-core@lists.openembedded.org
> > Subject: Re: [OE-core] [PATCH] util-linux: Set the license for
> > util-linux-fcntl-lock to MIT
> > 
> > Hello,
> > 
> > This caused:
> > 
> > https://autobuilder.yoctoproject.org/typhoon/#/builders/117/builds/4604/steps/12/logs/stdio
> > https://autobuilder.yocto.io/pub/repro-fail/oe-reproducible-20240403-u_hyp_wv/packages/diff-html/
> 
> Doesn't this type of breakage happen all the time for pure recipe 
> changes that affect the output if the PR server is not enabled?

The problem is that bitbake can't "see" that package license variable
since it isn't in PACKAGES. It gets added there dynamically by the
python module splitting code.

If we add it to PACKAGES, the license change would then be in taskhash
and when it changes things would rebuild. As things stand, the taskhash
doesn't change and doesn't trigger a rebuild.

> > I guess we need to bump PR?
> 
> Given that RP removed all PR variables from the recipes in OE-Core
> (see commit d4c346e8ab8f3cae25d1b01c7331ed9f6d4f96ef), I would expect
> that he is not too keen to see them coming back...

We do sometimes need them, I just got rid of a load of old obsolete
stuff. You're right I'd prefer to avoid them though.

Cheers,

Richard

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#197971): 
https://lists.openembedded.org/g/openembedded-core/message/197971
Mute This Topic: https://lists.openembedded.org/mt/105282531/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] util-linux: Set the license for util-linux-fcntl-lock to MIT

2024-04-04 Thread Alexandre Belloni via lists.openembedded.org
On 04/04/2024 17:25:52+, Peter Kjellerstedt wrote:
> > -Original Message-
> > From: Alexandre Belloni 
> > Sent: den 4 april 2024 01:45
> > To: Peter Kjellerstedt 
> > Cc: openembedded-core@lists.openembedded.org
> > Subject: Re: [OE-core] [PATCH] util-linux: Set the license for 
> > util-linux-fcntl-lock to MIT
> > 
> > Hello,
> > 
> > This caused:
> > 
> > https://autobuilder.yoctoproject.org/typhoon/#/builders/117/builds/4604/steps/12/logs/stdio
> > https://autobuilder.yocto.io/pub/repro-fail/oe-reproducible-20240403-u_hyp_wv/packages/diff-html/
> 
> Doesn't this type of breakage happen all the time for pure recipe 
> changes that affect the output if the PR server is not enabled?
> 
> > 
> > I guess we need to bump PR?
> 
> Given that RP removed all PR variables from the recipes in OE-Core (see 
> commit d4c346e8ab8f3cae25d1b01c7331ed9f6d4f96ef), I would expect that he 
> is not too keen to see them coming back...
> 

The plan is to take your patch as-is in master and if this causes reop
failures bump PR

> //Peter
> 
> > 
> > On 02/04/2024 06:56:54+0200, Peter Kjellerstedt wrote:
> > > This avoids problems if BSD-4-Clause is in INCOMPATIBLE_LICENSE since
> > > util-linux-fcntl-lock is now a dependency of run-postinsts.
> > >
> > > Signed-off-by: Peter Kjellerstedt 
> > > ---
> > >  meta/recipes-core/util-linux/util-linux.inc | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/meta/recipes-core/util-linux/util-linux.inc 
> > > b/meta/recipes-core/util-linux/util-linux.inc
> > > index f4b547215e..d506783f9a 100644
> > > --- a/meta/recipes-core/util-linux/util-linux.inc
> > > +++ b/meta/recipes-core/util-linux/util-linux.inc
> > > @@ -7,6 +7,7 @@ disk partitioning, kernel message management, filesystem 
> > > creation, and system lo
> > >  SECTION = "base"
> > >
> > >  LICENSE = "GPL-1.0-or-later & GPL-2.0-or-later & LGPL-2.1-or-later & 
> > > BSD-2-Clause & BSD-3-Clause & BSD-4-Clause & MIT"
> > > +LICENSE:${PN}-fcntl-lock = "MIT"
> > >  LICENSE:${PN}-fdisk = "GPL-1.0-or-later"
> > >  LICENSE:${PN}-libblkid = "LGPL-2.1-or-later"
> > >  LICENSE:${PN}-libfdisk = "LGPL-2.1-or-later"
> 

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#197970): 
https://lists.openembedded.org/g/openembedded-core/message/197970
Mute This Topic: https://lists.openembedded.org/mt/105282531/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] util-linux: Set the license for util-linux-fcntl-lock to MIT

2024-04-04 Thread Peter Kjellerstedt
> -Original Message-
> From: Alexandre Belloni 
> Sent: den 4 april 2024 01:45
> To: Peter Kjellerstedt 
> Cc: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH] util-linux: Set the license for 
> util-linux-fcntl-lock to MIT
> 
> Hello,
> 
> This caused:
> 
> https://autobuilder.yoctoproject.org/typhoon/#/builders/117/builds/4604/steps/12/logs/stdio
> https://autobuilder.yocto.io/pub/repro-fail/oe-reproducible-20240403-u_hyp_wv/packages/diff-html/

Doesn't this type of breakage happen all the time for pure recipe 
changes that affect the output if the PR server is not enabled?

> 
> I guess we need to bump PR?

Given that RP removed all PR variables from the recipes in OE-Core (see 
commit d4c346e8ab8f3cae25d1b01c7331ed9f6d4f96ef), I would expect that he 
is not too keen to see them coming back...

//Peter

> 
> On 02/04/2024 06:56:54+0200, Peter Kjellerstedt wrote:
> > This avoids problems if BSD-4-Clause is in INCOMPATIBLE_LICENSE since
> > util-linux-fcntl-lock is now a dependency of run-postinsts.
> >
> > Signed-off-by: Peter Kjellerstedt 
> > ---
> >  meta/recipes-core/util-linux/util-linux.inc | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/meta/recipes-core/util-linux/util-linux.inc 
> > b/meta/recipes-core/util-linux/util-linux.inc
> > index f4b547215e..d506783f9a 100644
> > --- a/meta/recipes-core/util-linux/util-linux.inc
> > +++ b/meta/recipes-core/util-linux/util-linux.inc
> > @@ -7,6 +7,7 @@ disk partitioning, kernel message management, filesystem 
> > creation, and system lo
> >  SECTION = "base"
> >
> >  LICENSE = "GPL-1.0-or-later & GPL-2.0-or-later & LGPL-2.1-or-later & 
> > BSD-2-Clause & BSD-3-Clause & BSD-4-Clause & MIT"
> > +LICENSE:${PN}-fcntl-lock = "MIT"
> >  LICENSE:${PN}-fdisk = "GPL-1.0-or-later"
> >  LICENSE:${PN}-libblkid = "LGPL-2.1-or-later"
> >  LICENSE:${PN}-libfdisk = "LGPL-2.1-or-later"


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#197969): 
https://lists.openembedded.org/g/openembedded-core/message/197969
Mute This Topic: https://lists.openembedded.org/mt/105282531/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] curl: disable ca-certificates.crt path setting for native build

2024-04-04 Thread Mikko Rapeli
Hi,

On Thu, Apr 04, 2024 at 03:13:08PM +0100, Richard Purdie wrote:
> On Thu, 2024-04-04 at 16:29 +0300, Mikko Rapeli wrote:
> > If linux-yocto-dev is compiled without specific SRCREV, it uses
> > AUTOREV which tries to update to latest available commit. This is
> > currently failing with these steps:
> > 
> > $ rm -rf tmp*/work/*/linux-yocto-dev && \
> > bitbake -c do_configure mc:machine:linux-yocto-dev ; \
> > bitbake -c do_clean mc:machine:linux-yocto-dev
> > [...]
> 
> > The variable dependency chain for the failure is: 
> > fetcher_hashes_dummyfunc[vardepvalue]
> > 
> > ERROR: Parsing halted due to errors, see error messages above
> > 
> > Summary: There were 6 WARNING messages.
> > Summary: There were 2 ERROR messages, returning a non-zero exit code.
> > 
> > This state is not recoverable with bitbake calls. All of them fail from now 
> > on.
> > "rm -rf tmp/work/*/linux-yocto-dev" recovers the situation
> > and bitbake commands work again.
> > 
> > Root cause is curl-native, dependency of git-native, which
> > has --with-ca-bundle=${sysconfdir}/ssl/certs/ca-certificates.crt
> > which for native build target is wrong and points to curl-native build
> > directory path
> > /home/builder/src/base/build/tmp_poky/work/x86_64-linux/curl-native/8.6.0/recipe-sysroot-native/etc/ssl/certs/ca-certificates.crt
> > 
> > Since git is a build time host package dependency listed in
> > https://docs.yoctoproject.org/dev/singleindex.html#build-host-packages
> > then its dependencies like curl and ca-certificates are too, it should
> > be safe for curl-native to use the default host ca-certificates path
> > instead of the one in recipe specific sysroots which would need to be set 
> > with complicated
> > environment variables. Set non-default ca-certificates path only for
> > target and nativesdk builds.
> > 
> > Reported-by: Mathieu Poirier 
> > Signed-off-by: Mikko Rapeli 
> > ---
> >  meta/recipes-support/curl/curl_8.6.0.bb | 7 ++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)
> > 
> > diff --git a/meta/recipes-support/curl/curl_8.6.0.bb 
> > b/meta/recipes-support/curl/curl_8.6.0.bb
> > index 49ba0cb4a7..da5571ca14 100644
> > --- a/meta/recipes-support/curl/curl_8.6.0.bb
> > +++ b/meta/recipes-support/curl/curl_8.6.0.bb
> > @@ -73,11 +73,16 @@ PACKAGECONFIG[zstd] = "--with-zstd,--without-zstd,zstd"
> >  EXTRA_OECONF = " \
> >  --disable-libcurl-option \
> >  --disable-ntlm-wb \
> > -    --with-ca-bundle=${sysconfdir}/ssl/certs/ca-certificates.crt \
> >  --without-libpsl \
> >  --enable-optimize \
> >  ${@'--without-ssl' if (bb.utils.filter('PACKAGECONFIG', 'gnutls 
> > mbedtls openssl', d) == '') else ''} \
> >  "
> > +EXTRA_OECONF:class-target = " \
> > +    --with-ca-bundle=${sysconfdir}/ssl/certs/ca-certificates.crt \
> > +"
> > +EXTRA_OECONF:class-nativesdk = " \
> > +    --with-ca-bundle=${sysconfdir}/ssl/certs/ca-certificates.crt \
> > +"
> >  
> >  fix_absolute_paths () {
> >     # cleanup buildpaths from curl-config
> 
> This change is fraught with danger :(.
> 
> I have a feeling we've gone around in circles as in some cases you
> don't have the ca-certs on the host, or they're in unusual paths so the
> previous conclusion was we should always have them present in the
> sysroot if curl-native is being used. Yes, that does mean we have to
> set the environment correctly to relocate curl's paths appropriately.
> 
> Certainly at this point in the release cycle I'm very nervous about
> changing this around.

No worries, 421083c46c97bf758496b8c58402aea5d74aa097 already on master fixes
the issue. We're lagging few weeks behind master branch but trying
to catch up.

Cheers,

-Mikko

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#197968): 
https://lists.openembedded.org/g/openembedded-core/message/197968
Mute This Topic: https://lists.openembedded.org/mt/105328588/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] curl: disable ca-certificates.crt path setting for native build

2024-04-04 Thread Mikko Rapeli
Hi,

On Thu, Apr 04, 2024 at 02:57:20PM +0100, Jose Quaresma wrote:
> Hi Mikko,
> 
> Did you test with the below change already merged on master?
> Looks like it was to fix the same issue.
> 
> git: git-replacement-native: depend on ca-certificate
> https://git.yoctoproject.org/poky/commit/meta/recipes-devtools/git?id=421083c46c97bf758496b8c58402aea5d74aa097

No, I was on slighlty older commit 47c201da56155f80e18ee1269096ffec1864bce0.

421083c46c97bf758496b8c58402aea5d74aa097 fixes the issue too, thanks for the 
hint!

This patch can be ignored.

Cheers,

-Mikko

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#197967): 
https://lists.openembedded.org/g/openembedded-core/message/197967
Mute This Topic: https://lists.openembedded.org/mt/105328588/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] curl: disable ca-certificates.crt path setting for native build

2024-04-04 Thread Richard Purdie
On Thu, 2024-04-04 at 16:29 +0300, Mikko Rapeli wrote:
> If linux-yocto-dev is compiled without specific SRCREV, it uses
> AUTOREV which tries to update to latest available commit. This is
> currently failing with these steps:
> 
> $ rm -rf tmp*/work/*/linux-yocto-dev && \
> bitbake -c do_configure mc:machine:linux-yocto-dev ; \
> bitbake -c do_clean mc:machine:linux-yocto-dev
> [...]

> The variable dependency chain for the failure is: 
> fetcher_hashes_dummyfunc[vardepvalue]
> 
> ERROR: Parsing halted due to errors, see error messages above
> 
> Summary: There were 6 WARNING messages.
> Summary: There were 2 ERROR messages, returning a non-zero exit code.
> 
> This state is not recoverable with bitbake calls. All of them fail from now 
> on.
> "rm -rf tmp/work/*/linux-yocto-dev" recovers the situation
> and bitbake commands work again.
> 
> Root cause is curl-native, dependency of git-native, which
> has --with-ca-bundle=${sysconfdir}/ssl/certs/ca-certificates.crt
> which for native build target is wrong and points to curl-native build
> directory path
> /home/builder/src/base/build/tmp_poky/work/x86_64-linux/curl-native/8.6.0/recipe-sysroot-native/etc/ssl/certs/ca-certificates.crt
> 
> Since git is a build time host package dependency listed in
> https://docs.yoctoproject.org/dev/singleindex.html#build-host-packages
> then its dependencies like curl and ca-certificates are too, it should
> be safe for curl-native to use the default host ca-certificates path
> instead of the one in recipe specific sysroots which would need to be set 
> with complicated
> environment variables. Set non-default ca-certificates path only for
> target and nativesdk builds.
> 
> Reported-by: Mathieu Poirier 
> Signed-off-by: Mikko Rapeli 
> ---
>  meta/recipes-support/curl/curl_8.6.0.bb | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/recipes-support/curl/curl_8.6.0.bb 
> b/meta/recipes-support/curl/curl_8.6.0.bb
> index 49ba0cb4a7..da5571ca14 100644
> --- a/meta/recipes-support/curl/curl_8.6.0.bb
> +++ b/meta/recipes-support/curl/curl_8.6.0.bb
> @@ -73,11 +73,16 @@ PACKAGECONFIG[zstd] = "--with-zstd,--without-zstd,zstd"
>  EXTRA_OECONF = " \
>  --disable-libcurl-option \
>  --disable-ntlm-wb \
> -    --with-ca-bundle=${sysconfdir}/ssl/certs/ca-certificates.crt \
>  --without-libpsl \
>  --enable-optimize \
>  ${@'--without-ssl' if (bb.utils.filter('PACKAGECONFIG', 'gnutls mbedtls 
> openssl', d) == '') else ''} \
>  "
> +EXTRA_OECONF:class-target = " \
> +    --with-ca-bundle=${sysconfdir}/ssl/certs/ca-certificates.crt \
> +"
> +EXTRA_OECONF:class-nativesdk = " \
> +    --with-ca-bundle=${sysconfdir}/ssl/certs/ca-certificates.crt \
> +"
>  
>  fix_absolute_paths () {
>   # cleanup buildpaths from curl-config

This change is fraught with danger :(.

I have a feeling we've gone around in circles as in some cases you
don't have the ca-certs on the host, or they're in unusual paths so the
previous conclusion was we should always have them present in the
sysroot if curl-native is being used. Yes, that does mean we have to
set the environment correctly to relocate curl's paths appropriately.

Certainly at this point in the release cycle I'm very nervous about
changing this around.

Cheers,

Richard

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#197966): 
https://lists.openembedded.org/g/openembedded-core/message/197966
Mute This Topic: https://lists.openembedded.org/mt/105328588/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] curl: disable ca-certificates.crt path setting for native build

2024-04-04 Thread Jose Quaresma
Hi Mikko,

Did you test with the below change already merged on master?
Looks like it was to fix the same issue.

git: git-replacement-native: depend on ca-certificate
https://git.yoctoproject.org/poky/commit/meta/recipes-devtools/git?id=421083c46c97bf758496b8c58402aea5d74aa097

Jose

Mikko Rapeli  escreveu (quinta, 4/04/2024 à(s)
14:29):

> If linux-yocto-dev is compiled without specific SRCREV, it uses
> AUTOREV which tries to update to latest available commit. This is
> currently failing with these steps:
>
> $ rm -rf tmp*/work/*/linux-yocto-dev && \
> bitbake -c do_configure mc:machine:linux-yocto-dev ; \
> bitbake -c do_clean mc:machine:linux-yocto-dev
> ...
> Parsing recipes...WARNING:
> /home/builder/src/base/build/../poky/meta/recipes-kernel/linux/
> linux-yocto-dev.bb: Exception during build_dependencies for
> fetcher_hashes_dummyfunc
> WARNING: /home/builder/src/base/build/../poky/meta/recipes-kernel/linux/
> linux-yocto-dev.bb: Error during finalise of
> /home/builder/src/base/build/../poky/meta/recipes-kernel/linux/
> linux-yocto-dev.bb
> WARNING: /home/builder/src/base/build/../poky/meta/recipes-kernel/linux/
> linux-yocto-dev.bb: Exception during build_dependencies for
> fetcher_hashes_dummyfunc
> WARNING: /home/builder/src/base/build/../poky/meta/recipes-kernel/linux/
> linux-yocto-dev.bb: Error during finalise of
> mc:poky:/home/builder/src/base/build/../poky/meta/recipes-kernel/linux/
> linux-yocto-dev.bb
> ERROR: ExpansionError during parsing
> /home/builder/src/base/build/../poky/meta/recipes-kernel/linux/
> linux-yocto-dev.bb
> Traceback (most recent call last):
>   File "/home/builder/src/base/poky/bitbake/lib/bb/fetch2/__init__.py",
> line 1245, in srcrev_internal_helper(ud= 0x7f34e5f61330>, d=,
> name='machine'):
>  d.setVar("__BBAUTOREV_ACTED_UPON", True)
> >srcrev = ud.method.latest_revision(ud, d, name)
>
>   File "/home/builder/src/base/poky/bitbake/lib/bb/fetch2/__init__.py",
> line 1667, in Git.latest_revision(ud= 0x7f34e5f61330>, d=,
> name='machine'):
>  except KeyError:
> >revs[key] = rev = self._latest_revision(ud, d, name)
>  return rev
>   File "/home/builder/src/base/poky/bitbake/lib/bb/fetch2/git.py", line
> 850, in Git._latest_revision(ud= 0x7f34e5f61330>, d=,
> name='machine'):
>
> >output = self._lsremote(ud, d, "")
>  # Tags of the form ^{} may not work, need to fallback to
> other form
>   File "/home/builder/src/base/poky/bitbake/lib/bb/fetch2/git.py", line
> 833, in Git._lsremote(ud=,
> d=, search=''):
>  bb.fetch2.check_network_access(d, cmd, repourl)
> >output = runfetchcmd(cmd, d, True)
>  if not output:
>   File "/home/builder/src/base/poky/bitbake/lib/bb/fetch2/__init__.py",
> line 957, in runfetchcmd(cmd='export PSEUDO_DISABLED=1; export
> DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/15818/bus"; export
> PATH="/home/builder/src/base/build/tmp_poky/sysroots-uninative/x86_64-linux/usr/bin:/home/builder/src/base/poky/scripts:/home/builder/src/base/build/tmp_poky/work/poky-poky-linux/linux-yocto-dev/6.8+git/recipe-sysroot-native/usr/bin/aarch64-poky-linux:/home/builder/src/base/build/tmp_poky/work/poky-poky-linux/linux-yocto-dev/6.8+git/recipe-sysroot/usr/bin/crossscripts:/home/builder/src/base/build/tmp_poky/work/poky-poky-linux/linux-yocto-dev/6.8+git/recipe-sysroot-native/usr/sbin:/home/builder/src/base/build/tmp_poky/work/poky-poky-linux/linux-yocto-dev/6.8+git/recipe-sysroot-native/usr/bin:/home/builder/src/base/build/tmp_poky/work/poky-poky-linux/linux-yocto-dev/6.8+git/recipe-sysroot-native/sbin:/home/builder/src/base/build/tmp_poky/work/poky-poky-linux/linux-yocto-dev/6.8+git/recipe-sysroot-native/bin:/home/builder/src/base/poky/bitbake/bin:/home/builder/src/base/build/tmp_poky/hosttools";
> export HOME="/home/builder"; git -c gc.autoDetach=false -c core.pager=cat
> -c safe.bareRepository=all ls-remote
> https://git.yoctoproject.org/linux-yocto-dev.git ',
> d=, quiet=True,
> cleanup=[], log=None, workdir=None):
>
> >raise FetchError(error_message)
>
> bb.data_smart.ExpansionError: Failure expanding variable
> fetcher_hashes_dummyfunc[vardepvalue], expression was
> ${@bb.fetch.get_hashvalue(d)} which triggered exception FetchError: Fetcher
> failure: Fetch command export PSEUDO_DISABLED=1; export
> DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/15818/bus"; export
> 

[OE-core] [PATCH 2/2] curl: disable ca-certificates.crt path setting for native build

2024-04-04 Thread Mikko Rapeli
If linux-yocto-dev is compiled without specific SRCREV, it uses
AUTOREV which tries to update to latest available commit. This is
currently failing with these steps:

$ rm -rf tmp*/work/*/linux-yocto-dev && \
bitbake -c do_configure mc:machine:linux-yocto-dev ; \
bitbake -c do_clean mc:machine:linux-yocto-dev
...
Parsing recipes...WARNING: 
/home/builder/src/base/build/../poky/meta/recipes-kernel/linux/linux-yocto-dev.bb:
 Exception during build_dependencies for fetcher_hashes_dummyfunc
WARNING: 
/home/builder/src/base/build/../poky/meta/recipes-kernel/linux/linux-yocto-dev.bb:
 Error during finalise of 
/home/builder/src/base/build/../poky/meta/recipes-kernel/linux/linux-yocto-dev.bb
WARNING: 
/home/builder/src/base/build/../poky/meta/recipes-kernel/linux/linux-yocto-dev.bb:
 Exception during build_dependencies for fetcher_hashes_dummyfunc
WARNING: 
/home/builder/src/base/build/../poky/meta/recipes-kernel/linux/linux-yocto-dev.bb:
 Error during finalise of 
mc:poky:/home/builder/src/base/build/../poky/meta/recipes-kernel/linux/linux-yocto-dev.bb
ERROR: ExpansionError during parsing 
/home/builder/src/base/build/../poky/meta/recipes-kernel/linux/linux-yocto-dev.bb
Traceback (most recent call last):
  File "/home/builder/src/base/poky/bitbake/lib/bb/fetch2/__init__.py", line 
1245, in srcrev_internal_helper(ud=, d=, 
name='machine'):
 d.setVar("__BBAUTOREV_ACTED_UPON", True)
>srcrev = ud.method.latest_revision(ud, d, name)

  File "/home/builder/src/base/poky/bitbake/lib/bb/fetch2/__init__.py", line 
1667, in Git.latest_revision(ud=, 
d=, name='machine'):
 except KeyError:
>revs[key] = rev = self._latest_revision(ud, d, name)
 return rev
  File "/home/builder/src/base/poky/bitbake/lib/bb/fetch2/git.py", line 850, in 
Git._latest_revision(ud=, 
d=, name='machine'):

>output = self._lsremote(ud, d, "")
 # Tags of the form ^{} may not work, need to fallback to other form
  File "/home/builder/src/base/poky/bitbake/lib/bb/fetch2/git.py", line 833, in 
Git._lsremote(ud=, 
d=, search=''):
 bb.fetch2.check_network_access(d, cmd, repourl)
>output = runfetchcmd(cmd, d, True)
 if not output:
  File "/home/builder/src/base/poky/bitbake/lib/bb/fetch2/__init__.py", line 
957, in runfetchcmd(cmd='export PSEUDO_DISABLED=1; export 
DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/15818/bus"; export 
PATH="/home/builder/src/base/build/tmp_poky/sysroots-uninative/x86_64-linux/usr/bin:/home/builder/src/base/poky/scripts:/home/builder/src/base/build/tmp_poky/work/poky-poky-linux/linux-yocto-dev/6.8+git/recipe-sysroot-native/usr/bin/aarch64-poky-linux:/home/builder/src/base/build/tmp_poky/work/poky-poky-linux/linux-yocto-dev/6.8+git/recipe-sysroot/usr/bin/crossscripts:/home/builder/src/base/build/tmp_poky/work/poky-poky-linux/linux-yocto-dev/6.8+git/recipe-sysroot-native/usr/sbin:/home/builder/src/base/build/tmp_poky/work/poky-poky-linux/linux-yocto-dev/6.8+git/recipe-sysroot-native/usr/bin:/home/builder/src/base/build/tmp_poky/work/poky-poky-linux/linux-yocto-dev/6.8+git/recipe-sysroot-native/sbin:/home/builder/src/base/build/tmp_poky/work/poky-poky-linux/linux-yocto-dev/6.8+git/recipe-sysroot-native/bin:/home/builder/src/base/poky/bitbake/bin:/home/builder/src/base/build/tmp_poky/hosttools";
 export HOME="/home/builder"; git -c gc.autoDetach=false -c core.pager=cat -c 
safe.bareRepository=all ls-remote 
https://git.yoctoproject.org/linux-yocto-dev.git ', d=, quiet=True, cleanup=[], log=None, workdir=None):

>raise FetchError(error_message)

bb.data_smart.ExpansionError: Failure expanding variable 
fetcher_hashes_dummyfunc[vardepvalue], expression was 
${@bb.fetch.get_hashvalue(d)} which triggered exception FetchError: Fetcher 
failure: Fetch command export PSEUDO_DISABLED=1; export 
DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/15818/bus"; export 
PATH="/home/builder/src/base/build/tmp_poky/sysroots-uninative/x86_64-linux/usr/bin:/home/builder/src/base/poky/scripts:/home/builder/src/base/build/tmp_poky/work/poky-poky-linux/linux-yocto-dev/6.8+git/recipe-sysroot-native/usr/bin/aarch64-poky-linux:/home/builder/src/base/build/tmp_poky/work/poky-poky-linux/linux-yocto-dev/6.8+git/recipe-sysroot/usr/bin/crossscripts:/home/builder/src/base/build/tmp_poky/work/poky-poky-linux/linux-yocto-dev/6.8+git/recipe-sysroot-native/usr/sbin:/home/builder/src/base/build/tmp_poky/work/poky-poky-linux/linux-yocto-dev/6.8+git/recipe-sysroot-native/usr/bin:/home/builder/src/base/build/tmp_poky/work/poky-poky-linux/linux-yocto-dev/6.8+git/recipe-sysroot-native/sbin:/home/builder/src/base/build/tmp_poky/work/poky-poky-linux/linux-yocto-dev/6.8+git/recipe-sysroot-native/bin:/home/builder/src/base/poky/bitbake/bin:/home/builder/src/base/build/tmp_poky/hosttools";
 export HOME="/home/builder"; git -c gc.autoDetach=false -c core.pager=cat -c 
safe.bareRepository=all ls-remote 

[OE-core] [PATCH 1/2] linux-yocto-dev: remove duplicate DEPENDS

2024-04-04 Thread Mikko Rapeli
They are already set in linux-yocto.inc

Signed-off-by: Mikko Rapeli 
---
 meta/recipes-kernel/linux/linux-yocto-dev.bb | 5 -
 1 file changed, 5 deletions(-)

diff --git a/meta/recipes-kernel/linux/linux-yocto-dev.bb 
b/meta/recipes-kernel/linux/linux-yocto-dev.bb
index 9bd219825e..d5cba42a5c 100644
--- a/meta/recipes-kernel/linux/linux-yocto-dev.bb
+++ b/meta/recipes-kernel/linux/linux-yocto-dev.bb
@@ -34,11 +34,6 @@ PV = "${LINUX_VERSION}+git"
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
 
-DEPENDS += "${@bb.utils.contains('ARCH', 'x86', 'elfutils-native', '', d)}"
-DEPENDS += "${@bb.utils.contains('ARCH', 'powerpc', 'elfutils-native', '', d)}"
-DEPENDS += "openssl-native util-linux-native"
-DEPENDS += "gmp-native libmpc-native"
-
 # yaml and dtschema are required for 5.16+ device tree validation, libyaml is 
checked
 # via pkgconfig, so must always be present, but we can wrap the others to make 
them
 # conditional
-- 
2.34.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#197963): 
https://lists.openembedded.org/g/openembedded-core/message/197963
Mute This Topic: https://lists.openembedded.org/mt/105328586/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] oeqa/selftest/devtool: fix test_devtool_add_git_style2

2024-04-04 Thread Richard Purdie
On Thu, 2024-04-04 at 14:25 +0200, Alexandre Truong wrote:
> The problem is the following:
> AssertionError: 
> 'gitsm://g...@github.com/ARMmbed/mbedtls.git;protocol=https;branch=master' != 
> 'git://g...@github.com/ARMmbed/mbedtls.git;protocol=https;branch=master'
> 
> Mbedlts made changes to their repository, adding a sub-module, thus the
> assert triggers an error with the url:
> git://g...@github.com/ARMmbed/mbedtls.git;protocol=https;branch=master
> 
> To fix the issue, the url has been changed to:
> gitsm://g...@github.com/ARMmbed/mbedtls.git;protocol=https;branch=master
> 
> Signed-off-by: Alexandre Truong 
> Reviewed-by: Yoann Congal 
> ---
>  meta/lib/oeqa/selftest/cases/devtool.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks! I think this is fine to merge and avoid the current test
failures but it is a workaround since there is a version being passed
in this test and that version doesn't include the submodules commit. It
seems as if devtool/recipetool's submodule detection is checking HEAD
for submodules and not the specific revision/version we're passing.

Could you file a bug please in our bugzilla so we don't forget this
issue and can come back to fixing it properly?

FWIW, this is the problematic change upstream:
https://github.com/Mbed-TLS/mbedtls/commit/456a54da8ef44c8b725b524567c08cffec6a7214
which we should mention in the commit message too.

Cheers,

Richard

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



[OE-core] [PATCH] oeqa/selftest/devtool: fix test_devtool_add_git_style2

2024-04-04 Thread Alexandre Truong
The problem is the following:
AssertionError: 
'gitsm://g...@github.com/ARMmbed/mbedtls.git;protocol=https;branch=master' != 
'git://g...@github.com/ARMmbed/mbedtls.git;protocol=https;branch=master'

Mbedlts made changes to their repository, adding a sub-module, thus the
assert triggers an error with the url:
git://g...@github.com/ARMmbed/mbedtls.git;protocol=https;branch=master

To fix the issue, the url has been changed to:
gitsm://g...@github.com/ARMmbed/mbedtls.git;protocol=https;branch=master

Signed-off-by: Alexandre Truong 
Reviewed-by: Yoann Congal 
---
 meta/lib/oeqa/selftest/cases/devtool.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/lib/oeqa/selftest/cases/devtool.py 
b/meta/lib/oeqa/selftest/cases/devtool.py
index a139eb..bc1e40ef83 100644
--- a/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/meta/lib/oeqa/selftest/cases/devtool.py
@@ -482,7 +482,7 @@ class DevtoolAddTests(DevtoolBase):
 pn = 'mbedtls'
 # this will trigger reformat_git_uri with branch parameter in url
 git_url = "'git://g...@github.com/ARMmbed/mbedtls.git;protocol=https'"
-resulting_src_uri = 
"git://g...@github.com/ARMmbed/mbedtls.git;protocol=https;branch=master"
+resulting_src_uri = 
"gitsm://g...@github.com/ARMmbed/mbedtls.git;protocol=https;branch=master"
 self._test_devtool_add_git_url(git_url, version, pn, resulting_src_uri)
 
 def test_devtool_add_library(self):
-- 
2.34.1


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



[OE-core] [PATCH v2 4/5] qemu: enable parallel builds when using the jobserver class

2024-04-04 Thread Martin Hundeb?ll
If the jobserver class is enabled, the PARALLEL_MAKE variable is unset in
favor of configuring a shared jobserver in the MAKEFLAGS variable. However,
the qemu makefile translates the missing `-j` argument to `-j1` when
calling into meson / ninja. Add a patch to make the qemu makefile
consider the --jobserver-auth option too.

Signed-off-by: Martin Hundebøll 
---
 meta/recipes-devtools/qemu/qemu.inc   |  1 +
 ...e-jobserver-auth-argument-when-calli.patch | 37 +++
 2 files changed, 38 insertions(+)
 create mode 100644 
meta/recipes-devtools/qemu/qemu/0013-Makefile-preserve-jobserver-auth-argument-when-calli.patch

diff --git a/meta/recipes-devtools/qemu/qemu.inc 
b/meta/recipes-devtools/qemu/qemu.inc
index 4501f84c2b..1f86bf5a44 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -39,6 +39,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
file://0003-linux-user-Add-strace-for-shmat.patch \
file://0004-linux-user-Rewrite-target_shmat.patch \

file://0005-tests-tcg-Check-that-shmat-does-not-break-proc-self-.patch \
+   
file://0013-Makefile-preserve-jobserver-auth-argument-when-calli.patch \
file://CVE-2023-6683.patch \
file://qemu-guest-agent.init \
file://qemu-guest-agent.udev \
diff --git 
a/meta/recipes-devtools/qemu/qemu/0013-Makefile-preserve-jobserver-auth-argument-when-calli.patch
 
b/meta/recipes-devtools/qemu/qemu/0013-Makefile-preserve-jobserver-auth-argument-when-calli.patch
new file mode 100644
index 00..0dbc32eed0
--- /dev/null
+++ 
b/meta/recipes-devtools/qemu/qemu/0013-Makefile-preserve-jobserver-auth-argument-when-calli.patch
@@ -0,0 +1,37 @@
+From 730530c5f01e00cdc3754ebb8f3d7ff995f3376e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Hundeb=C3=B8ll?= 
+Date: Thu, 21 Sep 2023 10:57:45 +0200
+Subject: [PATCH] Makefile: preserve --jobserver-auth argument when calling
+ ninja
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Qemu wraps its call to ninja in a Makefile. Since ninja, as opposed to
+make, utilizes all CPU cores by default, the qemu Makefile translates
+the absense of a `-jN` argument into `-j1`. This breaks jobserver
+functionality, so update the -jN mangling to take the --jobserver-auth
+argument into considerationa too.
+
+Signed-off-by: Martin Hundebøll 
+Upstream-Status: Submitted 
[https://lists.nongnu.org/archive/html/qemu-devel/2024-04/msg00172.html]
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 8f36990335..183756018f 100644
+--- a/Makefile
 b/Makefile
+@@ -142,7 +142,7 @@ MAKE.k = $(findstring k,$(firstword $(filter-out 
--%,$(MAKEFLAGS
+ MAKE.q = $(findstring q,$(firstword $(filter-out --%,$(MAKEFLAGS
+ MAKE.nq = $(if $(word 2, $(MAKE.n) $(MAKE.q)),nq)
+ NINJAFLAGS = $(if $V,-v) $(if $(MAKE.n), -n) $(if $(MAKE.k), -k0) \
+-$(filter-out -j, $(lastword -j1 $(filter -l% -j%, $(MAKEFLAGS \
++$(or $(filter -l% -j%, $(MAKEFLAGS)), $(if $(filter 
--jobserver-auth=%, $(MAKEFLAGS)),, -j1)) \
+ -d keepdepfile
+ ninja-cmd-goals = $(or $(MAKECMDGOALS), all)
+ ninja-cmd-goals += $(foreach g, $(MAKECMDGOALS), $(.ninja-goals.$g))
+-- 
+2.44.0
+
-- 
2.44.0


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



[OE-core] [PATCH v2 5/5] contrib: add python service and systemd unit to run shared jobserver

2024-04-04 Thread Martin Hundeb?ll
For CI setups that might end up building multiple yocto builds in
parallel, a shared jobserver can reduce the total load of the system.
Setting up such a jobserver is simple, but it does require a process
hanging around to keep the jobserver fifo open (to avoid blocking token
requests).

Add a simple python script that creates such a jobserver fifo and waits
forever. Also add a systemd unit file to start the python service at
boot.

The systemd unit can be installed in $HOME/.config/systemd/user/, but
one might need to add a droplet config (i.e. `systemctl --user edit
jobserver.service`) to setup the PYTHONPATH variable to make the python
script loadable.

Signed-off-by: Martin Hundebøll 
---
 contrib/jobserver/jobserver.py  | 78 +
 contrib/jobserver/jobserver.service | 10 
 2 files changed, 88 insertions(+)
 create mode 100644 contrib/jobserver/jobserver.py
 create mode 100644 contrib/jobserver/jobserver.service

diff --git a/contrib/jobserver/jobserver.py b/contrib/jobserver/jobserver.py
new file mode 100644
index 00..52f9711277
--- /dev/null
+++ b/contrib/jobserver/jobserver.py
@@ -0,0 +1,78 @@
+#!/usr/bin/env python3
+
+from pathlib import Path
+from threading import Event
+import argparse
+import os
+import shutil
+import signal
+
+resumed = Event()
+runtime_dir = os.environ.get("XDG_RUNTIME_DIR", "/run")
+
+def signal_handler(signum, _frame):
+"""Wait for an external signal to exit the process gracefully."""
+resumed.set()
+
+
+def main(path, user, group, mode, jobs):
+"""Setup a fifo to use as jobserver shared between builds."""
+try:
+path.unlink(missing_ok=True)
+os.mkfifo(path)
+shutil.chown(path, user, group)
+os.chmod(path, mode)
+except (FileNotFoundError, PermissionError) as exc:
+raise SystemExit(f"failed to create fifo: {path}: {exc.strerror}")
+
+print(f"jobserver: {path}: {jobs} jobs")
+fifo = os.open(path, os.O_RDWR)
+os.write(fifo, b"+" * jobs)
+
+print("jobserver: ready; waiting indefinitely")
+signal.signal(signal.SIGTERM, signal_handler)
+signal.signal(signal.SIGINT, signal_handler)
+resumed.wait()
+
+print("jobserver: exiting")
+path.unlink()
+os.close(fifo)
+
+
+if __name__ == "__main__":
+parser = argparse.ArgumentParser(
+prog='Make jobserver',
+description='Simple application to instantiate a jobserver fifo and 
hang around',
+)
+parser.add_argument(
+"--mode",
+help="Permission to apply to jobserver fifo",
+type=lambda v: int(v, 8),
+default=0o0666,
+)
+parser.add_argument(
+"--user",
+help="Username or id to assign ownership of fifo to",
+default=os.getuid(),
+)
+parser.add_argument(
+"--group",
+help="Groupname or id to assign ownership of fifo to",
+default=os.getgid(),
+)
+parser.add_argument(
+"path",
+help="Path to jobserver fifo",
+type=Path,
+nargs='?',
+default=f"{runtime_dir}/jobserver",
+)
+parser.add_argument(
+"jobs",
+help="Number of tokens to load jobserver with",
+type=int,
+nargs='?',
+default=os.cpu_count(),
+)
+args = parser.parse_args()
+main(args.path, args.user, args.group, args.mode, args.jobs)
diff --git a/contrib/jobserver/jobserver.service 
b/contrib/jobserver/jobserver.service
new file mode 100644
index 00..bbc7167ac0
--- /dev/null
+++ b/contrib/jobserver/jobserver.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Shared jobserver fifo
+
+[Service]
+Type=simple
+Environment=PYTHONUNBUFFERED=1
+ExecStart=python jobserver.py
+
+[Install]
+WantedBy=multi-user.target
-- 
2.44.0


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



[OE-core] [PATCH v2 2/5] scripts: build-env: allow passing JOBSERVER_FIFO from environment

2024-04-04 Thread Martin Hundeb?ll
Sharing a common jobserver fifo between multiple (containerized) builds
is much easier, if an administrator can configure said jobserver fifo
path in the environment. Append the JOBSERVER_FIFO variable name to the
list of variables configurable through the environment.

Signed-off-by: Martin Hundebøll 
---
 scripts/oe-buildenv-internal | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/oe-buildenv-internal b/scripts/oe-buildenv-internal
index 2fdb19565a..c8e67ffb8f 100755
--- a/scripts/oe-buildenv-internal
+++ b/scripts/oe-buildenv-internal
@@ -112,7 +112,7 @@ HTTPS_PROXY https_proxy FTP_PROXY ftp_proxy FTPS_PROXY 
ftps_proxy ALL_PROXY \
 all_proxy NO_PROXY no_proxy SSH_AGENT_PID SSH_AUTH_SOCK BB_SRCREV_POLICY \
 SDKMACHINE BB_NUMBER_THREADS BB_NO_NETWORK PARALLEL_MAKE GIT_PROXY_COMMAND \
 SOCKS5_PASSWD SOCKS5_USER SCREENDIR STAMPS_DIR BBPATH_EXTRA 
BB_SETSCENE_ENFORCE \
-BB_LOGCONFIG"
+BB_LOGCONFIG JOBSERVER_FIFO"
 
 BB_ENV_PASSTHROUGH_ADDITIONS="$(echo $BB_ENV_PASSTHROUGH_ADDITIONS 
$BB_ENV_PASSTHROUGH_ADDITIONS_OE | tr ' ' '\n' | LC_ALL=C sort --unique | tr 
'\n' ' ')"
 
-- 
2.44.0


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



[OE-core] [PATCH v2 1/5] classes: jobserver: support gnu make fifo jobserver

2024-04-04 Thread Martin Hundeb?ll
Add a class to implement the gnu make fifo style jobserver. The class
can be activated by simply adding an `INHERIT += "jobserver"` to the
local configuration.

Furthermore, one can configure an external jobserver (i.e. a server
shared between multiple builds), by configuring the `JOBSERVER_FIFO`
variable to point at an existing jobserver fifo.

The jobserver class uses the fifo style jobserver, which doesn't require
passing open file descriptors around. It does, however, require
make-4.4, which isn't available in common distro yet. To work around
this, the class makes all recipes (except make and its dependencies
itself) depend on `virtual/make-native`.

Signed-off-by: Martin Hundebøll 
---
 meta/classes-global/jobserver.bbclass | 87 +++
 meta/conf/bitbake.conf|  2 +-
 2 files changed, 88 insertions(+), 1 deletion(-)
 create mode 100644 meta/classes-global/jobserver.bbclass

diff --git a/meta/classes-global/jobserver.bbclass 
b/meta/classes-global/jobserver.bbclass
new file mode 100644
index 00..3866b473e6
--- /dev/null
+++ b/meta/classes-global/jobserver.bbclass
@@ -0,0 +1,87 @@
+JOBSERVER_FIFO ?= ""
+JOBSERVER_FIFO[doc] = "Path to external jobserver fifo to use instead of 
creating a per-build server."
+
+JOBSERVER_IGNORE ?= ""
+JOBSERVER_IGNORE[doc] = "Space separated list of packages that shouldn't be 
configured to use the jobserver feature."
+
+addhandler jobserver_setup_fifo
+jobserver_setup_fifo[eventmask] = "bb.event.ConfigParsed"
+
+python jobserver_setup_fifo() {
+# don't setup a per-build fifo, if an external one is configured
+if d.getVar("JOBSERVER_FIFO"):
+return
+
+# don't use a job-server if no parallelism is configured
+jobs = oe.utils.parallel_make(d)
+if jobs in (None, 1):
+return
+
+# reduce jobs by one as a token has implicitly been handed to the
+# process requesting tokens
+jobs -= 1
+
+fifo = d.getVar("TMPDIR") + "/jobserver_fifo"
+
+# an old fifo might be lingering; remove it
+if os.path.exists(fifo):
+os.remove(fifo)
+
+# create a new fifo to use for communicating tokens
+os.mkfifo(fifo)
+
+# fill the fifo with the number of tokens to hand out
+wfd = os.open(fifo, os.O_RDWR)
+written = os.write(wfd, b"+" * jobs)
+if written != (jobs):
+bb.error("Failed to fil make fifo: {} != {}".format(written, jobs))
+
+# configure the per-build fifo path to use
+d.setVar("JOBSERVER_FIFO", fifo)
+}
+
+python () {
+# don't configure the fifo if none is defined
+fifo = d.getVar("JOBSERVER_FIFO")
+if not fifo:
+return
+
+# don't configure the fifo if the package wants to ignore it
+if d.getVar("PN") in (d.getVar("JOBSERVER_IGNORE") or "").split():
+return
+
+# avoid making make-native or its dependencies depend on make-native itself
+if d.getVar("PN") in (
+"make-native",
+"libtool-native",
+"pkgconfig-native",
+"automake-native",
+"autoconf-native",
+"m4-native",
+"texinfo-dummy-native",
+"gettext-minimal-native",
+"quilt-native",
+"gnu-config-native",
+):
+return
+
+# don't make unwilling recipes depend on make-native
+if d.getVar('INHIBIT_DEFAULT_DEPS', False):
+return
+
+# make other recipes depend on make-native to make sure it is new enough to
+# support the --jobserver-auth=fifo: syntax (from make-4.4 and 
onwards)
+d.appendVar("DEPENDS", " virtual/make-native")
+
+# disable the "-j " flag, as that overrides the jobserver fifo tokens
+d.setVar("PARALLEL_MAKE", "")
+d.setVar("PARALLEL_MAKEINST", "")
+
+# set and export the jobserver in the environment
+d.appendVar("MAKEFLAGS", " --jobserver-auth=fifo:" + fifo)
+d.setVarFlag("MAKEFLAGS", "export", "1")
+
+# ignore the jobserver argument part of MAKEFLAGS in the hash, as that
+# shouldn't change the build output
+d.appendVarFlag("MAKEFLAGS", "vardepvalueexclude", "| 
--jobserver-auth=fifo:" + fifo)
+}
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 6f180d18b0..23a016b31e 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -960,7 +960,7 @@ BB_HASHEXCLUDE_COMMON ?= "TMPDIR FILE PATH PWD BB_TASKHASH 
BBPATH BBSERVER DL_DI
 BB_WORKERCONTEXT BB_LIMITEDDEPS BB_UNIHASH extend_recipe_sysroot 
DEPLOY_DIR \
 SSTATE_HASHEQUIV_METHOD SSTATE_HASHEQUIV_REPORT_TASKDATA \
 SSTATE_HASHEQUIV_OWNER CCACHE_TOP_DIR BB_HASHSERVE GIT_CEILING_DIRECTORIES 
\
-OMP_NUM_THREADS BB_CURRENTTASK"
+OMP_NUM_THREADS BB_CURRENTTASK JOBSERVER_FIFO"
 BB_BASEHASH_IGNORE_VARS ?= "${BB_HASHEXCLUDE_COMMON} PSEUDO_IGNORE_PATHS 
BUILDHISTORY_DIR \
 SSTATE_DIR SOURCE_DATE_EPOCH RUST_BUILD_SYS RUST_HOST_SYS RUST_TARGET_SYS"
 BB_HASHCONFIG_IGNORE_VARS ?= "${BB_HASHEXCLUDE_COMMON} DATE TIME 

[OE-core] [PATCH v2 3/5] ninja: build modified version with GNU Make jobserver support

2024-04-04 Thread Martin Hundeb?ll
Ninja doesn't (yet) support the GNU Make jobserver out of the box, but
there is a pull request adding that support[1]. Since that pull request
(and its derived three-part pull requests) seem to be ignored by
upstream, kitware (creator/maintainer of cmake) has created a fork[2]
only to carry the jobserver patches. Change the source uri to point at
the kitware fork of ninja, and add two patches from the original pull
request to also support the new-style fifo jobserver feature.

Note that the kitware fork of ninja is also used by buildroot[3].

[1] https://github.com/ninja-build/ninja/pull/2263
[2] https://github.com/Kitware/ninja
[3] 
https://gitlab.com/buildroot.org/buildroot/-/blob/master/package/ninja/ninja.mk

Signed-off-by: Martin Hundebøll 
---
 ...ename-TokenPool-Setup-to-SetupClient.patch | 113 
 ...-jobserver-fifo-style-client-support.patch | 271 ++
 meta/recipes-devtools/ninja/ninja_1.11.1.bb   |   8 +-
 3 files changed, 390 insertions(+), 2 deletions(-)
 create mode 100644 
meta/recipes-devtools/ninja/files/0001-Rename-TokenPool-Setup-to-SetupClient.patch
 create mode 100644 
meta/recipes-devtools/ninja/files/0002-Add-GNU-make-jobserver-fifo-style-client-support.patch

diff --git 
a/meta/recipes-devtools/ninja/files/0001-Rename-TokenPool-Setup-to-SetupClient.patch
 
b/meta/recipes-devtools/ninja/files/0001-Rename-TokenPool-Setup-to-SetupClient.patch
new file mode 100644
index 00..a503f8c75f
--- /dev/null
+++ 
b/meta/recipes-devtools/ninja/files/0001-Rename-TokenPool-Setup-to-SetupClient.patch
@@ -0,0 +1,113 @@
+From f5642d8b49688dfc84679451b531d92f3b6e7cb0 Mon Sep 17 00:00:00 2001
+From: Stefan Becker 
+Date: Sat, 15 Dec 2018 19:29:42 +0200
+Subject: [PATCH 1/2] Rename TokenPool::Setup() to SetupClient()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Make space to add new API to set up token pool master.
+
+Signed-off-by: Martin Hundebøll 
+Upstream-Status: Submitted [https://github.com/Kitware/ninja/pull/2]
+---
+ src/build.cc  | 6 +++---
+ src/subprocess_test.cc| 3 ++-
+ src/tokenpool-gnu-make.cc | 6 +++---
+ src/tokenpool-gnu-make.h  | 3 ++-
+ src/tokenpool.h   | 3 ++-
+ src/tokenpool_test.cc | 2 +-
+ 6 files changed, 13 insertions(+), 10 deletions(-)
+
+diff --git a/src/build.cc b/src/build.cc
+index 53e4405..d8a6dff 100644
+--- a/src/build.cc
 b/src/build.cc
+@@ -474,9 +474,9 @@ struct RealCommandRunner : public CommandRunner {
+ RealCommandRunner::RealCommandRunner(const BuildConfig& config) : 
config_(config) {
+   max_load_average_ = config.max_load_average;
+   if ((tokens_ = TokenPool::Get()) != NULL) {
+-if (!tokens_->Setup(config_.parallelism_from_cmdline,
+-config_.verbosity == BuildConfig::VERBOSE,
+-max_load_average_)) {
++if (!tokens_->SetupClient(config_.parallelism_from_cmdline,
++  config_.verbosity == BuildConfig::VERBOSE,
++  max_load_average_)) {
+   delete tokens_;
+   tokens_ = NULL;
+ }
+diff --git a/src/subprocess_test.cc b/src/subprocess_test.cc
+index eddc110..222b59b 100644
+--- a/src/subprocess_test.cc
 b/src/subprocess_test.cc
+@@ -40,7 +40,8 @@ struct TestTokenPool : public TokenPool {
+   void Reserve() {}
+   void Release() {}
+   void Clear()   {}
+-  bool Setup(bool ignore_unused, bool verbose, double& max_load_average) { 
return false; }
++  bool SetupClient(bool ignore_unused, bool verbose,
++   double& max_load_average) { return false; }
+ 
+ #ifdef _WIN32
+   bool _token_available;
+diff --git a/src/tokenpool-gnu-make.cc b/src/tokenpool-gnu-make.cc
+index 60e0552..6fb72a6 100644
+--- a/src/tokenpool-gnu-make.cc
 b/src/tokenpool-gnu-make.cc
+@@ -28,9 +28,9 @@ GNUmakeTokenPool::GNUmakeTokenPool() : available_(1), 
used_(0) {
+ GNUmakeTokenPool::~GNUmakeTokenPool() {
+ }
+ 
+-bool GNUmakeTokenPool::Setup(bool ignore,
+- bool verbose,
+- double& max_load_average) {
++bool GNUmakeTokenPool::SetupClient(bool ignore,
++   bool verbose,
++   double& max_load_average) {
+   const char* value = GetEnv("MAKEFLAGS");
+   if (!value)
+ return false;
+diff --git a/src/tokenpool-gnu-make.h b/src/tokenpool-gnu-make.h
+index c94cca5..f4ab8d7 100644
+--- a/src/tokenpool-gnu-make.h
 b/src/tokenpool-gnu-make.h
+@@ -24,7 +24,8 @@ struct GNUmakeTokenPool : public TokenPool {
+   virtual void Reserve();
+   virtual void Release();
+   virtual void Clear();
+-  virtual bool Setup(bool ignore, bool verbose, double& max_load_average);
++  virtual bool SetupClient(bool ignore, bool verbose,
++   double& max_load_average);
+ 
+   // platform specific implementation
+   virtual const char* GetEnv(const char* name) = 0;
+diff --git a/src/tokenpool.h b/src/tokenpool.h

[OE-core] [PATCH v2 0/5] Jobserver support

2024-04-04 Thread Martin Hundeb?ll
The parallelism of bitbake easily uses every available core on the build
host. But since every task is run with the same number of parallel
threads/processes, multiple tasks might load the CPU excessively, which
in turn slows down the build due to scheduling overhead.

This patch series adds a class that creates a fifo filled with
PARALLEL_MAKE tokens. The path to the created fifo is then configured in
the MAKEFLAGS environment variable, which is read by make and a patched
ninja (and gcc if doing lto).

The benefits from using the jobserver depends on the set of executed
tasks: running multiple large do_compile tasks simultaneously benefits
more than multiple do_fetch tasks. A simple test building the following
tasks (and all their dependencies) yields a ~5% improvement in build
time (20:20 -> 19:20):

  nodejs-native
  rust-llvm-native
  rust-native
  linux-yocto
  qemu-native

On build machines shared by multiple users, a single jobserver can be
shared between multiple builds (using the JOBSERVER_FIFO variable).
Running the above build in two different build directories at the same
time gives a ~12% improvement (43:17 -> 37:55).

Finally, the memory pressure from e.g. compiling multiple c++ based
projects is also reduced. In our case, a cloud based build machine (with
32 cores and 32GB RAM) fails to compile llvm-rust-native (in parallel to
nodejs) without the jobserver due to a lack of memory.

This patch set is roughly based on previous work by Richard[1]. That
patch lists three TODO items, which are all addressed by these patches:
 * The fifo path defaults to TMPDIR/jobserver_fifo, but can be
   configured using JOBSERVER_FIFO.
 * The number of make threads defaults to the value from PARALLEL_MAKE
   (which is then redundant).
 * If PARALLEL_MAKE is unset, the jobserver functionality is skipped.

Further work in addition to this patch set could be to make bitbake
tasks jobserver aware.

Changes since v1[2]:
 * Fixed typos in various places
 * Added JOBSERVER_IGNORE variable to jobserver.bbclass in patch 1
 * Changed ninja to use kitware fork with only two patches added in
   patch 3
 * Updated upstream patch submission link in qemu in patch 4

Changes since the RFC[3]:
 * The ninja src uri change in patch 3 is converted to a set of patches
 * The qemu fix in patch 4 is converted to a submitted patch

[1] 
https://lore.kernel.org/openembedded-core/1423223184.20217.15.ca...@linuxfoundation.org/
[2] 
https://lore.kernel.org/openembedded-core/20240403070204.367470-1-mar...@geanix.com/
[3] 
https://lore.kernel.org/openembedded-core/20230828124834.376779-1-mar...@geanix.com/

Martin Hundebøll (5):
  classes: jobserver: support gnu make fifo jobserver
  scripts: build-env: allow passing JOBSERVER_FIFO from environment
  ninja: build modified version with GNU Make jobserver support
  qemu: enable parallel builds when using the jobserver class
  contrib: add python service and systemd unit to run shared jobserver

 contrib/jobserver/jobserver.py|  78 +
 contrib/jobserver/jobserver.service   |  10 +
 meta/classes-global/jobserver.bbclass |  87 ++
 meta/conf/bitbake.conf|   2 +-
 ...ename-TokenPool-Setup-to-SetupClient.patch | 113 
 ...-jobserver-fifo-style-client-support.patch | 271 ++
 meta/recipes-devtools/ninja/ninja_1.11.1.bb   |   8 +-
 meta/recipes-devtools/qemu/qemu.inc   |   1 +
 ...e-jobserver-auth-argument-when-calli.patch |  37 +++
 scripts/oe-buildenv-internal  |   2 +-
 10 files changed, 605 insertions(+), 4 deletions(-)
 create mode 100644 contrib/jobserver/jobserver.py
 create mode 100644 contrib/jobserver/jobserver.service
 create mode 100644 meta/classes-global/jobserver.bbclass
 create mode 100644 
meta/recipes-devtools/ninja/files/0001-Rename-TokenPool-Setup-to-SetupClient.patch
 create mode 100644 
meta/recipes-devtools/ninja/files/0002-Add-GNU-make-jobserver-fifo-style-client-support.patch
 create mode 100644 
meta/recipes-devtools/qemu/qemu/0013-Makefile-preserve-jobserver-auth-argument-when-calli.patch

-- 
2.44.0


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



[OE-core][PATCH 2/2] go: upgrade 1.22.1 -> 1.22.2

2024-04-04 Thread Jose Quaresma
Include fixes for CVE-2023-45288

Upgrade to latest 1.22.x release [1]:

$ git --no-pager log --oneline go1.22.1..go1.22.2
dddf0ae40f (tag: go1.22.2) [release-branch.go1.22] go1.22.2
e55d7cf843 [release-branch.go1.22] net/http: update bundled 
golang.org/x/net/http2
4edf4bb2c6 [release-branch.go1.22] all: update golang.org/x/net
2c6d106541 [release-branch.go1.22] cmd/compile: don't assume args are always 
zero-extended
46587483e3 [release-branch.go1.22] cmd/compile: fix sign/zero-extension removal
0a5b33a883 [release-branch.go1.22] encoding/gob: make x509.Certificate 
marshalable again
0c53f93faa [release-branch.go1.22] cmd/go/internal/modfetch: pass "-c" 
arguments to git before subcommands
abfd578156 [release-branch.go1.22] runtime: fix EvFrequency event value on 
Windows in the new tracer
7fb7acb82d [release-branch.go1.22] cmd/link/internal/riscv64: generate local 
text symbols for R_RISCV_CALL
e23707b59c [release-branch.go1.22] go/types, types2: handle Alias types in 
substitution
3826650c99 [release-branch.go1.22] cmd/compile: fix early deadcode with label 
statement
e71b0b1fee [release-branch.go1.22] cmd/compile: fix copying SSA-able variables 
optimization
9508eae5d1 [release-branch.go1.22] cmd/internal/obj/ppc64: don't modify 
runtime.elf_* symbols
35b1a146d9 [release-branch.go1.22] cmd/go: respect -coverpkg for unselected 
no-test packages

[1] https://github.com/golang/go/compare/go1.22.1...go1.22.2

Signed-off-by: Jose Quaresma 
---
 meta/recipes-devtools/go/{go-1.22.1.inc => go-1.22.2.inc}   | 2 +-
 ...o-binary-native_1.22.1.bb => go-binary-native_1.22.2.bb} | 6 +++---
 ...cross-canadian_1.22.1.bb => go-cross-canadian_1.22.2.bb} | 0
 .../go/{go-cross_1.22.1.bb => go-cross_1.22.2.bb}   | 0
 .../go/{go-crosssdk_1.22.1.bb => go-crosssdk_1.22.2.bb} | 0
 .../go/{go-native_1.22.1.bb => go-native_1.22.2.bb} | 0
 .../go/{go-runtime_1.22.1.bb => go-runtime_1.22.2.bb}   | 0
 meta/recipes-devtools/go/{go_1.22.1.bb => go_1.22.2.bb} | 0
 8 files changed, 4 insertions(+), 4 deletions(-)
 rename meta/recipes-devtools/go/{go-1.22.1.inc => go-1.22.2.inc} (89%)
 rename meta/recipes-devtools/go/{go-binary-native_1.22.1.bb => 
go-binary-native_1.22.2.bb} (78%)
 rename meta/recipes-devtools/go/{go-cross-canadian_1.22.1.bb => 
go-cross-canadian_1.22.2.bb} (100%)
 rename meta/recipes-devtools/go/{go-cross_1.22.1.bb => go-cross_1.22.2.bb} 
(100%)
 rename meta/recipes-devtools/go/{go-crosssdk_1.22.1.bb => 
go-crosssdk_1.22.2.bb} (100%)
 rename meta/recipes-devtools/go/{go-native_1.22.1.bb => go-native_1.22.2.bb} 
(100%)
 rename meta/recipes-devtools/go/{go-runtime_1.22.1.bb => go-runtime_1.22.2.bb} 
(100%)
 rename meta/recipes-devtools/go/{go_1.22.1.bb => go_1.22.2.bb} (100%)

diff --git a/meta/recipes-devtools/go/go-1.22.1.inc 
b/meta/recipes-devtools/go/go-1.22.2.inc
similarity index 89%
rename from meta/recipes-devtools/go/go-1.22.1.inc
rename to meta/recipes-devtools/go/go-1.22.2.inc
index f1cf4beebb..b399207311 100644
--- a/meta/recipes-devtools/go/go-1.22.1.inc
+++ b/meta/recipes-devtools/go/go-1.22.2.inc
@@ -15,4 +15,4 @@ SRC_URI += "\
 file://0008-src-cmd-dist-buildgo.go-do-not-hardcode-host-compile.patch \
 file://0009-go-Filter-build-paths-on-staticly-linked-arches.patch \
 "
-SRC_URI[main.sha256sum] = 
"79c9b91d7f109515a25fc3ecdaad125d67e6bdb54f6d4d98580f46799caea321"
+SRC_URI[main.sha256sum] = 
"374ea82b289ec738e968267cac59c7d5ff180f9492250254784b2044e90df5a9"
diff --git a/meta/recipes-devtools/go/go-binary-native_1.22.1.bb 
b/meta/recipes-devtools/go/go-binary-native_1.22.2.bb
similarity index 78%
rename from meta/recipes-devtools/go/go-binary-native_1.22.1.bb
rename to meta/recipes-devtools/go/go-binary-native_1.22.2.bb
index 8d8248df8a..0f00509f03 100644
--- a/meta/recipes-devtools/go/go-binary-native_1.22.1.bb
+++ b/meta/recipes-devtools/go/go-binary-native_1.22.2.bb
@@ -9,9 +9,9 @@ PROVIDES = "go-native"
 
 # Checksums available at https://go.dev/dl/
 SRC_URI = 
"https://dl.google.com/go/go${PV}.${BUILD_GOOS}-${BUILD_GOARCH}.tar.gz;name=go_${BUILD_GOTUPLE};
-SRC_URI[go_linux_amd64.sha256sum] = 
"aab8e15785c997ae20f9c88422ee35d962c4562212bb0f879d052a35c8307c7f"
-SRC_URI[go_linux_arm64.sha256sum] = 
"e56685a245b6a0c592fc4a55f0b7803af5b3f827aaa29feab1f40e491acf35b8"
-SRC_URI[go_linux_ppc64le.sha256sum] = 
"ac775e19d93cc1668999b77cfe8c8964abfbc658718feccfe6e0eb87663cd668"
+SRC_URI[go_linux_amd64.sha256sum] = 
"5901c52b7a78002aeff14a21f93e0f064f74ce1360fce51c6ee68cd471216a17"
+SRC_URI[go_linux_arm64.sha256sum] = 
"36e720b2d564980c162a48c7e97da2e407dfcc4239e1e58d98082dfa2486a0c1"
+SRC_URI[go_linux_ppc64le.sha256sum] = 
"251a8886c5113be6490bdbb955ddee98763b49c9b1bf4c8364c02d3b482dab00"
 
 UPSTREAM_CHECK_URI = "https://golang.org/dl/;
 UPSTREAM_CHECK_REGEX = "go(?P\d+(\.\d+)+)\.linux"
diff --git a/meta/recipes-devtools/go/go-cross-canadian_1.22.1.bb 
b/meta/recipes-devtools/go/go-cross-canadian_1.22.2.bb
similarity index 100%
rename from 

[OE-core][PATCH 1/2] go: keep the patches in order

2024-04-04 Thread Jose Quaresma
drop the old version no more used 
0007-exec.go-do-not-write-linker-flags-into-buildids.patch
that was replaced by the 
0001-exec.go-filter-out-build-specific-paths-from-linker-.patch
renamed now to 0007-exec.go-filter-out-build-specific-paths-from-linker-.patch

Signed-off-by: Jose Quaresma 
---
 meta/recipes-devtools/go/go-1.22.1.inc|  2 +-
 ...not-write-linker-flags-into-buildids.patch | 43 ---
 ...t-build-specific-paths-from-linker-.patch} |  0
 3 files changed, 1 insertion(+), 44 deletions(-)
 delete mode 100644 
meta/recipes-devtools/go/go/0007-exec.go-do-not-write-linker-flags-into-buildids.patch
 rename 
meta/recipes-devtools/go/go/{0001-exec.go-filter-out-build-specific-paths-from-linker-.patch
 => 0007-exec.go-filter-out-build-specific-paths-from-linker-.patch} (100%)

diff --git a/meta/recipes-devtools/go/go-1.22.1.inc 
b/meta/recipes-devtools/go/go-1.22.1.inc
index 4330853450..f1cf4beebb 100644
--- a/meta/recipes-devtools/go/go-1.22.1.inc
+++ b/meta/recipes-devtools/go/go-1.22.1.inc
@@ -11,8 +11,8 @@ SRC_URI += "\
 file://0004-make.bash-override-CC-when-building-dist-and-go_boot.patch \
 file://0005-cmd-dist-separate-host-and-target-builds.patch \
 file://0006-cmd-go-make-GOROOT-precious-by-default.patch \
+file://0007-exec.go-filter-out-build-specific-paths-from-linker-.patch \
 file://0008-src-cmd-dist-buildgo.go-do-not-hardcode-host-compile.patch \
 file://0009-go-Filter-build-paths-on-staticly-linked-arches.patch \
-file://0001-exec.go-filter-out-build-specific-paths-from-linker-.patch \
 "
 SRC_URI[main.sha256sum] = 
"79c9b91d7f109515a25fc3ecdaad125d67e6bdb54f6d4d98580f46799caea321"
diff --git 
a/meta/recipes-devtools/go/go/0007-exec.go-do-not-write-linker-flags-into-buildids.patch
 
b/meta/recipes-devtools/go/go/0007-exec.go-do-not-write-linker-flags-into-buildids.patch
deleted file mode 100644
index 35f3a98d80..00
--- 
a/meta/recipes-devtools/go/go/0007-exec.go-do-not-write-linker-flags-into-buildids.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 619991feab04f331d081a91243434ccd859f611d Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin 
-Date: Mon, 23 Nov 2020 19:22:04 +
-Subject: [PATCH 7/9] exec.go: do not write linker flags into buildids
-
-The flags can contain build-specific paths, breaking reproducibility.
-
-To make this acceptable to upstream, we probably need to trim the flags,
-removing those known to be buildhost-specific.
-
-Upstream-Status: Inappropriate [needs upstream discussion]
-
-Signed-off-by: Alexander Kanavin 
-Signed-off-by: Jose Quaresma 

- src/cmd/go/internal/work/exec.go | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/cmd/go/internal/work/exec.go 
b/src/cmd/go/internal/work/exec.go
-index 544df461a2..75df5a4aa8 100644
 a/src/cmd/go/internal/work/exec.go
-+++ b/src/cmd/go/internal/work/exec.go
-@@ -1374,7 +1374,7 @@ func (b *Builder) linkActionID(a *Action) cache.ActionID 
{
-   }
- 
-   // Toolchain-dependent configuration, shared with b.linkSharedActionID.
--  b.printLinkerConfig(h, p)
-+  //b.printLinkerConfig(h, p)
- 
-   // Input files.
-   for _, a1 := range a.Deps {
-@@ -1720,7 +1720,7 @@ func (b *Builder) linkSharedActionID(a *Action) 
cache.ActionID {
-   fmt.Fprintf(h, "goos %s goarch %s\n", cfg.Goos, cfg.Goarch)
- 
-   // Toolchain-dependent configuration, shared with b.linkActionID.
--  b.printLinkerConfig(h, nil)
-+  //b.printLinkerConfig(h, nil)
- 
-   // Input files.
-   for _, a1 := range a.Deps {
--- 
-2.44.0
-
diff --git 
a/meta/recipes-devtools/go/go/0001-exec.go-filter-out-build-specific-paths-from-linker-.patch
 
b/meta/recipes-devtools/go/go/0007-exec.go-filter-out-build-specific-paths-from-linker-.patch
similarity index 100%
rename from 
meta/recipes-devtools/go/go/0001-exec.go-filter-out-build-specific-paths-from-linker-.patch
rename to 
meta/recipes-devtools/go/go/0007-exec.go-filter-out-build-specific-paths-from-linker-.patch
-- 
2.44.0


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



[OE-core][PATCH] sstatesig: fix netrc.NetrcParseError exception

2024-04-04 Thread Jose Quaresma
Looks like sometimes the e.filename and the e.lineno is not properly set by the 
netrc
and this can cause TypeError.

| File "/poky/meta/lib/oe/sstatesig.py", line 342, in init_rundepcheck
| bb.warn("Error parsing %s:%d: %s" % (e.filename, e.lineno, e.msg))
| ~~^~~
| TypeError: %d format: a real number is required, not NoneType

Signed-off-by: Jose Quaresma 
---
 meta/lib/oe/sstatesig.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index b9aa39cdcc..a46e5502ab 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -339,7 +339,7 @@ class 
SignatureGeneratorOEEquivHash(SignatureGeneratorOEBasicHashMixIn, bb.sigge
 except FileNotFoundError:
 pass
 except netrc.NetrcParseError as e:
-bb.warn("Error parsing %s:%d: %s" % (e.filename, e.lineno, 
e.msg))
+bb.warn("Error parsing %s:%s: %s" % (e.filename, 
str(e.lineno), e.msg))
 
 # Insert these classes into siggen's namespace so it can see and select them
 bb.siggen.SignatureGeneratorOEBasicHash = SignatureGeneratorOEBasicHash
-- 
2.44.0


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#197952): 
https://lists.openembedded.org/g/openembedded-core/message/197952
Mute This Topic: https://lists.openembedded.org/mt/105325849/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] Debugging rust oe-selftest failures

2024-04-04 Thread Yash Shinde via lists.openembedded.org
On Wed, Apr 3, 2024 at 05:51 PM, Alex Kiernan wrote:

> 
> Hi Sundeep (or anyone else with insight on this!)
> 
> How do you go about debugging rust oe-selftest failures? I've bumped
> everything up to 1.77 ( https://github.com/akiernan/poky ) but
> oe-selftest fails for reasons that aren't immediately obvious to me...
> 
> https://gist.github.com/akiernan/6cc6131c1ec3af866098a9318679cf1b
> 
> Any clues?
> 
> --
> Alex Kiernan

Hi Alex,

I faced the same errors when I was working on to upgrade rust from 1.75 to 
1.76. I discussed it with rust upstream here, 
https://github.com/rust-lang/rust/issues/122075 and the following change solves 
those failures,

https://github.com/rust-lang/rust/issues/122075#issuecomment-1985153524

PR- 
https://github.com/rust-lang/rust/pull/122205/commits/5aece7fad06baaa745784d118db862b3e3ccf7f8

After this change was backported to poky, the rust build was successful but it 
was seen that not all the tests are executed.

While discussing upstream, it was known that removing the *--doc* option from 
*python3 src/bootstrap/bootstrap.py test --exclude --doc --no-fail-fast --bless --target x86_64-poky-linux-gnu* cmd in 
oeqa/selftest/cases/rust.py file execute the other tests also.

But, while doing so another set of failures are observed as mentioned in 
https://github.com/rust-lang/rust/issues/122285

Complete log using --doc option- 
https://gist.github.com/Yashinde145/7db6bd4a064021bf756b0c0dd6c8777c

Complete log without using --doc option- 
https://gist.github.com/Yashinde145/036a934f0523307859f7c855b83ecfd6 ( 
https://gist.github.com/Yashinde145/036a934f0523307859f7c855b83ecfd6 ) (this 
file is truncated in gist due to large size, please see Complete raw file ( 
https://gist.githubusercontent.com/Yashinde145/036a934f0523307859f7c855b83ecfd6/raw/f7bc4558eed66a10b65bb915f292ae166d3bb52a/log_1_76_without_doc_flag.txt
 ) )

I am not very familiar to these failures but  trying to understand them.

> 
> failures:
> 
>  markdown::term::tests::test_output stdout 
> 
> 
> 
> thread 'markdown::term::tests::test_output' panicked at
> compiler/rustc_errors/src/markdown/tests/term.rs:75:55:
> 
> 
> 
> called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound,
> message: "No such file or directory" }
> 
> 
> 
> stack backtrace:
> 
> 
> 
> 0: rust_begin_unwind
> 
> 
> 
> 1: core::panicking::panic_fmt
> 
> 
> 
> 2: core::result::unwrap_failed
> 
> 
> 
> 3: rustc_errors::markdown::term::tests::test_output
> 
> 
> 
> 4:  core::ops::function::FnOnce<()>>::call_once
> 
> 
> 
> note: Some details are omitted, run with `RUST_BACKTRACE=full` for a
> verbose backtrace.
> 
> 
> 
> Running unittests src/lib.rs
> (/home/poky/build-st/tmp/work/core2-64-poky-linux/rust/1.76.0/rustc-1.76.0-src/build/bootstrap/debug/deps/bootstrap-214111e112557758)
> 
> 
> 
> 
> uploaded
> "/home/poky/build-st/tmp/work/core2-64-poky-linux/rust/1.76.0/rustc-1.76.0-src/build/bootstrap/debug/deps/bootstrap-214111e112557758",
> waiting for result
> 
> 
> 
> thread 'main' panicked at src/tools/remote-test-client/src/main.rs:310:9:
> 
> 
> 
> client.read_exact( header) failed with failed to fill whole buffer
> 
> 
> 
> stack backtrace:
> 
> 
> 
> 0: rust_begin_unwind
> 
> 
> 
> at
> /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:645:5
> 
> 
> 
> 
> 1: core::panicking::panic_fmt
> 
> 
> 
> at
> /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/panicking.rs:72:14
> 
> 
> 
> 
> 2: remote_test_client::main
> 
> 
> 
> note: Some details are omitted, run with `RUST_BACKTRACE=full` for a
> verbose backtrace.
> 
> 
> 
> error: test failed, to rerun pass `--lib`
> 
> 
> 
> error: 1 target failed:
> 
> 
> 
> `--lib`
> 
> 
> 
> finished in 16.730 seconds
> 
> 

Regards,

Yash

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#197951): 
https://lists.openembedded.org/g/openembedded-core/message/197951
Mute This Topic: https://lists.openembedded.org/mt/105307188/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] [qa-build-notification] QA notification for completed autobuilder build (yocto-4.3.4.rc2)

2024-04-04 Thread Jing Hui Tham
Hi All,
 
QA for yocto-4.3.4.rc2 is completed. This is the full report for this release:  
https://git.yoctoproject.org/cgit/cgit.cgi/yocto-testresults-contrib/tree/?h=intel-yocto-testresults
 
=== Summary 
No high milestone defects.
 
No new issue found. 
 
Thanks,
Jing Hui


> -Original Message-
> From: qa-build-notificat...@lists.yoctoproject.org  notificat...@lists.yoctoproject.org> On Behalf Of Pokybuild User
> Sent: Sunday, March 31, 2024 8:31 AM
> To: yo...@lists.yoctoproject.org
> Cc: qa-build-notificat...@lists.yoctoproject.org
> Subject: [qa-build-notification] QA notification for completed autobuilder
> build (yocto-4.3.4.rc2)
> 
> 
> A build flagged for QA (yocto-4.3.4.rc2) was completed on the autobuilder
> and is available at:
> 
> 
> https://autobuilder.yocto.io/pub/releases/yocto-4.3.4.rc2
> 
> 
> Build URL:
> https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/6745
> 
> Build hash information:
> 
> bitbake: 380a9ac97de5774378ded5e37d40b79b96761a0c
> meta-agl: 5d487f3f281cd632d02b5aa16b2b1e0470f9afd8
> meta-arm: 150169d01f2f57dcd65854a2a43aebef87ee8d98
> meta-aws: 46ece2480cebc6be90a6056361f480d39976240e
> meta-clang: 73c00a5a0bebc871854e43cc1f0fe5bd5e5ad1d7
> meta-intel: e0c541c10f561b9c0087fd07ad5b79b0a534dab1
> meta-mingw: 49617a253e09baabbf0355bc736122e9549c8ab2
> meta-openembedded: da9063bdfbe130f424ba487f167da68e0ce90e7d
> meta-virtualization: ac125d881f34ff356390e19e02964f8980d4ec38
> oecore: d0e68072d138ccc1fb5957fdc46a91871eb6a3e1
> poky: 7b8aa378d069ee31373f22caba3bd7fc7863f447
> 
> 
> 
> This is an automated message from the Yocto Project Autobuilder
> Git: git://git.yoctoproject.org/yocto-autobuilder2
> Email: richard.pur...@linuxfoundation.org
> 
> 
> 
> 
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#197950): 
https://lists.openembedded.org/g/openembedded-core/message/197950
Mute This Topic: https://lists.openembedded.org/mt/105259815/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] OE-core and meta-openembedded: a vulnerability in HTTP servers

2024-04-04 Thread Jose Quaresma
Hi Marta,

I will take care of updating the golang to 1.22.2 witch include a fix for
the CVE-2023-45288
https://github.com/golang/go/commit/e55d7cf8435ba4e58d4a5694e63b391821d4ee9b

Jose

Marta Rybczynska  escreveu (quarta, 3/04/2024 à(s)
21:46):

> Details: https://kb.cert.org/vuls/id/421644
>
> Affected (amongst others): nodejs, oghttp, nghttp2, Apache httpd, go
>
> Multiple CVEs have been issued.
>
> Quoting from the description:
>
> HTTP allows messages to include named fields in both header and
> trailer sections. These header and trailer fields are serialised as
> field blocks in HTTP/2, so that they can be transmitted in multiple
> fragments to the target implementation. Many HTTP/2 implementations do
> not properly limit or sanitize the amount of CONTINUATION frames sent
> within a single stream. An attacker that can send packets to a target
> server can send a stream of CONTINUATION frames that will not be
> appended to the header list in memory but will still be processed and
> decoded by the server or will be appended to the header list, causing
> an out of memory (OOM) crash.
>
> Marta
>
> 
>
>

-- 
Best regards,

José Quaresma

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#197949): 
https://lists.openembedded.org/g/openembedded-core/message/197949
Mute This Topic: https://lists.openembedded.org/mt/105317551/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 1/5] classes: jobserver: support gnu make fifo jobserver

2024-04-04 Thread Martin Hundeb?ll
Hi Andreas,

On Thu, 2024-04-04 at 09:56 +0200, Andreas Helbech Kleist wrote:
> > +    # avoid making make-native or its dependencies depend on make-
> > native itself
> > +    if d.getVar("PN") in (
> > +    "make-native",
> > +    "libtool-native",
> > +    "pkgconfig-native",
> > +    "automake-native",
> > +    "autoconf-native",
> > +    "m4-native",
> > +    "texinfo-dummy-native",
> > +    "gettext-minimal-native",
> > +    "quilt-native",
> > +    "gnu-config-native",
> 
> This seems a bit brittle, but I guess make's dependencies doesn't
> change often. So it is probably not a big issue.
> 
> How does it break if a dependency is missing?

Bitbake errors out with a dependency loop.

// Martin

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#197948): 
https://lists.openembedded.org/g/openembedded-core/message/197948
Mute This Topic: https://lists.openembedded.org/mt/105304233/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 1/5] classes: jobserver: support gnu make fifo jobserver

2024-04-04 Thread Andreas Helbech Kleist
Hi 

Very interesting patch series. I stumbled upon a couple of spelling
errors while looking through it, and have a question about the
hardcoded dependency list.

On Wed, 2024-04-03 at 09:02 +0200, Martin Hundeb?ll wrote:
> Add a class to implement the gnu make fifo style jobserver. The class
> can be activated by symply adding an `INHERIT += "jobserver"` to the

s/symply/simply/

> local configuration.
> 
> Furthermore, one can configure an external jobserver (i.e. a server
> shared between multiple builds), by configured the `JOBSERVER_FIFO`
> variable to point at an existing jobserver fifo.
> 
> The jobserver class uses the fifo style jobserver, which doesn't require
> passing open file descriptors around. It does, however, require
> make-4.4, which isn't available in common distro yet. To work around
> this, the class make all recipes (except make and its dependencies
> itself) depend on `virtual/make-native`.
> 
> Signed-off-by: Martin Hundebøll 
> ---
>  meta/classes-global/jobserver.bbclass | 80 +++
>  meta/conf/bitbake.conf|  2 +-
>  2 files changed, 81 insertions(+), 1 deletion(-)
>  create mode 100644 meta/classes-global/jobserver.bbclass
> 
> diff --git a/meta/classes-global/jobserver.bbclass 
> b/meta/classes-global/jobserver.bbclass
> new file mode 100644
> index 00..c76909fe50
> --- /dev/null
> +++ b/meta/classes-global/jobserver.bbclass
> @@ -0,0 +1,80 @@
> +JOBSERVER_FIFO ?= ""
> +JOBSERVER_FIFO[doc] = "Path to external jobserver fifo to use instead of 
> creating a per-build server."
> +
> +addhandler jobserver_setup_fifo
> +jobserver_setup_fifo[eventmask] = "bb.event.ConfigParsed"
> +
> +python jobserver_setup_fifo() {
> +# don't setup a per-build fifo, if an external one is configured
> +if d.getVar("JOBSERVER_FIFO"):
> +return
> +
> +# don't use a job-server if no parallelism is configured
> +jobs = oe.utils.parallel_make(d)
> +if jobs in (None, 1):
> +return
> +
> +# reduce jobs by one as a token has implicitly been handed to the
> +# process requesting tokens
> +jobs -= 1
> +
> +fifo = d.getVar("TMPDIR") + "/jobserver_fifo"
> +
> +# and old fifo might be lingering; remove it
> +if os.path.exists(fifo):
> +os.remove(fifo)
> +
> +# create a new fifo to use for communicating tokens
> +os.mkfifo(fifo)
> +
> +# fill the fifo with the number of tokens to hand out
> +wfd = os.open(fifo, os.O_RDWR)
> +written = os.write(wfd, b"+" * jobs)
> +if written != (jobs):
> +bb.error("Failed to fil make fifo: {} != {}".format(written, jobs))
> +
> +# configure the per-build fifo path to use
> +d.setVar("JOBSERVER_FIFO", fifo)
> +}
> +
> +python () {
> +# don't configure the fifo if none is defined
> +fifo = d.getVar("JOBSERVER_FIFO")
> +if not fifo:
> +return
> +
> +# avoid making make-native or its dependencies depend on make-native 
> itself
> +if d.getVar("PN") in (
> +"make-native",
> +"libtool-native",
> +"pkgconfig-native",
> +"automake-native",
> +"autoconf-native",
> +"m4-native",
> +"texinfo-dummy-native",
> +"gettext-minimal-native",
> +"quilt-native",
> +"gnu-config-native",

This seems a bit brittle, but I guess make's dependencies doesn't
change often. So it is probably not a big issue.

How does it break if a dependency is missing?

> +):
> +return
> +
> +# don't make unwilling recipes depend on make-native
> +if d.getVar('INHIBIT_DEFAULT_DEPS', False):
> +return
> +
> +# make other recipes depend on make-native to make sure it is new enough 
> to
> +# support the --jobserver-auth=fifo: syntax (from make-4.4 and 
> onwards)
> +d.appendVar("DEPENDS", " virtual/make-native")
> +
> +# disable the "-j " flag, as that overrides the jobserver fifo 
> tokens
> +d.setVar("PARALLEL_MAKE", "")
> +d.setVar("PARALLEL_MAKEINST", "")
> +
> +# set and export the jobserver in the environment
> +d.appendVar("MAKEFLAGS", " --jobserver-auth=fifo:" + fifo)
> +d.setVarFlag("MAKEFLAGS", "export", "1")
> +
> +# ignore the joberserver argument part of MAKEFLAGS in the hash, as that

s/joberserver/jobserver/

> +# shouldn't change the build output
> +d.appendVarFlag("MAKEFLAGS", "vardepvalueexclude", "| 
> --jobserver-auth=fifo:" + fifo)
> +}
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index 6f180d18b0..23a016b31e 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -960,7 +960,7 @@ BB_HASHEXCLUDE_COMMON ?= "TMPDIR FILE PATH PWD 
> BB_TASKHASH BBPATH BBSERVER DL_DI
>  BB_WORKERCONTEXT BB_LIMITEDDEPS BB_UNIHASH extend_recipe_sysroot 
> DEPLOY_DIR \
>  SSTATE_HASHEQUIV_METHOD SSTATE_HASHEQUIV_REPORT_TASKDATA \
>  SSTATE_HASHEQUIV_OWNER