file: Remove unneccessary override of PACKAGECONFIG for native
PATCH 1/1 file: Remove unneccessary override of PACKAGECONFIG for native
There is no reason to set PACKAGECONFIG_class-native to the same value as the default PACKAGECONFIG.
--- meta/recipes-devtools/file/file_5.38.bb | 1 - 1 file changed, 1 deletion(-)
meta/recipes-devtools/file/file_5.38.bb +0 -1
@@ -19,7 +19,6 @@ S = "${WORKDIR}/git" inherit autotools update-alternatives PACKAGECONFIG ??= "zlib" -PACKAGECONFIG_class-native ??= "zlib" PACKAGECONFIG[bz2] = "--enable-bzlib, --disable-bzlib, bzip2" PACKAGECONFIG[lzma] = "--enable-xzlib, --disable-xzlib, xz" PACKAGECONFIG[zlib] = "--enable-zlib, --disable-zlib, zlib"
Signature · 1 line
2.21.3
Quoted 3 lines · Peter Kjellerstedt
There is no reason to set PACKAGECONFIG_class-native to the same value as the default PACKAGECONFIG.
End users often don't know how to safely change PACKAGECONFIG from a .bbappend and might try PACKAGECONFIG += "foo" or PACKAGECONFIG_append = " foo" without realising that it could affect more than just the target build.
Have an explicit PACKAGECONFIG_class-native keeps the native config stable for users who haven't yet learning through experience that the safe way to change PACKAGECONFIG is PACKAGECONFIG_append_class-target = " foo".
So although this PACKAGECONFIG_class-native may seem redundant to the experts, it helps make OE more robust for regular users.
Quoted 21 lines
Signed-off-by Peter Kjellerstedt <[email protected]>--- meta/recipes-devtools/file/file_5.38.bb | 1 - 1 file changed, 1 deletion(-)meta/recipes-devtools/file/file_5.38.bb +0
-2@@ -19,7 +19,6 @@ S = "${WORKDIR}/git" inherit autotools update-alternatives PACKAGECONFIG ??= "zlib" -PACKAGECONFIG_class-native ??= "zlib" PACKAGECONFIG[bz2] = "--enable-bzlib, --disable-bzlib, bzip2" PACKAGECONFIG[lzma] = "--enable-xzlib, --disable-xzlib, xz" PACKAGECONFIG[zlib] = "--enable-zlib, --disable-zlib, zlib" --2.21.3
Quoted 19 lines
-----Original Message-----
From: Andre McCurdy <[email protected]>
Sent: den 13 maj 2020 00:20
To: Peter Kjellerstedt <[email protected]>
Cc: OE Core mailing list <[email protected]>
Subject: Re: [OE-core] [PATCH] file: Remove unneccessary override of PACKAGECONFIG for nativeQuoted 3 lines · Peter Kjellerstedt
There is no reason to set PACKAGECONFIG_class-native to the same value as the default PACKAGECONFIG.
End users often don't know how to safely change PACKAGECONFIG from a .bbappend and might try PACKAGECONFIG += "foo" or
PACKAGECONFIG_append= " foo" without realising that it could affect more than just the target build.
Quoted 7 lines
Have an explicit PACKAGECONFIG_class-native keeps the native config stable for users who haven't yet learning through experience that the safe way to change PACKAGECONFIG is PACKAGECONFIG_append_class-target = " foo".
So although this PACKAGECONFIG_class-native may seem redundant to the experts, it helps make OE more robust for regular users.
I have to disagree with this. Having just PACKAGECONFIG ??= "zlib" makes for a more consistent behavior between the different classes. E.g., if someone would add a .bbappend with PACKAGECONFIG = "zlib bz2", with the current recipe the behavior would be different when building file and nativesdk-file compared to file-native (or actually file-replacement-native as file-native is in ASSUME_PROVIDED). With only the default PACKAGECONFIG, the result would be the same also for file-native.
A quick grep through OE-Core also seems to agree with me. There are a couple of other recipes that sets PACKAGECONFIG_class- defaults, but then it's due to the default for, e.g., native being different from target. The only other recipe I could find that sets multiple identical PACKAGECONFIG defaults is openssl.
//Peter
Quoted 21 lines
Quoted 21 lines
Signed-off-by Peter Kjellerstedt <[email protected]>--- meta/recipes-devtools/file/file_5.38.bb | 1 - 1 file changed, 1 deletion(-)meta/recipes-devtools/file/file_5.38.bb +0
-2@@ -19,7 +19,6 @@ S = "${WORKDIR}/git" inherit autotools update-alternatives PACKAGECONFIG ??= "zlib" -PACKAGECONFIG_class-native ??= "zlib" PACKAGECONFIG[bz2] = "--enable-bzlib, --disable-bzlib, bzip2" PACKAGECONFIG[lzma] = "--enable-xzlib, --disable-xzlib, xz" PACKAGECONFIG[zlib] = "--enable-zlib, --disable-zlib, zlib" --2.21.3
Quoted 25 lines · Peter Kjellerstedt
Quoted 25 lines
-----Original Message-----
From: Andre McCurdy <[email protected]>
Sent: den 13 maj 2020 00:20
To: Peter Kjellerstedt <[email protected]>
Cc: OE Core mailing list <[email protected]>
Subject: Re: [OE-core] [PATCH] file: Remove unneccessary override of PACKAGECONFIG for nativeQuoted 3 lines · Peter Kjellerstedt
There is no reason to set PACKAGECONFIG_class-native to the same value as the default PACKAGECONFIG.
End users often don't know how to safely change PACKAGECONFIG from a .bbappend and might try PACKAGECONFIG += "foo" or
PACKAGECONFIG_append= " foo" without realising that it could affect more than just the target build.Have an explicit PACKAGECONFIG_class-native keeps the native config stable for users who haven't yet learning through experience that the safe way to change PACKAGECONFIG is PACKAGECONFIG_append_class-target = " foo".
Quoted 5 lines
Quoted 2 lines
So although this PACKAGECONFIG_class-native may seem redundant to the experts, it helps make OE more robust for regular users.
I have to disagree with this. Having just PACKAGECONFIG ??= "zlib" makes for a more consistent behavior between the different classes.
I don't see why a consistent configuration between the different classes is a goal. We should instead try to keep them independent so that changes to one don't accidentally affect the others. The configuration for the target is determined by the functionality required in the final image (ie something determined by the user) and the configuration for native and nativesdk is mostly determined by the requirements of the build environment. The requirements for the build environment are fairly static and not something a typical user would want to mess with.
Quoted 6 lines
E.g., if someone would add a .bbappend with PACKAGECONFIG = "zlib bz2", with the current recipe the behavior would be different when building file and nativesdk-file compared to file-native (or actually file-replacement-native as file-native is in
ASSUME_PROVIDED). With only the default PACKAGECONFIG, the result would be the same also for file-native.
Having an over-ride for native but not considering nativesdk is certainly an issue which seems to affect many recipes in oe-core. But the fix should be adding an over-ride for nativesdk rather than removing the over-ride for native.
(I don't know why this problem doesn't come up more often. Perhaps because while there are users who like to change PACKAGECONFIG values and users who build for nativesdk the overlap between them is actually quite small?).
Quoted 5 lines
A quick grep through OE-Core also seems to agree with me. There are a couple of other recipes that sets PACKAGECONFIG_class- defaults, but then it's due to the default for, e.g., native being different from target. The only other recipe I could find that sets multiple identical PACKAGECONFIG defaults is openssl.
Yes. Unfortunately making recipes robust for users who want to change PACKAGECONFIG values doesn't seem to be a high priority for oe-core. Why else would default PACKAGECONFIG values be assigned with ??= instead of ?= other than as a trap for new users?
Quoted 4 lines · Andre McCurdy
Yes. Unfortunately making recipes robust for users who want to change PACKAGECONFIG values doesn't seem to be a high priority for oe-core. Why else would default PACKAGECONFIG values be assigned with ??= instead of ?= other than as a trap for new users?
I'm not sure I understand that, equally I'm tired so I'll assume I'm just missing something.
I will say that there is no intention to make OE-Core hard to use or not robust, its only as good a the people contributing make it. In this case I'm not sure I understand/see the problem.
If we should be using ?= instead of ??= then I'm open to an explanation why and patches to improve things.
Unfortunately we do have quite some legacy and ??= vs ?= has been troublesome in the many different contexts we have (recipe, class, conf, inc and so on).
Cheers,
Richard
Quoted 9 lines · Richard Purdie
Quoted 4 lines · Andre McCurdy
Yes. Unfortunately making recipes robust for users who want to change PACKAGECONFIG values doesn't seem to be a high priority for oe-core. Why else would default PACKAGECONFIG values be assigned with ??= instead of ?= other than as a trap for new users?
I'm not sure I understand that, equally I'm tired so I'll assume I'm just missing something.
Quoted 6 lines
I will say that there is no intention to make OE-Core hard to use or not robust, its only as good a the people contributing make it. In this case I'm not sure I understand/see the problem.
If we should be using ?= instead of ??= then I'm open to an explanation why and patches to improve things.
If the default is assigned with ??= then trying to add to it with += results in the default value being lost. If the default is assigned with ?= then adding to it with += works as expected.
To robustly enable a new PACKAGECONFIG option, users need to learn to use PACKAGECONFIG_append (and obviously learn about the leading space requirement there too) and not to try PACKAGECONFIG +=.
The reference manual does at least have an example which uses _append. However it doesn't mention that += isn't safe or that _append will affect native(sdk) and therefore _append_class-target is the safest approach.
Quoted 3 lines
Unfortunately we do have quite some legacy and ??= vs ?= has been troublesome in the many different contexts we have (recipe, class, conf, inc and so on).
Quoted 31 lines
-----Original Message-----
From: Andre McCurdy <[email protected]>
Sent: den 14 maj 2020 00:49
To: Richard Purdie <[email protected]>
Cc: Peter Kjellerstedt <[email protected]>; OE Core mailing list <[email protected]>
Subject: Re: [OE-core] [PATCH] file: Remove unneccessary override of PACKAGECONFIG for nativeQuoted 9 lines · Richard Purdie
Quoted 4 lines · Andre McCurdy
Yes. Unfortunately making recipes robust for users who want to change PACKAGECONFIG values doesn't seem to be a high priority for oe-core. Why else would default PACKAGECONFIG values be assigned with ??= instead of ?= other than as a trap for new users?
I'm not sure I understand that, equally I'm tired so I'll assume I'm just missing something.
Quoted 6 lines
I will say that there is no intention to make OE-Core hard to use or not robust, its only as good a the people contributing make it. In this case I'm not sure I understand/see the problem.
If we should be using ?= instead of ??= then I'm open to an explanation why and patches to improve things.
If the default is assigned with ??= then trying to add to it with += results in the default value being lost. If the default is assigned with ?= then adding to it with += works as expected.
Quoted 12 lines
To robustly enable a new PACKAGECONFIG option, users need to learn to use
PACKAGECONFIG_append(and obviously learn about the leading space requirement there too) and not to try PACKAGECONFIG +=.The reference manual does at least have an example which uses
_append. However it doesn't mention that += isn't safe or that_appendwill affect native(sdk) and therefore _append_class-target is the safest approach.Quoted 3 lines
Unfortunately we do have quite some legacy and ??= vs ?= has been troublesome in the many different contexts we have (recipe, class, conf, inc and so on).
Actually, I have always wondered why the recipes in OE-Core typically use PACKAGECONFIG ??= "..." when no other variables (in the recipes) are defined that way. After all, if I want to override the default value in a bbappend as PACKAGECONFIG = "...", that works just as well if the variable is defined using = rather than ?= or ??=. And if I do it in local.conf, I would typically do it using PACKAGECONFIG_pn-foo and then it also doesn't matter whether = or ??= was used to define the default in the recipe. Add to that the complications with not being able to use += together with ??= in a sensible way, it even makes less sense.
For the record, in our own recipes we use PACKAGECONFIG = "..." in the recipes and that would be my recommendation for OE-Core as well.
//Peter