diff mbox series

[2/7] bitbake.conf: do not set native opengl distro feature from target

Message ID 20230312145053.1427377-2-alex@linutronix.de
State New
Headers show
Series [1/7] runqemu: direct mesa to use its own drivers, rather than ones provided by host distro | expand

Commit Message

Alexander Kanavin March 12, 2023, 2:50 p.m. UTC
This makes native opengl (and thus accelerated graphics in qemu) opt-in;
the reason is that latest mesa tightly couples hardware drivers with its libraries,
so we have to build both in mesa-native. Doing so significantly lengthens
the builds, and so cannot be imposed by default.

Add a check and a hint to runqemu so that there is a helpful error when
there is no native/nativesdk opengl/virgl support.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 meta/conf/bitbake.conf                       |  4 ++--
 meta/lib/oeqa/selftest/cases/runtime_test.py |  4 ++--
 scripts/runqemu                              | 11 ++++++++++-
 3 files changed, 14 insertions(+), 5 deletions(-)

Comments

Khem Raj March 13, 2023, 10:45 p.m. UTC | #1
I am seeing waylandpp failing to build and YP layer compatibility tests failing.

https://autobuilder.yoctoproject.org/typhoon/#/builders/88/builds/2557/steps/11/logs/stdio

On Sun, Mar 12, 2023 at 7:51 AM Alexander Kanavin
<alex.kanavin@gmail.com> wrote:
>
> This makes native opengl (and thus accelerated graphics in qemu) opt-in;
> the reason is that latest mesa tightly couples hardware drivers with its libraries,
> so we have to build both in mesa-native. Doing so significantly lengthens
> the builds, and so cannot be imposed by default.
>
> Add a check and a hint to runqemu so that there is a helpful error when
> there is no native/nativesdk opengl/virgl support.
>
> Signed-off-by: Alexander Kanavin <alex@linutronix.de>
> ---
>  meta/conf/bitbake.conf                       |  4 ++--
>  meta/lib/oeqa/selftest/cases/runtime_test.py |  4 ++--
>  scripts/runqemu                              | 11 ++++++++++-
>  3 files changed, 14 insertions(+), 5 deletions(-)
>
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index afd9e2f552..d1dc428583 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -912,8 +912,8 @@ DISTRO_FEATURES_NATIVESDK ?= "x11"
>
>  # Normally target distro features will not be applied to native builds:
>  # Native distro features on this list will use the target feature value
> -DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation debuginfod opengl wayland"
> -DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation debuginfod opengl wayland"
> +DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation debuginfod wayland"
> +DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation debuginfod wayland"
>
>  DISTRO_FEATURES_BACKFILL = "pulseaudio sysvinit gobject-introspection-data ldconfig"
>  MACHINE_FEATURES_BACKFILL = "rtc qemu-usermode"
> diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py
> index 81b8d056cc..661c09c109 100644
> --- a/meta/lib/oeqa/selftest/cases/runtime_test.py
> +++ b/meta/lib/oeqa/selftest/cases/runtime_test.py
> @@ -232,7 +232,7 @@ class TestImage(OESelftestTestCase):
>          if 'sdl' not in qemu_packageconfig:
>              features += 'PACKAGECONFIG:append:pn-qemu-system-native = " sdl"\n'
>          if 'opengl' not in qemu_distrofeatures:
> -            features += 'DISTRO_FEATURES:append = " opengl"\n'
> +            features += 'DISTRO_FEATURES_NATIVE:append = " opengl"\n'
>          features += 'TEST_SUITES = "ping ssh virgl"\n'
>          features += 'IMAGE_FEATURES:append = " ssh-server-dropbear"\n'
>          features += 'IMAGE_INSTALL:append = " kmscube"\n'
> @@ -264,7 +264,7 @@ class TestImage(OESelftestTestCase):
>          qemu_distrofeatures = get_bb_var('DISTRO_FEATURES', 'qemu-system-native')
>          features = 'IMAGE_CLASSES += "testimage"\n'
>          if 'opengl' not in qemu_distrofeatures:
> -            features += 'DISTRO_FEATURES:append = " opengl"\n'
> +            features += 'DISTRO_FEATURES_NATIVE:append = " opengl"\n'
>          features += 'TEST_SUITES = "ping ssh virgl"\n'
>          features += 'IMAGE_FEATURES:append = " ssh-server-dropbear"\n'
>          features += 'IMAGE_INSTALL:append = " kmscube"\n'
> diff --git a/scripts/runqemu b/scripts/runqemu
> index 8e915f3d4c..9f82aa12f1 100755
> --- a/scripts/runqemu
> +++ b/scripts/runqemu
> @@ -447,7 +447,16 @@ class BaseConfig(object):
>              self.set("MACHINE", arg)
>
>      def set_dri_path(self):
> -        self.qemu_environ['LIBGL_DRIVERS_PATH'] = os.path.join(self.bindir_native, '../lib/dri')
> +        drivers_path = os.path.join(self.bindir_native, '../lib/dri')
> +        if not os.path.exists(drivers_path) or not os.listdir(drivers_path):
> +            raise RunQemuError("""
> +qemu has been built without opengl support and accelerated graphics support is not available.
> +To enable it, add:
> +DISTRO_FEATURES_NATIVE:append = " opengl"
> +DISTRO_FEATURES_NATIVESDK:append = " opengl"
> +to your build configuration.
> +""")
> +        self.qemu_environ['LIBGL_DRIVERS_PATH'] = drivers_path
>
>      def check_args(self):
>          for debug in ("-d", "--debug"):
> --
> 2.30.2
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#178393): https://lists.openembedded.org/g/openembedded-core/message/178393
> Mute This Topic: https://lists.openembedded.org/mt/97560251/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Khem Raj March 13, 2023, 11:10 p.m. UTC | #2
also seeing below errors which are related too

ERROR: Nothing PROVIDES 'gtk4-native' (but
/mnt/b/yoe/master/sources/meta-openembedded/meta-gnome/recipes-gnome/gnome-bluetooth/gnome-bluetooth_42.5.bb,
/mnt/b/yoe/master/
sources/meta-openembedded/meta-gnome/recipes-gnome/gnome-text-editor/gnome-text-editor_43.1.bb,
/mnt/b/yoe/master/sources/meta-openembedded/meta-gnome/recipes-gnome/gnome-
chess/gnome-chess_43.1.bb,
/mnt/b/yoe/master/sources/meta-openembedded/meta-gnome/recipes-gnome/gnome-calculator/gnome-calculator_43.0.1.bb
DEPENDS on or otherwise require
s it)
gtk4-native was skipped: missing required distro feature 'opengl' (not
in DISTRO_FEATURES)

On Mon, Mar 13, 2023 at 3:45 PM Khem Raj <raj.khem@gmail.com> wrote:
>
> I am seeing waylandpp failing to build and YP layer compatibility tests failing.
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/88/builds/2557/steps/11/logs/stdio
>
> On Sun, Mar 12, 2023 at 7:51 AM Alexander Kanavin
> <alex.kanavin@gmail.com> wrote:
> >
> > This makes native opengl (and thus accelerated graphics in qemu) opt-in;
> > the reason is that latest mesa tightly couples hardware drivers with its libraries,
> > so we have to build both in mesa-native. Doing so significantly lengthens
> > the builds, and so cannot be imposed by default.
> >
> > Add a check and a hint to runqemu so that there is a helpful error when
> > there is no native/nativesdk opengl/virgl support.
> >
> > Signed-off-by: Alexander Kanavin <alex@linutronix.de>
> > ---
> >  meta/conf/bitbake.conf                       |  4 ++--
> >  meta/lib/oeqa/selftest/cases/runtime_test.py |  4 ++--
> >  scripts/runqemu                              | 11 ++++++++++-
> >  3 files changed, 14 insertions(+), 5 deletions(-)
> >
> > diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> > index afd9e2f552..d1dc428583 100644
> > --- a/meta/conf/bitbake.conf
> > +++ b/meta/conf/bitbake.conf
> > @@ -912,8 +912,8 @@ DISTRO_FEATURES_NATIVESDK ?= "x11"
> >
> >  # Normally target distro features will not be applied to native builds:
> >  # Native distro features on this list will use the target feature value
> > -DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation debuginfod opengl wayland"
> > -DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation debuginfod opengl wayland"
> > +DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation debuginfod wayland"
> > +DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation debuginfod wayland"
> >
> >  DISTRO_FEATURES_BACKFILL = "pulseaudio sysvinit gobject-introspection-data ldconfig"
> >  MACHINE_FEATURES_BACKFILL = "rtc qemu-usermode"
> > diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py
> > index 81b8d056cc..661c09c109 100644
> > --- a/meta/lib/oeqa/selftest/cases/runtime_test.py
> > +++ b/meta/lib/oeqa/selftest/cases/runtime_test.py
> > @@ -232,7 +232,7 @@ class TestImage(OESelftestTestCase):
> >          if 'sdl' not in qemu_packageconfig:
> >              features += 'PACKAGECONFIG:append:pn-qemu-system-native = " sdl"\n'
> >          if 'opengl' not in qemu_distrofeatures:
> > -            features += 'DISTRO_FEATURES:append = " opengl"\n'
> > +            features += 'DISTRO_FEATURES_NATIVE:append = " opengl"\n'
> >          features += 'TEST_SUITES = "ping ssh virgl"\n'
> >          features += 'IMAGE_FEATURES:append = " ssh-server-dropbear"\n'
> >          features += 'IMAGE_INSTALL:append = " kmscube"\n'
> > @@ -264,7 +264,7 @@ class TestImage(OESelftestTestCase):
> >          qemu_distrofeatures = get_bb_var('DISTRO_FEATURES', 'qemu-system-native')
> >          features = 'IMAGE_CLASSES += "testimage"\n'
> >          if 'opengl' not in qemu_distrofeatures:
> > -            features += 'DISTRO_FEATURES:append = " opengl"\n'
> > +            features += 'DISTRO_FEATURES_NATIVE:append = " opengl"\n'
> >          features += 'TEST_SUITES = "ping ssh virgl"\n'
> >          features += 'IMAGE_FEATURES:append = " ssh-server-dropbear"\n'
> >          features += 'IMAGE_INSTALL:append = " kmscube"\n'
> > diff --git a/scripts/runqemu b/scripts/runqemu
> > index 8e915f3d4c..9f82aa12f1 100755
> > --- a/scripts/runqemu
> > +++ b/scripts/runqemu
> > @@ -447,7 +447,16 @@ class BaseConfig(object):
> >              self.set("MACHINE", arg)
> >
> >      def set_dri_path(self):
> > -        self.qemu_environ['LIBGL_DRIVERS_PATH'] = os.path.join(self.bindir_native, '../lib/dri')
> > +        drivers_path = os.path.join(self.bindir_native, '../lib/dri')
> > +        if not os.path.exists(drivers_path) or not os.listdir(drivers_path):
> > +            raise RunQemuError("""
> > +qemu has been built without opengl support and accelerated graphics support is not available.
> > +To enable it, add:
> > +DISTRO_FEATURES_NATIVE:append = " opengl"
> > +DISTRO_FEATURES_NATIVESDK:append = " opengl"
> > +to your build configuration.
> > +""")
> > +        self.qemu_environ['LIBGL_DRIVERS_PATH'] = drivers_path
> >
> >      def check_args(self):
> >          for debug in ("-d", "--debug"):
> > --
> > 2.30.2
> >
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#178393): https://lists.openembedded.org/g/openembedded-core/message/178393
> > Mute This Topic: https://lists.openembedded.org/mt/97560251/1997914
> > Group Owner: openembedded-core+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
Alexander Kanavin March 14, 2023, 8:37 a.m. UTC | #3
This means opengl has to be added to DISTRO_FEATURES_NATIVE for this
build. I'll send a patch.

Alex

On Tue, 14 Mar 2023 at 00:10, Khem Raj <raj.khem@gmail.com> wrote:
>
> also seeing below errors which are related too
>
> ERROR: Nothing PROVIDES 'gtk4-native' (but
> /mnt/b/yoe/master/sources/meta-openembedded/meta-gnome/recipes-gnome/gnome-bluetooth/gnome-bluetooth_42.5.bb,
> /mnt/b/yoe/master/
> sources/meta-openembedded/meta-gnome/recipes-gnome/gnome-text-editor/gnome-text-editor_43.1.bb,
> /mnt/b/yoe/master/sources/meta-openembedded/meta-gnome/recipes-gnome/gnome-
> chess/gnome-chess_43.1.bb,
> /mnt/b/yoe/master/sources/meta-openembedded/meta-gnome/recipes-gnome/gnome-calculator/gnome-calculator_43.0.1.bb
> DEPENDS on or otherwise require
> s it)
> gtk4-native was skipped: missing required distro feature 'opengl' (not
> in DISTRO_FEATURES)
>
> On Mon, Mar 13, 2023 at 3:45 PM Khem Raj <raj.khem@gmail.com> wrote:
> >
> > I am seeing waylandpp failing to build and YP layer compatibility tests failing.
> >
> > https://autobuilder.yoctoproject.org/typhoon/#/builders/88/builds/2557/steps/11/logs/stdio
> >
> > On Sun, Mar 12, 2023 at 7:51 AM Alexander Kanavin
> > <alex.kanavin@gmail.com> wrote:
> > >
> > > This makes native opengl (and thus accelerated graphics in qemu) opt-in;
> > > the reason is that latest mesa tightly couples hardware drivers with its libraries,
> > > so we have to build both in mesa-native. Doing so significantly lengthens
> > > the builds, and so cannot be imposed by default.
> > >
> > > Add a check and a hint to runqemu so that there is a helpful error when
> > > there is no native/nativesdk opengl/virgl support.
> > >
> > > Signed-off-by: Alexander Kanavin <alex@linutronix.de>
> > > ---
> > >  meta/conf/bitbake.conf                       |  4 ++--
> > >  meta/lib/oeqa/selftest/cases/runtime_test.py |  4 ++--
> > >  scripts/runqemu                              | 11 ++++++++++-
> > >  3 files changed, 14 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> > > index afd9e2f552..d1dc428583 100644
> > > --- a/meta/conf/bitbake.conf
> > > +++ b/meta/conf/bitbake.conf
> > > @@ -912,8 +912,8 @@ DISTRO_FEATURES_NATIVESDK ?= "x11"
> > >
> > >  # Normally target distro features will not be applied to native builds:
> > >  # Native distro features on this list will use the target feature value
> > > -DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation debuginfod opengl wayland"
> > > -DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation debuginfod opengl wayland"
> > > +DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation debuginfod wayland"
> > > +DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation debuginfod wayland"
> > >
> > >  DISTRO_FEATURES_BACKFILL = "pulseaudio sysvinit gobject-introspection-data ldconfig"
> > >  MACHINE_FEATURES_BACKFILL = "rtc qemu-usermode"
> > > diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py
> > > index 81b8d056cc..661c09c109 100644
> > > --- a/meta/lib/oeqa/selftest/cases/runtime_test.py
> > > +++ b/meta/lib/oeqa/selftest/cases/runtime_test.py
> > > @@ -232,7 +232,7 @@ class TestImage(OESelftestTestCase):
> > >          if 'sdl' not in qemu_packageconfig:
> > >              features += 'PACKAGECONFIG:append:pn-qemu-system-native = " sdl"\n'
> > >          if 'opengl' not in qemu_distrofeatures:
> > > -            features += 'DISTRO_FEATURES:append = " opengl"\n'
> > > +            features += 'DISTRO_FEATURES_NATIVE:append = " opengl"\n'
> > >          features += 'TEST_SUITES = "ping ssh virgl"\n'
> > >          features += 'IMAGE_FEATURES:append = " ssh-server-dropbear"\n'
> > >          features += 'IMAGE_INSTALL:append = " kmscube"\n'
> > > @@ -264,7 +264,7 @@ class TestImage(OESelftestTestCase):
> > >          qemu_distrofeatures = get_bb_var('DISTRO_FEATURES', 'qemu-system-native')
> > >          features = 'IMAGE_CLASSES += "testimage"\n'
> > >          if 'opengl' not in qemu_distrofeatures:
> > > -            features += 'DISTRO_FEATURES:append = " opengl"\n'
> > > +            features += 'DISTRO_FEATURES_NATIVE:append = " opengl"\n'
> > >          features += 'TEST_SUITES = "ping ssh virgl"\n'
> > >          features += 'IMAGE_FEATURES:append = " ssh-server-dropbear"\n'
> > >          features += 'IMAGE_INSTALL:append = " kmscube"\n'
> > > diff --git a/scripts/runqemu b/scripts/runqemu
> > > index 8e915f3d4c..9f82aa12f1 100755
> > > --- a/scripts/runqemu
> > > +++ b/scripts/runqemu
> > > @@ -447,7 +447,16 @@ class BaseConfig(object):
> > >              self.set("MACHINE", arg)
> > >
> > >      def set_dri_path(self):
> > > -        self.qemu_environ['LIBGL_DRIVERS_PATH'] = os.path.join(self.bindir_native, '../lib/dri')
> > > +        drivers_path = os.path.join(self.bindir_native, '../lib/dri')
> > > +        if not os.path.exists(drivers_path) or not os.listdir(drivers_path):
> > > +            raise RunQemuError("""
> > > +qemu has been built without opengl support and accelerated graphics support is not available.
> > > +To enable it, add:
> > > +DISTRO_FEATURES_NATIVE:append = " opengl"
> > > +DISTRO_FEATURES_NATIVESDK:append = " opengl"
> > > +to your build configuration.
> > > +""")
> > > +        self.qemu_environ['LIBGL_DRIVERS_PATH'] = drivers_path
> > >
> > >      def check_args(self):
> > >          for debug in ("-d", "--debug"):
> > > --
> > > 2.30.2
> > >
> > >
> > > -=-=-=-=-=-=-=-=-=-=-=-
> > > Links: You receive all messages sent to this group.
> > > View/Reply Online (#178393): https://lists.openembedded.org/g/openembedded-core/message/178393
> > > Mute This Topic: https://lists.openembedded.org/mt/97560251/1997914
> > > Group Owner: openembedded-core+owner@lists.openembedded.org
> > > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> > > -=-=-=-=-=-=-=-=-=-=-=-
> > >
Alexander Kanavin March 14, 2023, 9:30 a.m. UTC | #4
On second thought I'm not sure anymore. The issue comes from items
requiring -native versions of themselves, and REQUIRED_DISTRO_FEATURES
(which skips unbuildable recipes) doesn't cross that boundary. If
opengl is in target features, but not in native features, then it
won't figure out that skipping is required.

Should we just keep opengl in native distro features by default?
Sooner or later there will be an item in core that needs gtk4-native
(and thus mesa-native and llvm-native). Llvm is not *that* heavy, rust
for example is four times heavier.

Alex

On Tue, 14 Mar 2023 at 09:37, Alexander Kanavin via
lists.openembedded.org <alex.kanavin=gmail.com@lists.openembedded.org>
wrote:
>
> This means opengl has to be added to DISTRO_FEATURES_NATIVE for this
> build. I'll send a patch.
>
> Alex
>
> On Tue, 14 Mar 2023 at 00:10, Khem Raj <raj.khem@gmail.com> wrote:
> >
> > also seeing below errors which are related too
> >
> > ERROR: Nothing PROVIDES 'gtk4-native' (but
> > /mnt/b/yoe/master/sources/meta-openembedded/meta-gnome/recipes-gnome/gnome-bluetooth/gnome-bluetooth_42.5.bb,
> > /mnt/b/yoe/master/
> > sources/meta-openembedded/meta-gnome/recipes-gnome/gnome-text-editor/gnome-text-editor_43.1.bb,
> > /mnt/b/yoe/master/sources/meta-openembedded/meta-gnome/recipes-gnome/gnome-
> > chess/gnome-chess_43.1.bb,
> > /mnt/b/yoe/master/sources/meta-openembedded/meta-gnome/recipes-gnome/gnome-calculator/gnome-calculator_43.0.1.bb
> > DEPENDS on or otherwise require
> > s it)
> > gtk4-native was skipped: missing required distro feature 'opengl' (not
> > in DISTRO_FEATURES)
> >
> > On Mon, Mar 13, 2023 at 3:45 PM Khem Raj <raj.khem@gmail.com> wrote:
> > >
> > > I am seeing waylandpp failing to build and YP layer compatibility tests failing.
> > >
> > > https://autobuilder.yoctoproject.org/typhoon/#/builders/88/builds/2557/steps/11/logs/stdio
> > >
> > > On Sun, Mar 12, 2023 at 7:51 AM Alexander Kanavin
> > > <alex.kanavin@gmail.com> wrote:
> > > >
> > > > This makes native opengl (and thus accelerated graphics in qemu) opt-in;
> > > > the reason is that latest mesa tightly couples hardware drivers with its libraries,
> > > > so we have to build both in mesa-native. Doing so significantly lengthens
> > > > the builds, and so cannot be imposed by default.
> > > >
> > > > Add a check and a hint to runqemu so that there is a helpful error when
> > > > there is no native/nativesdk opengl/virgl support.
> > > >
> > > > Signed-off-by: Alexander Kanavin <alex@linutronix.de>
> > > > ---
> > > >  meta/conf/bitbake.conf                       |  4 ++--
> > > >  meta/lib/oeqa/selftest/cases/runtime_test.py |  4 ++--
> > > >  scripts/runqemu                              | 11 ++++++++++-
> > > >  3 files changed, 14 insertions(+), 5 deletions(-)
> > > >
> > > > diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> > > > index afd9e2f552..d1dc428583 100644
> > > > --- a/meta/conf/bitbake.conf
> > > > +++ b/meta/conf/bitbake.conf
> > > > @@ -912,8 +912,8 @@ DISTRO_FEATURES_NATIVESDK ?= "x11"
> > > >
> > > >  # Normally target distro features will not be applied to native builds:
> > > >  # Native distro features on this list will use the target feature value
> > > > -DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation debuginfod opengl wayland"
> > > > -DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation debuginfod opengl wayland"
> > > > +DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation debuginfod wayland"
> > > > +DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation debuginfod wayland"
> > > >
> > > >  DISTRO_FEATURES_BACKFILL = "pulseaudio sysvinit gobject-introspection-data ldconfig"
> > > >  MACHINE_FEATURES_BACKFILL = "rtc qemu-usermode"
> > > > diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py
> > > > index 81b8d056cc..661c09c109 100644
> > > > --- a/meta/lib/oeqa/selftest/cases/runtime_test.py
> > > > +++ b/meta/lib/oeqa/selftest/cases/runtime_test.py
> > > > @@ -232,7 +232,7 @@ class TestImage(OESelftestTestCase):
> > > >          if 'sdl' not in qemu_packageconfig:
> > > >              features += 'PACKAGECONFIG:append:pn-qemu-system-native = " sdl"\n'
> > > >          if 'opengl' not in qemu_distrofeatures:
> > > > -            features += 'DISTRO_FEATURES:append = " opengl"\n'
> > > > +            features += 'DISTRO_FEATURES_NATIVE:append = " opengl"\n'
> > > >          features += 'TEST_SUITES = "ping ssh virgl"\n'
> > > >          features += 'IMAGE_FEATURES:append = " ssh-server-dropbear"\n'
> > > >          features += 'IMAGE_INSTALL:append = " kmscube"\n'
> > > > @@ -264,7 +264,7 @@ class TestImage(OESelftestTestCase):
> > > >          qemu_distrofeatures = get_bb_var('DISTRO_FEATURES', 'qemu-system-native')
> > > >          features = 'IMAGE_CLASSES += "testimage"\n'
> > > >          if 'opengl' not in qemu_distrofeatures:
> > > > -            features += 'DISTRO_FEATURES:append = " opengl"\n'
> > > > +            features += 'DISTRO_FEATURES_NATIVE:append = " opengl"\n'
> > > >          features += 'TEST_SUITES = "ping ssh virgl"\n'
> > > >          features += 'IMAGE_FEATURES:append = " ssh-server-dropbear"\n'
> > > >          features += 'IMAGE_INSTALL:append = " kmscube"\n'
> > > > diff --git a/scripts/runqemu b/scripts/runqemu
> > > > index 8e915f3d4c..9f82aa12f1 100755
> > > > --- a/scripts/runqemu
> > > > +++ b/scripts/runqemu
> > > > @@ -447,7 +447,16 @@ class BaseConfig(object):
> > > >              self.set("MACHINE", arg)
> > > >
> > > >      def set_dri_path(self):
> > > > -        self.qemu_environ['LIBGL_DRIVERS_PATH'] = os.path.join(self.bindir_native, '../lib/dri')
> > > > +        drivers_path = os.path.join(self.bindir_native, '../lib/dri')
> > > > +        if not os.path.exists(drivers_path) or not os.listdir(drivers_path):
> > > > +            raise RunQemuError("""
> > > > +qemu has been built without opengl support and accelerated graphics support is not available.
> > > > +To enable it, add:
> > > > +DISTRO_FEATURES_NATIVE:append = " opengl"
> > > > +DISTRO_FEATURES_NATIVESDK:append = " opengl"
> > > > +to your build configuration.
> > > > +""")
> > > > +        self.qemu_environ['LIBGL_DRIVERS_PATH'] = drivers_path
> > > >
> > > >      def check_args(self):
> > > >          for debug in ("-d", "--debug"):
> > > > --
> > > > 2.30.2
> > > >
> > > >
> > > >
> > > >
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#178476): https://lists.openembedded.org/g/openembedded-core/message/178476
> Mute This Topic: https://lists.openembedded.org/mt/97560251/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Alexandre Belloni March 15, 2023, 1:38 p.m. UTC | #5
Hello,

I did a build without this patch (as requested by Richard) and this fails:

https://autobuilder.yoctoproject.org/typhoon/#builders/127/builds/1108/steps/15/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#builders/80/builds/4881/steps/14/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#builders/87/builds/4962/steps/15/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#builders/86/builds/4925/steps/14/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#builders/79/builds/4933/steps/15/logs/stdio

2023-03-14 22:03:50,363 - oe-selftest - INFO - 5: 28/29 389/524 (117.66s) (0 failed) (sstatetests.SStateHashSameSigs.test_sstate_32_64_same_hash)
2023-03-14 22:03:50,363 - oe-selftest - INFO - testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/lib/oeqa/selftest/cases/sstatetests.py", line 384, in test_sstate_32_64_same_hash
    self.assertCountEqual(files1, files2)
  File "/home/pokybuild/yocto-worker/oe-selftest-centos/build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/python3.11/unittest/case.py", line 1233, in assertCountEqual
    self.fail(msg)
  File "/home/pokybuild/yocto-worker/oe-selftest-centos/build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/python3.11/unittest/case.py", line 703, in fail
    raise self.failureException(msg)
AssertionError: Element counts were not equal:
First has 1, Second has 0:  '/home/pokybuild/yocto-worker/oe-selftest-centos/build/build-st-3258797/tmp-sstatesamehash/stamps/x86_64-linux/qemu-system-native/7.2.0-r0.do_install.sigdata.d8cf53551eece8c83f2c7af7604df092d24c822c2e81b1f24db8387e2725b79a'
First has 1, Second has 0:  '/home/pokybuild/yocto-worker/oe-selftest-centos/build/build-st-3258797/tmp-sstatesamehash/stamps/x86_64-linux/qemu-system-native/7.2.0-r0.do_configure.sigdata.7d1cb6d46ec6af33727e5a149e9e3adc948cfc5b008523c7ac59e9e909087e53'
[...]

On 14/03/2023 10:30:14+0100, Alexander Kanavin wrote:
> On second thought I'm not sure anymore. The issue comes from items
> requiring -native versions of themselves, and REQUIRED_DISTRO_FEATURES
> (which skips unbuildable recipes) doesn't cross that boundary. If
> opengl is in target features, but not in native features, then it
> won't figure out that skipping is required.
> 
> Should we just keep opengl in native distro features by default?
> Sooner or later there will be an item in core that needs gtk4-native
> (and thus mesa-native and llvm-native). Llvm is not *that* heavy, rust
> for example is four times heavier.
> 
> Alex
> 
> On Tue, 14 Mar 2023 at 09:37, Alexander Kanavin via
> lists.openembedded.org <alex.kanavin=gmail.com@lists.openembedded.org>
> wrote:
> >
> > This means opengl has to be added to DISTRO_FEATURES_NATIVE for this
> > build. I'll send a patch.
> >
> > Alex
> >
> > On Tue, 14 Mar 2023 at 00:10, Khem Raj <raj.khem@gmail.com> wrote:
> > >
> > > also seeing below errors which are related too
> > >
> > > ERROR: Nothing PROVIDES 'gtk4-native' (but
> > > /mnt/b/yoe/master/sources/meta-openembedded/meta-gnome/recipes-gnome/gnome-bluetooth/gnome-bluetooth_42.5.bb,
> > > /mnt/b/yoe/master/
> > > sources/meta-openembedded/meta-gnome/recipes-gnome/gnome-text-editor/gnome-text-editor_43.1.bb,
> > > /mnt/b/yoe/master/sources/meta-openembedded/meta-gnome/recipes-gnome/gnome-
> > > chess/gnome-chess_43.1.bb,
> > > /mnt/b/yoe/master/sources/meta-openembedded/meta-gnome/recipes-gnome/gnome-calculator/gnome-calculator_43.0.1.bb
> > > DEPENDS on or otherwise require
> > > s it)
> > > gtk4-native was skipped: missing required distro feature 'opengl' (not
> > > in DISTRO_FEATURES)
> > >
> > > On Mon, Mar 13, 2023 at 3:45 PM Khem Raj <raj.khem@gmail.com> wrote:
> > > >
> > > > I am seeing waylandpp failing to build and YP layer compatibility tests failing.
> > > >
> > > > https://autobuilder.yoctoproject.org/typhoon/#/builders/88/builds/2557/steps/11/logs/stdio
> > > >
> > > > On Sun, Mar 12, 2023 at 7:51 AM Alexander Kanavin
> > > > <alex.kanavin@gmail.com> wrote:
> > > > >
> > > > > This makes native opengl (and thus accelerated graphics in qemu) opt-in;
> > > > > the reason is that latest mesa tightly couples hardware drivers with its libraries,
> > > > > so we have to build both in mesa-native. Doing so significantly lengthens
> > > > > the builds, and so cannot be imposed by default.
> > > > >
> > > > > Add a check and a hint to runqemu so that there is a helpful error when
> > > > > there is no native/nativesdk opengl/virgl support.
> > > > >
> > > > > Signed-off-by: Alexander Kanavin <alex@linutronix.de>
> > > > > ---
> > > > >  meta/conf/bitbake.conf                       |  4 ++--
> > > > >  meta/lib/oeqa/selftest/cases/runtime_test.py |  4 ++--
> > > > >  scripts/runqemu                              | 11 ++++++++++-
> > > > >  3 files changed, 14 insertions(+), 5 deletions(-)
> > > > >
> > > > > diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> > > > > index afd9e2f552..d1dc428583 100644
> > > > > --- a/meta/conf/bitbake.conf
> > > > > +++ b/meta/conf/bitbake.conf
> > > > > @@ -912,8 +912,8 @@ DISTRO_FEATURES_NATIVESDK ?= "x11"
> > > > >
> > > > >  # Normally target distro features will not be applied to native builds:
> > > > >  # Native distro features on this list will use the target feature value
> > > > > -DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation debuginfod opengl wayland"
> > > > > -DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation debuginfod opengl wayland"
> > > > > +DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation debuginfod wayland"
> > > > > +DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation debuginfod wayland"
> > > > >
> > > > >  DISTRO_FEATURES_BACKFILL = "pulseaudio sysvinit gobject-introspection-data ldconfig"
> > > > >  MACHINE_FEATURES_BACKFILL = "rtc qemu-usermode"
> > > > > diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py
> > > > > index 81b8d056cc..661c09c109 100644
> > > > > --- a/meta/lib/oeqa/selftest/cases/runtime_test.py
> > > > > +++ b/meta/lib/oeqa/selftest/cases/runtime_test.py
> > > > > @@ -232,7 +232,7 @@ class TestImage(OESelftestTestCase):
> > > > >          if 'sdl' not in qemu_packageconfig:
> > > > >              features += 'PACKAGECONFIG:append:pn-qemu-system-native = " sdl"\n'
> > > > >          if 'opengl' not in qemu_distrofeatures:
> > > > > -            features += 'DISTRO_FEATURES:append = " opengl"\n'
> > > > > +            features += 'DISTRO_FEATURES_NATIVE:append = " opengl"\n'
> > > > >          features += 'TEST_SUITES = "ping ssh virgl"\n'
> > > > >          features += 'IMAGE_FEATURES:append = " ssh-server-dropbear"\n'
> > > > >          features += 'IMAGE_INSTALL:append = " kmscube"\n'
> > > > > @@ -264,7 +264,7 @@ class TestImage(OESelftestTestCase):
> > > > >          qemu_distrofeatures = get_bb_var('DISTRO_FEATURES', 'qemu-system-native')
> > > > >          features = 'IMAGE_CLASSES += "testimage"\n'
> > > > >          if 'opengl' not in qemu_distrofeatures:
> > > > > -            features += 'DISTRO_FEATURES:append = " opengl"\n'
> > > > > +            features += 'DISTRO_FEATURES_NATIVE:append = " opengl"\n'
> > > > >          features += 'TEST_SUITES = "ping ssh virgl"\n'
> > > > >          features += 'IMAGE_FEATURES:append = " ssh-server-dropbear"\n'
> > > > >          features += 'IMAGE_INSTALL:append = " kmscube"\n'
> > > > > diff --git a/scripts/runqemu b/scripts/runqemu
> > > > > index 8e915f3d4c..9f82aa12f1 100755
> > > > > --- a/scripts/runqemu
> > > > > +++ b/scripts/runqemu
> > > > > @@ -447,7 +447,16 @@ class BaseConfig(object):
> > > > >              self.set("MACHINE", arg)
> > > > >
> > > > >      def set_dri_path(self):
> > > > > -        self.qemu_environ['LIBGL_DRIVERS_PATH'] = os.path.join(self.bindir_native, '../lib/dri')
> > > > > +        drivers_path = os.path.join(self.bindir_native, '../lib/dri')
> > > > > +        if not os.path.exists(drivers_path) or not os.listdir(drivers_path):
> > > > > +            raise RunQemuError("""
> > > > > +qemu has been built without opengl support and accelerated graphics support is not available.
> > > > > +To enable it, add:
> > > > > +DISTRO_FEATURES_NATIVE:append = " opengl"
> > > > > +DISTRO_FEATURES_NATIVESDK:append = " opengl"
> > > > > +to your build configuration.
> > > > > +""")
> > > > > +        self.qemu_environ['LIBGL_DRIVERS_PATH'] = drivers_path
> > > > >
> > > > >      def check_args(self):
> > > > >          for debug in ("-d", "--debug"):
> > > > > --
> > > > > 2.30.2
> > > > >
> > > > >
> > > > >
> > > > >
> >
> > 
> >

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#178478): https://lists.openembedded.org/g/openembedded-core/message/178478
> Mute This Topic: https://lists.openembedded.org/mt/97560251/3617179
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alexandre.belloni@bootlin.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Alexander Kanavin March 16, 2023, 9:42 a.m. UTC | #6
I just sent a revised patchset that drops this patch and addresses the
sstatetests failure below. I did not run it through AB, but I don't
expect breakage.

Alex

On Wed, 15 Mar 2023 at 14:38, Alexandre Belloni
<alexandre.belloni@bootlin.com> wrote:
>
> Hello,
>
> I did a build without this patch (as requested by Richard) and this fails:
>
> https://autobuilder.yoctoproject.org/typhoon/#builders/127/builds/1108/steps/15/logs/stdio
> https://autobuilder.yoctoproject.org/typhoon/#builders/80/builds/4881/steps/14/logs/stdio
> https://autobuilder.yoctoproject.org/typhoon/#builders/87/builds/4962/steps/15/logs/stdio
> https://autobuilder.yoctoproject.org/typhoon/#builders/86/builds/4925/steps/14/logs/stdio
> https://autobuilder.yoctoproject.org/typhoon/#builders/79/builds/4933/steps/15/logs/stdio
>
> 2023-03-14 22:03:50,363 - oe-selftest - INFO - 5: 28/29 389/524 (117.66s) (0 failed) (sstatetests.SStateHashSameSigs.test_sstate_32_64_same_hash)
> 2023-03-14 22:03:50,363 - oe-selftest - INFO - testtools.testresult.real._StringException: Traceback (most recent call last):
>   File "/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/lib/oeqa/selftest/cases/sstatetests.py", line 384, in test_sstate_32_64_same_hash
>     self.assertCountEqual(files1, files2)
>   File "/home/pokybuild/yocto-worker/oe-selftest-centos/build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/python3.11/unittest/case.py", line 1233, in assertCountEqual
>     self.fail(msg)
>   File "/home/pokybuild/yocto-worker/oe-selftest-centos/build/buildtools/sysroots/x86_64-pokysdk-linux/usr/lib/python3.11/unittest/case.py", line 703, in fail
>     raise self.failureException(msg)
> AssertionError: Element counts were not equal:
> First has 1, Second has 0:  '/home/pokybuild/yocto-worker/oe-selftest-centos/build/build-st-3258797/tmp-sstatesamehash/stamps/x86_64-linux/qemu-system-native/7.2.0-r0.do_install.sigdata.d8cf53551eece8c83f2c7af7604df092d24c822c2e81b1f24db8387e2725b79a'
> First has 1, Second has 0:  '/home/pokybuild/yocto-worker/oe-selftest-centos/build/build-st-3258797/tmp-sstatesamehash/stamps/x86_64-linux/qemu-system-native/7.2.0-r0.do_configure.sigdata.7d1cb6d46ec6af33727e5a149e9e3adc948cfc5b008523c7ac59e9e909087e53'
> [...]
>
> On 14/03/2023 10:30:14+0100, Alexander Kanavin wrote:
> > On second thought I'm not sure anymore. The issue comes from items
> > requiring -native versions of themselves, and REQUIRED_DISTRO_FEATURES
> > (which skips unbuildable recipes) doesn't cross that boundary. If
> > opengl is in target features, but not in native features, then it
> > won't figure out that skipping is required.
> >
> > Should we just keep opengl in native distro features by default?
> > Sooner or later there will be an item in core that needs gtk4-native
> > (and thus mesa-native and llvm-native). Llvm is not *that* heavy, rust
> > for example is four times heavier.
> >
> > Alex
> >
> > On Tue, 14 Mar 2023 at 09:37, Alexander Kanavin via
> > lists.openembedded.org <alex.kanavin=gmail.com@lists.openembedded.org>
> > wrote:
> > >
> > > This means opengl has to be added to DISTRO_FEATURES_NATIVE for this
> > > build. I'll send a patch.
> > >
> > > Alex
> > >
> > > On Tue, 14 Mar 2023 at 00:10, Khem Raj <raj.khem@gmail.com> wrote:
> > > >
> > > > also seeing below errors which are related too
> > > >
> > > > ERROR: Nothing PROVIDES 'gtk4-native' (but
> > > > /mnt/b/yoe/master/sources/meta-openembedded/meta-gnome/recipes-gnome/gnome-bluetooth/gnome-bluetooth_42.5.bb,
> > > > /mnt/b/yoe/master/
> > > > sources/meta-openembedded/meta-gnome/recipes-gnome/gnome-text-editor/gnome-text-editor_43.1.bb,
> > > > /mnt/b/yoe/master/sources/meta-openembedded/meta-gnome/recipes-gnome/gnome-
> > > > chess/gnome-chess_43.1.bb,
> > > > /mnt/b/yoe/master/sources/meta-openembedded/meta-gnome/recipes-gnome/gnome-calculator/gnome-calculator_43.0.1.bb
> > > > DEPENDS on or otherwise require
> > > > s it)
> > > > gtk4-native was skipped: missing required distro feature 'opengl' (not
> > > > in DISTRO_FEATURES)
> > > >
> > > > On Mon, Mar 13, 2023 at 3:45 PM Khem Raj <raj.khem@gmail.com> wrote:
> > > > >
> > > > > I am seeing waylandpp failing to build and YP layer compatibility tests failing.
> > > > >
> > > > > https://autobuilder.yoctoproject.org/typhoon/#/builders/88/builds/2557/steps/11/logs/stdio
> > > > >
> > > > > On Sun, Mar 12, 2023 at 7:51 AM Alexander Kanavin
> > > > > <alex.kanavin@gmail.com> wrote:
> > > > > >
> > > > > > This makes native opengl (and thus accelerated graphics in qemu) opt-in;
> > > > > > the reason is that latest mesa tightly couples hardware drivers with its libraries,
> > > > > > so we have to build both in mesa-native. Doing so significantly lengthens
> > > > > > the builds, and so cannot be imposed by default.
> > > > > >
> > > > > > Add a check and a hint to runqemu so that there is a helpful error when
> > > > > > there is no native/nativesdk opengl/virgl support.
> > > > > >
> > > > > > Signed-off-by: Alexander Kanavin <alex@linutronix.de>
> > > > > > ---
> > > > > >  meta/conf/bitbake.conf                       |  4 ++--
> > > > > >  meta/lib/oeqa/selftest/cases/runtime_test.py |  4 ++--
> > > > > >  scripts/runqemu                              | 11 ++++++++++-
> > > > > >  3 files changed, 14 insertions(+), 5 deletions(-)
> > > > > >
> > > > > > diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> > > > > > index afd9e2f552..d1dc428583 100644
> > > > > > --- a/meta/conf/bitbake.conf
> > > > > > +++ b/meta/conf/bitbake.conf
> > > > > > @@ -912,8 +912,8 @@ DISTRO_FEATURES_NATIVESDK ?= "x11"
> > > > > >
> > > > > >  # Normally target distro features will not be applied to native builds:
> > > > > >  # Native distro features on this list will use the target feature value
> > > > > > -DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation debuginfod opengl wayland"
> > > > > > -DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation debuginfod opengl wayland"
> > > > > > +DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation debuginfod wayland"
> > > > > > +DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation debuginfod wayland"
> > > > > >
> > > > > >  DISTRO_FEATURES_BACKFILL = "pulseaudio sysvinit gobject-introspection-data ldconfig"
> > > > > >  MACHINE_FEATURES_BACKFILL = "rtc qemu-usermode"
> > > > > > diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py
> > > > > > index 81b8d056cc..661c09c109 100644
> > > > > > --- a/meta/lib/oeqa/selftest/cases/runtime_test.py
> > > > > > +++ b/meta/lib/oeqa/selftest/cases/runtime_test.py
> > > > > > @@ -232,7 +232,7 @@ class TestImage(OESelftestTestCase):
> > > > > >          if 'sdl' not in qemu_packageconfig:
> > > > > >              features += 'PACKAGECONFIG:append:pn-qemu-system-native = " sdl"\n'
> > > > > >          if 'opengl' not in qemu_distrofeatures:
> > > > > > -            features += 'DISTRO_FEATURES:append = " opengl"\n'
> > > > > > +            features += 'DISTRO_FEATURES_NATIVE:append = " opengl"\n'
> > > > > >          features += 'TEST_SUITES = "ping ssh virgl"\n'
> > > > > >          features += 'IMAGE_FEATURES:append = " ssh-server-dropbear"\n'
> > > > > >          features += 'IMAGE_INSTALL:append = " kmscube"\n'
> > > > > > @@ -264,7 +264,7 @@ class TestImage(OESelftestTestCase):
> > > > > >          qemu_distrofeatures = get_bb_var('DISTRO_FEATURES', 'qemu-system-native')
> > > > > >          features = 'IMAGE_CLASSES += "testimage"\n'
> > > > > >          if 'opengl' not in qemu_distrofeatures:
> > > > > > -            features += 'DISTRO_FEATURES:append = " opengl"\n'
> > > > > > +            features += 'DISTRO_FEATURES_NATIVE:append = " opengl"\n'
> > > > > >          features += 'TEST_SUITES = "ping ssh virgl"\n'
> > > > > >          features += 'IMAGE_FEATURES:append = " ssh-server-dropbear"\n'
> > > > > >          features += 'IMAGE_INSTALL:append = " kmscube"\n'
> > > > > > diff --git a/scripts/runqemu b/scripts/runqemu
> > > > > > index 8e915f3d4c..9f82aa12f1 100755
> > > > > > --- a/scripts/runqemu
> > > > > > +++ b/scripts/runqemu
> > > > > > @@ -447,7 +447,16 @@ class BaseConfig(object):
> > > > > >              self.set("MACHINE", arg)
> > > > > >
> > > > > >      def set_dri_path(self):
> > > > > > -        self.qemu_environ['LIBGL_DRIVERS_PATH'] = os.path.join(self.bindir_native, '../lib/dri')
> > > > > > +        drivers_path = os.path.join(self.bindir_native, '../lib/dri')
> > > > > > +        if not os.path.exists(drivers_path) or not os.listdir(drivers_path):
> > > > > > +            raise RunQemuError("""
> > > > > > +qemu has been built without opengl support and accelerated graphics support is not available.
> > > > > > +To enable it, add:
> > > > > > +DISTRO_FEATURES_NATIVE:append = " opengl"
> > > > > > +DISTRO_FEATURES_NATIVESDK:append = " opengl"
> > > > > > +to your build configuration.
> > > > > > +""")
> > > > > > +        self.qemu_environ['LIBGL_DRIVERS_PATH'] = drivers_path
> > > > > >
> > > > > >      def check_args(self):
> > > > > >          for debug in ("-d", "--debug"):
> > > > > > --
> > > > > > 2.30.2
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > >
> > >
> > >
>
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#178478): https://lists.openembedded.org/g/openembedded-core/message/178478
> > Mute This Topic: https://lists.openembedded.org/mt/97560251/3617179
> > Group Owner: openembedded-core+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alexandre.belloni@bootlin.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
>
>
> --
> Alexandre Belloni, co-owner and COO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
diff mbox series

Patch

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index afd9e2f552..d1dc428583 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -912,8 +912,8 @@  DISTRO_FEATURES_NATIVESDK ?= "x11"
 
 # Normally target distro features will not be applied to native builds:
 # Native distro features on this list will use the target feature value
-DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation debuginfod opengl wayland"
-DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation debuginfod opengl wayland"
+DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation debuginfod wayland"
+DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation debuginfod wayland"
 
 DISTRO_FEATURES_BACKFILL = "pulseaudio sysvinit gobject-introspection-data ldconfig"
 MACHINE_FEATURES_BACKFILL = "rtc qemu-usermode"
diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py
index 81b8d056cc..661c09c109 100644
--- a/meta/lib/oeqa/selftest/cases/runtime_test.py
+++ b/meta/lib/oeqa/selftest/cases/runtime_test.py
@@ -232,7 +232,7 @@  class TestImage(OESelftestTestCase):
         if 'sdl' not in qemu_packageconfig:
             features += 'PACKAGECONFIG:append:pn-qemu-system-native = " sdl"\n'
         if 'opengl' not in qemu_distrofeatures:
-            features += 'DISTRO_FEATURES:append = " opengl"\n'
+            features += 'DISTRO_FEATURES_NATIVE:append = " opengl"\n'
         features += 'TEST_SUITES = "ping ssh virgl"\n'
         features += 'IMAGE_FEATURES:append = " ssh-server-dropbear"\n'
         features += 'IMAGE_INSTALL:append = " kmscube"\n'
@@ -264,7 +264,7 @@  class TestImage(OESelftestTestCase):
         qemu_distrofeatures = get_bb_var('DISTRO_FEATURES', 'qemu-system-native')
         features = 'IMAGE_CLASSES += "testimage"\n'
         if 'opengl' not in qemu_distrofeatures:
-            features += 'DISTRO_FEATURES:append = " opengl"\n'
+            features += 'DISTRO_FEATURES_NATIVE:append = " opengl"\n'
         features += 'TEST_SUITES = "ping ssh virgl"\n'
         features += 'IMAGE_FEATURES:append = " ssh-server-dropbear"\n'
         features += 'IMAGE_INSTALL:append = " kmscube"\n'
diff --git a/scripts/runqemu b/scripts/runqemu
index 8e915f3d4c..9f82aa12f1 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -447,7 +447,16 @@  class BaseConfig(object):
             self.set("MACHINE", arg)
 
     def set_dri_path(self):
-        self.qemu_environ['LIBGL_DRIVERS_PATH'] = os.path.join(self.bindir_native, '../lib/dri')
+        drivers_path = os.path.join(self.bindir_native, '../lib/dri')
+        if not os.path.exists(drivers_path) or not os.listdir(drivers_path):
+            raise RunQemuError("""
+qemu has been built without opengl support and accelerated graphics support is not available.
+To enable it, add:
+DISTRO_FEATURES_NATIVE:append = " opengl"
+DISTRO_FEATURES_NATIVESDK:append = " opengl"
+to your build configuration.
+""")
+        self.qemu_environ['LIBGL_DRIVERS_PATH'] = drivers_path
 
     def check_args(self):
         for debug in ("-d", "--debug"):