Skip to contentSkip to conversation

virglrenderer: correct REQUIRED_DISTRO_FEATURES

PATCH In review Yu, Mingli 3 participants 8 messages Jun 9, 2020 – Jun 11, 2020

lore
Share & tools
lore

Yu, Mingli

author
#0 lore raw

PATCH 1/1 virglrenderer: correct REQUIRED_DISTRO_FEATURES

From: Mingli Yu <[email protected]>

Add opengl to REQUIRED_DISTRO_FEATURES only for target build.

---
 meta/recipes-graphics/virglrenderer/virglrenderer_0.8.2.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-graphics/virglrenderer/virglrenderer_0.8.2.bb +1 -1
index 29b12628d0..d97f0e78f1 100644
@@ -21,4 +21,4 @@ inherit meson pkgconfig features_check
 
 BBCLASSEXTEND = "native nativesdk"
 
-REQUIRED_DISTRO_FEATURES = "opengl"
+REQUIRED_DISTRO_FEATURES_class-target = "opengl"
Signature · 1 line
2.24.1
#1 lore raw

Please explain why?

Alex

Quoted 25 lines · Mingli

From: Mingli Yu <[email protected]>

Add opengl to REQUIRED_DISTRO_FEATURES only for target build.

---
 meta/recipes-graphics/virglrenderer/virglrenderer_0.8.2.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-graphics/virglrenderer/virglrenderer_0.8.2.bb +1 -2
index 29b12628d0..d97f0e78f1 100644
@@ -21,4 +21,4 @@ inherit meson pkgconfig features_check
 
 BBCLASSEXTEND = "native nativesdk"
 
-REQUIRED_DISTRO_FEATURES = "opengl"
+REQUIRED_DISTRO_FEATURES_class-target = "opengl"
--

2.24.1

#2 lore raw

+1

The commit message should explain "why" and not "what", as "what" can be easily understood from the code itself.

Sometimes "why" is obvious - e.g. version update of CVE fix, but in many cases it's not at all clear why do you want everyone to be affected by your change.

PS. https://xkcd.com/1296/

Signature · 1 line
Denys
Quoted 33 lines · Alexander Kanavin

Please explain why?

Alex

Quoted 25 lines · Mingli

From: Mingli Yu <[email protected]>

Add opengl to REQUIRED_DISTRO_FEATURES only for target build.

---
 meta/recipes-graphics/virglrenderer/virglrenderer_0.8.2.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-graphics/virglrenderer/virglrenderer_0.8.2.bb +1 -2
index 29b12628d0..d97f0e78f1 100644
@@ -21,4 +21,4 @@ inherit meson pkgconfig features_check
 
 BBCLASSEXTEND = "native nativesdk"
 
-REQUIRED_DISTRO_FEATURES = "opengl"
+REQUIRED_DISTRO_FEATURES_class-target = "opengl"
--

2.24.1

author
#3 lore raw

Hi Alex and Denys,

Quoted 4 lines · Denys Dmytriyenko

+1

The commit message should explain "why" and not "what", as "what" can be easily understood from the code itself.

In fact, the DISTRO_FEATURES setting shouldn't affect native build.

Initially this patch is used to fix below error when opengl not defined in DISTRO_FEATURES in my build environment.

$ bitbake virglrenderer-native
virglrenderer-native was skipped: missing required distro feature 'opengl' (not in DISTRO_FEATURES)

And the value defined in DISTRO_FEATURES is only translated to the appropriate option supplied to the configure script during the do_configure task for recipes built for the target.

Thanks,
Mingli

Quoted 9 lines

Sometimes "why" is obvious - e.g. version update of CVE fix, but in many cases it's not at all clear why do you want everyone to be affected by your change.

PS. https://xkcd.com/1296/

#4 lore raw
Quoted 8 lines · Mingli

Hi Alex and Denys,

Quoted 4 lines · Denys Dmytriyenko

+1

The commit message should explain "why" and not "what", as "what" can be easily understood from the code itself.

Quoted 8 lines

In fact, the DISTRO_FEATURES setting shouldn't affect native build.

Initially this patch is used to fix below error when opengl not defined in DISTRO_FEATURES in my build environment.

$ bitbake virglrenderer-native
virglrenderer-native was skipped: missing required distro feature
'opengl' (not in DISTRO_FEATURES)

This is not an error, but expected behavior. virglrenderer-native only works when opengl is in DISTRO_FEATURES and should be skipped otherwise.

Alex

author
#5 lore raw

Hi Alex,

Quoted 13 lines · Alexander Kanavin

On Wed, 10 Jun 2020 at 04:10, Yu, Mingli <[email protected] <mailto:[email protected]>> wrote:

Hi Alex and Denys,

On 6/10/20 5:50 AM, Denys Dmytriyenko wrote:
> +1
>
> The commit message should explain "why" and not "what", as "what"
can be
> easily understood from the code itself.

In fact, the DISTRO_FEATURES setting shouldn't affect native build.

Quoted 8 lines

Initially this patch is used to fix below error when opengl not defined in DISTRO_FEATURES in my build environment.
$ bitbake virglrenderer-native
virglrenderer-native was skipped: missing required distro feature 'opengl' (not in DISTRO_FEATURES)

This is not an error, but expected behavior. virglrenderer-native only works when opengl is in DISTRO_FEATURES and should be skipped otherwise.

Does it mean the DISTRO_FEATURES setting also affects the native build? If so, please ignore this patch.

Thanks,

Quoted 2 lines

Alex

#6 lore raw
Quoted 6 lines · Mingli
Quoted 2 lines

This is not an error, but expected behavior. virglrenderer-native only works when opengl is in DISTRO_FEATURES and should be skipped otherwise.

Does it mean the DISTRO_FEATURES setting also affects the native build? If so, please ignore this patch.

By default it does not, but for specific items listed in bitbake.conf it does:

# 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 opengl" DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation opengl"

Alex

author
#7 lore raw
Quoted 11 lines · Alexander Kanavin

On Thu, 11 Jun 2020 at 09:22, Yu, Mingli <[email protected] <mailto:[email protected]>> wrote:

> This is not an error, but expected behavior. virglrenderer-native
only
> works when opengl is in DISTRO_FEATURES and should be skipped
otherwise.

Does it mean the DISTRO_FEATURES setting also affects the native build? If so, please ignore this patch.

Quoted 6 lines

By default it does not, but for specific items listed in bitbake.conf it does:

# 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 opengl" DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation opengl"

Understood, many thanks your explanation!

Thanks,

Quoted 2 lines

Alex