diff mbox series

[v2,1/3] bitbake.conf: Add conditional host tool getent

Message ID 20250204105315.84079-1-uvv.mail@gmail.com
State New
Headers show
Series [v2,1/3] bitbake.conf: Add conditional host tool getent | expand

Commit Message

Vyacheslav Yurkov Feb. 4, 2025, 10:53 a.m. UTC
From: Vyacheslav Yurkov <uvv.mail@gmail.com>

In case of systemd init mananger, it's required for the native build.
Even though we don't build systemd natively, we might build some of its
binaries, which need to run on the host system.

Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
---
 meta/conf/bitbake.conf | 3 +++
 1 file changed, 3 insertions(+)

Comments

Richard Purdie Feb. 4, 2025, 11:03 a.m. UTC | #1
On Tue, 2025-02-04 at 11:53 +0100, Vyacheslav Yurkov via lists.openembedded.org wrote:
> From: Vyacheslav Yurkov <uvv.mail@gmail.com>
> 
> In case of systemd init mananger, it's required for the native build.
> Even though we don't build systemd natively, we might build some of its
> binaries, which need to run on the host system.
> 
> Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
> ---
>  meta/conf/bitbake.conf | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index 8b607088c6..6b1bfaf64e 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -532,6 +532,9 @@ HOSTTOOLS += "${@'ip ping ps scp ssh stty' if (bb.utils.contains_any('IMAGE_CLAS
>  # Used by archiver.bbclass when compression is xz
>  HOSTTOOLS += "${@'xz' if (('archiver.bbclass' in (d.getVar('BBINCLUDED') or '')) and (d.getVarFlag('ARCHIVER_MODE', 'compression') == 'xz')) else ''}"
>  
> +# Native build of systemd tools requires getent utility
> +HOSTTOOLS += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'getent', '', d)}"
> +
>  # Link to these if present
>  HOSTTOOLS_NONFATAL += "aws gcc-ar gpg gpg-agent ld.bfd ld.gold nc pigz sftp socat ssh sudo"

I'm a bit nervous about relying on getent being present. It comes from
glibc and I'm a bit concerned about the host implications of depending
upon that. It certainly gives us a very specific host dependency
(unlike more generic things like coreutils).

Do we have any more information about where/why systemctl is using it
and whether we really do need it?

Cheers,

Richard
Vyacheslav Yurkov Feb. 4, 2025, 11:33 a.m. UTC | #2
I don't think systemctl actually needs it. But I believe the patch
disabling it won't be suitable for upstream.

Will send a v3 later today that doesn't modify HOSTTOOLS.

Slava

On Tue, Feb 4, 2025, 12:03 Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:

> On Tue, 2025-02-04 at 11:53 +0100, Vyacheslav Yurkov via
> lists.openembedded.org wrote:
> > From: Vyacheslav Yurkov <uvv.mail@gmail.com>
> >
> > In case of systemd init mananger, it's required for the native build.
> > Even though we don't build systemd natively, we might build some of its
> > binaries, which need to run on the host system.
> >
> > Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
> > ---
> >  meta/conf/bitbake.conf | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> > index 8b607088c6..6b1bfaf64e 100644
> > --- a/meta/conf/bitbake.conf
> > +++ b/meta/conf/bitbake.conf
> > @@ -532,6 +532,9 @@ HOSTTOOLS += "${@'ip ping ps scp ssh stty' if
> (bb.utils.contains_any('IMAGE_CLAS
> >  # Used by archiver.bbclass when compression is xz
> >  HOSTTOOLS += "${@'xz' if (('archiver.bbclass' in
> (d.getVar('BBINCLUDED') or '')) and (d.getVarFlag('ARCHIVER_MODE',
> 'compression') == 'xz')) else ''}"
> >
> > +# Native build of systemd tools requires getent utility
> > +HOSTTOOLS += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd',
> 'getent', '', d)}"
> > +
> >  # Link to these if present
> >  HOSTTOOLS_NONFATAL += "aws gcc-ar gpg gpg-agent ld.bfd ld.gold nc pigz
> sftp socat ssh sudo"
>
> I'm a bit nervous about relying on getent being present. It comes from
> glibc and I'm a bit concerned about the host implications of depending
> upon that. It certainly gives us a very specific host dependency
> (unlike more generic things like coreutils).
>
> Do we have any more information about where/why systemctl is using it
> and whether we really do need it?
>
> Cheers,
>
> Richard
>
diff mbox series

Patch

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 8b607088c6..6b1bfaf64e 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -532,6 +532,9 @@  HOSTTOOLS += "${@'ip ping ps scp ssh stty' if (bb.utils.contains_any('IMAGE_CLAS
 # Used by archiver.bbclass when compression is xz
 HOSTTOOLS += "${@'xz' if (('archiver.bbclass' in (d.getVar('BBINCLUDED') or '')) and (d.getVarFlag('ARCHIVER_MODE', 'compression') == 'xz')) else ''}"
 
+# Native build of systemd tools requires getent utility
+HOSTTOOLS += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'getent', '', d)}"
+
 # Link to these if present
 HOSTTOOLS_NONFATAL += "aws gcc-ar gpg gpg-agent ld.bfd ld.gold nc pigz sftp socat ssh sudo"