* [RFC PATCH] bitbake.conf: Add base package version (BPV) variable
@ 2022-03-30 8:16 Stefan Herbrechtsmeier
2022-03-30 8:41 ` [OE-core] " Alexander Kanavin
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Stefan Herbrechtsmeier @ 2022-03-30 8:16 UTC (permalink / raw)
To: openembedded-core; +Cc: Stefan Herbrechtsmeier
From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Add a base package version (BPV) variable and use it as default for the
package version (PV) variable. The BPV variable contains the base
package version of the recipe read from the recipe filename.
The base package version variable supports an expansion of the version
from the recipe filename without the need of an immediate variable
expansion:
PV = "${BPV}+git${SRCPV}"
It allows the inclusion of include files inside a recipe file with the
same version in the recipe and include filename even if the package
version is different to the base package version in the filename:
require linux-yocto-${BPV}.inc
Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
---
meta/conf/bitbake.conf | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 7705415a4f..d56cf811ba 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -232,7 +232,8 @@ ASSUME_PROVIDED = "\
##################################################################
PN = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[0] or 'defaultpkgname'}"
-PV = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or '1.0'}"
+BPV = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or '1.0'}"
+PV = "${BPV}"
PR = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[2] or 'r0'}"
PE = ""
PF = "${PN}-${EXTENDPE}${PV}-${PR}"
--
2.30.2
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [OE-core] [RFC PATCH] bitbake.conf: Add base package version (BPV) variable
2022-03-30 8:16 [RFC PATCH] bitbake.conf: Add base package version (BPV) variable Stefan Herbrechtsmeier
@ 2022-03-30 8:41 ` Alexander Kanavin
2022-03-30 8:41 ` Alexander Kanavin
2022-03-30 11:42 ` Stefan Herbrechtsmeier
2022-03-30 11:51 ` Richard Purdie
2022-03-30 17:32 ` Khem Raj
2 siblings, 2 replies; 9+ messages in thread
From: Alexander Kanavin @ 2022-03-30 8:41 UTC (permalink / raw)
To: Stefan Herbrechtsmeier; +Cc: OE-core, Stefan Herbrechtsmeier
Mangling PV is more flexibly done with a lambda function in the
recipe, where you can trim and tweak PV to your heart's desire, e.g.
gnomebase.bbclass:
def gnome_verdir(v):
return ".".join(v.split(".")[:-1])
SRC_URI = "${GNOME_MIRROR}/${GNOMEBN}/${@gnome_verdir("${PV}")}/${GNOMEBN}-${PV}.tar.${GNOME_COMPRESS_TYPE};name=archive"
Alex
On Wed, 30 Mar 2022 at 10:16, Stefan Herbrechtsmeier
<stefan.herbrechtsmeier-oss@weidmueller.com> wrote:
>
> From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
>
> Add a base package version (BPV) variable and use it as default for the
> package version (PV) variable. The BPV variable contains the base
> package version of the recipe read from the recipe filename.
>
> The base package version variable supports an expansion of the version
> from the recipe filename without the need of an immediate variable
> expansion:
> PV = "${BPV}+git${SRCPV}"
>
> It allows the inclusion of include files inside a recipe file with the
> same version in the recipe and include filename even if the package
> version is different to the base package version in the filename:
> require linux-yocto-${BPV}.inc
>
> Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
>
> ---
>
> meta/conf/bitbake.conf | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index 7705415a4f..d56cf811ba 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -232,7 +232,8 @@ ASSUME_PROVIDED = "\
> ##################################################################
>
> PN = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[0] or 'defaultpkgname'}"
> -PV = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or '1.0'}"
> +BPV = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or '1.0'}"
> +PV = "${BPV}"
> PR = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[2] or 'r0'}"
> PE = ""
> PF = "${PN}-${EXTENDPE}${PV}-${PR}"
> --
> 2.30.2
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#163774): https://lists.openembedded.org/g/openembedded-core/message/163774
> Mute This Topic: https://lists.openembedded.org/mt/90127138/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [OE-core] [RFC PATCH] bitbake.conf: Add base package version (BPV) variable
2022-03-30 8:41 ` [OE-core] " Alexander Kanavin
@ 2022-03-30 8:41 ` Alexander Kanavin
2022-03-30 11:42 ` Stefan Herbrechtsmeier
1 sibling, 0 replies; 9+ messages in thread
From: Alexander Kanavin @ 2022-03-30 8:41 UTC (permalink / raw)
To: Stefan Herbrechtsmeier; +Cc: OE-core, Stefan Herbrechtsmeier
Not lambda in this case, but nevermind :)
Alex
On Wed, 30 Mar 2022 at 10:41, Alexander Kanavin <alex.kanavin@gmail.com> wrote:
>
> Mangling PV is more flexibly done with a lambda function in the
> recipe, where you can trim and tweak PV to your heart's desire, e.g.
> gnomebase.bbclass:
>
> def gnome_verdir(v):
> return ".".join(v.split(".")[:-1])
>
> SRC_URI = "${GNOME_MIRROR}/${GNOMEBN}/${@gnome_verdir("${PV}")}/${GNOMEBN}-${PV}.tar.${GNOME_COMPRESS_TYPE};name=archive"
>
> Alex
>
> On Wed, 30 Mar 2022 at 10:16, Stefan Herbrechtsmeier
> <stefan.herbrechtsmeier-oss@weidmueller.com> wrote:
> >
> > From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
> >
> > Add a base package version (BPV) variable and use it as default for the
> > package version (PV) variable. The BPV variable contains the base
> > package version of the recipe read from the recipe filename.
> >
> > The base package version variable supports an expansion of the version
> > from the recipe filename without the need of an immediate variable
> > expansion:
> > PV = "${BPV}+git${SRCPV}"
> >
> > It allows the inclusion of include files inside a recipe file with the
> > same version in the recipe and include filename even if the package
> > version is different to the base package version in the filename:
> > require linux-yocto-${BPV}.inc
> >
> > Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
> >
> > ---
> >
> > meta/conf/bitbake.conf | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> > index 7705415a4f..d56cf811ba 100644
> > --- a/meta/conf/bitbake.conf
> > +++ b/meta/conf/bitbake.conf
> > @@ -232,7 +232,8 @@ ASSUME_PROVIDED = "\
> > ##################################################################
> >
> > PN = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[0] or 'defaultpkgname'}"
> > -PV = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or '1.0'}"
> > +BPV = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or '1.0'}"
> > +PV = "${BPV}"
> > PR = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[2] or 'r0'}"
> > PE = ""
> > PF = "${PN}-${EXTENDPE}${PV}-${PR}"
> > --
> > 2.30.2
> >
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#163774): https://lists.openembedded.org/g/openembedded-core/message/163774
> > Mute This Topic: https://lists.openembedded.org/mt/90127138/1686489
> > Group Owner: openembedded-core+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [OE-core] [RFC PATCH] bitbake.conf: Add base package version (BPV) variable
2022-03-30 8:41 ` [OE-core] " Alexander Kanavin
2022-03-30 8:41 ` Alexander Kanavin
@ 2022-03-30 11:42 ` Stefan Herbrechtsmeier
2022-03-30 11:46 ` Alexander Kanavin
1 sibling, 1 reply; 9+ messages in thread
From: Stefan Herbrechtsmeier @ 2022-03-30 11:42 UTC (permalink / raw)
To: Alexander Kanavin; +Cc: OE-core, Stefan Herbrechtsmeier
Hi Alex,
Am 30.03.2022 um 10:41 schrieb Alexander Kanavin:
> Mangling PV is more flexibly done with a lambda function in the
> recipe, where you can trim and tweak PV to your heart's desire, e.g.
> gnomebase.bbclass:
>
> def gnome_verdir(v):
> return ".".join(v.split(".")[:-1])
>
> SRC_URI = "${GNOME_MIRROR}/${GNOMEBN}/${@gnome_verdir("${PV}")}/${GNOMEBN}-${PV}.tar.${GNOME_COMPRESS_TYPE};name=archive"
What is the intention of your comment? Do you recommend a function per
recipe and thereby code duplication?
Or is your objection that the base package version isn't always the file
name version and the variable name is wrong?
The advantage of the BPV is that you can change the PV outside of the
recipe file:
PV:pn-<package_name> = "${BPV}+git${SRCPV}"
The `PV .= "+git${SRCPV}"` assume that the PV is the base package
version but couldn't ensure it.
Regards
Stefan
> On Wed, 30 Mar 2022 at 10:16, Stefan Herbrechtsmeier
> <stefan.herbrechtsmeier-oss@weidmueller.com> wrote:
>>
>> From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
>>
>> Add a base package version (BPV) variable and use it as default for the
>> package version (PV) variable. The BPV variable contains the base
>> package version of the recipe read from the recipe filename.
>>
>> The base package version variable supports an expansion of the version
>> from the recipe filename without the need of an immediate variable
>> expansion:
>> PV = "${BPV}+git${SRCPV}"
>>
>> It allows the inclusion of include files inside a recipe file with the
>> same version in the recipe and include filename even if the package
>> version is different to the base package version in the filename:
>> require linux-yocto-${BPV}.inc
>>
>> Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
>>
>> ---
>>
>> meta/conf/bitbake.conf | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
>> index 7705415a4f..d56cf811ba 100644
>> --- a/meta/conf/bitbake.conf
>> +++ b/meta/conf/bitbake.conf
>> @@ -232,7 +232,8 @@ ASSUME_PROVIDED = "\
>> ##################################################################
>>
>> PN = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[0] or 'defaultpkgname'}"
>> -PV = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or '1.0'}"
>> +BPV = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or '1.0'}"
>> +PV = "${BPV}"
>> PR = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[2] or 'r0'}"
>> PE = ""
>> PF = "${PN}-${EXTENDPE}${PV}-${PR}"
>> --
>> 2.30.2
>>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#163774): https://lists.openembedded.org/g/openembedded-core/message/163774
>> Mute This Topic: https://lists.openembedded.org/mt/90127138/1686489
>> Group Owner: openembedded-core+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [OE-core] [RFC PATCH] bitbake.conf: Add base package version (BPV) variable
2022-03-30 11:42 ` Stefan Herbrechtsmeier
@ 2022-03-30 11:46 ` Alexander Kanavin
0 siblings, 0 replies; 9+ messages in thread
From: Alexander Kanavin @ 2022-03-30 11:46 UTC (permalink / raw)
To: Stefan Herbrechtsmeier; +Cc: OE-core, Stefan Herbrechtsmeier
The intention is that changing bitbake.conf is heavy handed, and the
use case is not well presented. Why and where this is needed?
Alex
On Wed, 30 Mar 2022 at 13:42, Stefan Herbrechtsmeier
<stefan.herbrechtsmeier-oss@weidmueller.com> wrote:
>
> Hi Alex,
>
> Am 30.03.2022 um 10:41 schrieb Alexander Kanavin:
> > Mangling PV is more flexibly done with a lambda function in the
> > recipe, where you can trim and tweak PV to your heart's desire, e.g.
> > gnomebase.bbclass:
> >
> > def gnome_verdir(v):
> > return ".".join(v.split(".")[:-1])
> >
> > SRC_URI = "${GNOME_MIRROR}/${GNOMEBN}/${@gnome_verdir("${PV}")}/${GNOMEBN}-${PV}.tar.${GNOME_COMPRESS_TYPE};name=archive"
>
> What is the intention of your comment? Do you recommend a function per
> recipe and thereby code duplication?
>
> Or is your objection that the base package version isn't always the file
> name version and the variable name is wrong?
>
> The advantage of the BPV is that you can change the PV outside of the
> recipe file:
>
> PV:pn-<package_name> = "${BPV}+git${SRCPV}"
>
> The `PV .= "+git${SRCPV}"` assume that the PV is the base package
> version but couldn't ensure it.
>
> Regards
> Stefan
>
> > On Wed, 30 Mar 2022 at 10:16, Stefan Herbrechtsmeier
> > <stefan.herbrechtsmeier-oss@weidmueller.com> wrote:
> >>
> >> From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
> >>
> >> Add a base package version (BPV) variable and use it as default for the
> >> package version (PV) variable. The BPV variable contains the base
> >> package version of the recipe read from the recipe filename.
> >>
> >> The base package version variable supports an expansion of the version
> >> from the recipe filename without the need of an immediate variable
> >> expansion:
> >> PV = "${BPV}+git${SRCPV}"
> >>
> >> It allows the inclusion of include files inside a recipe file with the
> >> same version in the recipe and include filename even if the package
> >> version is different to the base package version in the filename:
> >> require linux-yocto-${BPV}.inc
> >>
> >> Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
> >>
> >> ---
> >>
> >> meta/conf/bitbake.conf | 3 ++-
> >> 1 file changed, 2 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> >> index 7705415a4f..d56cf811ba 100644
> >> --- a/meta/conf/bitbake.conf
> >> +++ b/meta/conf/bitbake.conf
> >> @@ -232,7 +232,8 @@ ASSUME_PROVIDED = "\
> >> ##################################################################
> >>
> >> PN = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[0] or 'defaultpkgname'}"
> >> -PV = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or '1.0'}"
> >> +BPV = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or '1.0'}"
> >> +PV = "${BPV}"
> >> PR = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[2] or 'r0'}"
> >> PE = ""
> >> PF = "${PN}-${EXTENDPE}${PV}-${PR}"
> >> --
> >> 2.30.2
> >>
> >>
> >> -=-=-=-=-=-=-=-=-=-=-=-
> >> Links: You receive all messages sent to this group.
> >> View/Reply Online (#163774): https://lists.openembedded.org/g/openembedded-core/message/163774
> >> Mute This Topic: https://lists.openembedded.org/mt/90127138/1686489
> >> Group Owner: openembedded-core+owner@lists.openembedded.org
> >> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> >> -=-=-=-=-=-=-=-=-=-=-=-
> >>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [OE-core] [RFC PATCH] bitbake.conf: Add base package version (BPV) variable
2022-03-30 8:16 [RFC PATCH] bitbake.conf: Add base package version (BPV) variable Stefan Herbrechtsmeier
2022-03-30 8:41 ` [OE-core] " Alexander Kanavin
@ 2022-03-30 11:51 ` Richard Purdie
2022-03-30 16:23 ` Stefan Herbrechtsmeier
2022-03-30 17:32 ` Khem Raj
2 siblings, 1 reply; 9+ messages in thread
From: Richard Purdie @ 2022-03-30 11:51 UTC (permalink / raw)
To: Stefan Herbrechtsmeier, openembedded-core; +Cc: Stefan Herbrechtsmeier
On Wed, 2022-03-30 at 10:16 +0200, Stefan Herbrechtsmeier wrote:
> From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
>
> Add a base package version (BPV) variable and use it as default for the
> package version (PV) variable. The BPV variable contains the base
> package version of the recipe read from the recipe filename.
>
> The base package version variable supports an expansion of the version
> from the recipe filename without the need of an immediate variable
> expansion:
> PV = "${BPV}+git${SRCPV}"
>
> It allows the inclusion of include files inside a recipe file with the
> same version in the recipe and include filename even if the package
> version is different to the base package version in the filename:
> require linux-yocto-${BPV}.inc
>
> Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
>
> ---
>
> meta/conf/bitbake.conf | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index 7705415a4f..d56cf811ba 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -232,7 +232,8 @@ ASSUME_PROVIDED = "\
> ##################################################################
>
> PN = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[0] or 'defaultpkgname'}"
> -PV = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or '1.0'}"
> +BPV = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or '1.0'}"
> +PV = "${BPV}"
> PR = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[2] or 'r0'}"
> PE = ""
> PF = "${PN}-${EXTENDPE}${PV}-${PR}"
I'm not really seeing a compelling use case for what is a fairly core change,
you've not really said why we need changes and what the big win is for users.
I'm also quite worried that this behaves quite differently to BPN. "base" in the
case of PN means strip off prefixes and suffixes yet here, BPV doesn't actually
strip anything off PV, you're just expected to set it differently yourself as
the user. The different usage semantics will likely confuse people and that
confusion isn't worth it IMO.
Cheers,
Richard
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [OE-core] [RFC PATCH] bitbake.conf: Add base package version (BPV) variable
2022-03-30 11:51 ` Richard Purdie
@ 2022-03-30 16:23 ` Stefan Herbrechtsmeier
0 siblings, 0 replies; 9+ messages in thread
From: Stefan Herbrechtsmeier @ 2022-03-30 16:23 UTC (permalink / raw)
To: Richard Purdie, openembedded-core; +Cc: Stefan Herbrechtsmeier
Hi Richard,
Am 30.03.2022 um 13:51 schrieb Richard Purdie:
> On Wed, 2022-03-30 at 10:16 +0200, Stefan Herbrechtsmeier wrote:
>> From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
>>
>> Add a base package version (BPV) variable and use it as default for the
>> package version (PV) variable. The BPV variable contains the base
>> package version of the recipe read from the recipe filename.
>>
>> The base package version variable supports an expansion of the version
>> from the recipe filename without the need of an immediate variable
>> expansion:
>> PV = "${BPV}+git${SRCPV}"
>>
>> It allows the inclusion of include files inside a recipe file with the
>> same version in the recipe and include filename even if the package
>> version is different to the base package version in the filename:
>> require linux-yocto-${BPV}.inc
>>
>> Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
>>
>> ---
>>
>> meta/conf/bitbake.conf | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
>> index 7705415a4f..d56cf811ba 100644
>> --- a/meta/conf/bitbake.conf
>> +++ b/meta/conf/bitbake.conf
>> @@ -232,7 +232,8 @@ ASSUME_PROVIDED = "\
>> ##################################################################
>>
>> PN = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[0] or 'defaultpkgname'}"
>> -PV = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or '1.0'}"
>> +BPV = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or '1.0'}"
>> +PV = "${BPV}"
>> PR = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[2] or 'r0'}"
>> PE = ""
>> PF = "${PN}-${EXTENDPE}${PV}-${PR}"
>
> I'm not really seeing a compelling use case for what is a fairly core change,
> you've not really said why we need changes and what the big win is for users.
binutils_2.32.bb:
require binutils-${PV}.inc
binutils-2.32.inc:
PV = "2.32.0"
CVE_VERSION = "2.32"
cdrtools-native_3.01.bb:
PV = "3.01a31+really3.01"
REALPV = "3.01"
S = "${WORKDIR}/${BPN}-${REALPV}"
gcc-cross_8.3.bb:
require recipes-devtools/gcc/gcc-${PV}.inc
gcc-8.3.inc:
PV = "8.3.0"
gdk-pixbuf_2.38.0.bb:
MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
util-linux.inc:
MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:2])}"
Does the binutils and gcc-cross trick works inside a bbappend? The other
examples could benefit from a variable.
> I'm also quite worried that this behaves quite differently to BPN. "base" in the
> case of PN means strip off prefixes and suffixes yet here, BPV doesn't actually
> strip anything off PV, you're just expected to set it differently yourself as
> the user. The different usage semantics will likely confuse people and that
> confusion isn't worth it IMO.
BPV = "${@oe.utils.trim_version("${PV}", 3)}"
This would make it inline with the BPN but disallow the usage of the
variable inside the PV itself.
Until now I don't know the oe.utils.trim_version function.
Regards
Stefan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [OE-core] [RFC PATCH] bitbake.conf: Add base package version (BPV) variable
2022-03-30 8:16 [RFC PATCH] bitbake.conf: Add base package version (BPV) variable Stefan Herbrechtsmeier
2022-03-30 8:41 ` [OE-core] " Alexander Kanavin
2022-03-30 11:51 ` Richard Purdie
@ 2022-03-30 17:32 ` Khem Raj
2022-03-31 7:15 ` Stefan Herbrechtsmeier
2 siblings, 1 reply; 9+ messages in thread
From: Khem Raj @ 2022-03-30 17:32 UTC (permalink / raw)
To: Stefan Herbrechtsmeier
Cc: Patches and discussions about the oe-core layer, Stefan Herbrechtsmeier
On Wed, Mar 30, 2022 at 1:16 AM Stefan Herbrechtsmeier
<stefan.herbrechtsmeier-oss@weidmueller.com> wrote:
>
> From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
>
> Add a base package version (BPV) variable and use it as default for the
> package version (PV) variable. The BPV variable contains the base
> package version of the recipe read from the recipe filename.
>
> The base package version variable supports an expansion of the version
> from the recipe filename without the need of an immediate variable
> expansion:
> PV = "${BPV}+git${SRCPV}"
>
> It allows the inclusion of include files inside a recipe file with the
> same version in the recipe and include filename even if the package
> version is different to the base package version in the filename:
> require linux-yocto-${BPV}.inc
>
how many such usecase do we have ? seems to be quite errorprone too.
> Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
>
> ---
>
> meta/conf/bitbake.conf | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index 7705415a4f..d56cf811ba 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -232,7 +232,8 @@ ASSUME_PROVIDED = "\
> ##################################################################
>
> PN = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[0] or 'defaultpkgname'}"
> -PV = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or '1.0'}"
> +BPV = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or '1.0'}"
> +PV = "${BPV}"
> PR = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[2] or 'r0'}"
> PE = ""
> PF = "${PN}-${EXTENDPE}${PV}-${PR}"
> --
> 2.30.2
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#163774): https://lists.openembedded.org/g/openembedded-core/message/163774
> Mute This Topic: https://lists.openembedded.org/mt/90127138/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [OE-core] [RFC PATCH] bitbake.conf: Add base package version (BPV) variable
2022-03-30 17:32 ` Khem Raj
@ 2022-03-31 7:15 ` Stefan Herbrechtsmeier
0 siblings, 0 replies; 9+ messages in thread
From: Stefan Herbrechtsmeier @ 2022-03-31 7:15 UTC (permalink / raw)
To: Khem Raj
Cc: Patches and discussions about the oe-core layer, Stefan Herbrechtsmeier
Am 30.03.2022 um 19:32 schrieb Khem Raj:
> On Wed, Mar 30, 2022 at 1:16 AM Stefan Herbrechtsmeier
> <stefan.herbrechtsmeier-oss@weidmueller.com> wrote:
>>
>> From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
>>
>> Add a base package version (BPV) variable and use it as default for the
>> package version (PV) variable. The BPV variable contains the base
>> package version of the recipe read from the recipe filename.
>>
>> The base package version variable supports an expansion of the version
>> from the recipe filename without the need of an immediate variable
>> expansion:
>> PV = "${BPV}+git${SRCPV}"
>>
>> It allows the inclusion of include files inside a recipe file with the
>> same version in the recipe and include filename even if the package
>> version is different to the base package version in the filename:
>> require linux-yocto-${BPV}.inc
>>
>
> how many such usecase do we have ?
4x require binutils-${PV}.inc
9x require recipes-devtools/gcc/gcc-${PV}.inc
6x require go-${PV}.inc
4x require libtool-${PV}.inc
2x require m4-${PV}.inc
1x require boost-${PV}.inc
Thereby binutils and gcc set the real PV inside the .inc file.
> seems to be quite errorprone too.
The current use cases in oe core is much more error-prone because they
use ${PV} and set the PV inside the .inc file. This means a second .inc
file must use the new PV. Furthermore, if somebody in oe-core add a `PV
.= "+git${SRCPV}"` it breaks includes in other layers.
A MAIN_VERSION (MAJOR.MINOR) and a BPV (MAJOR.MINOR.PATCH) would make
the use case explicit:
require binutils-${MAIN_VERSION}.inc
require recipes-devtools/gcc/gcc-${MAIN_VERSION}.inc
require go-${BPV}.inc
require libtool-${BPV}.inc
require m4-${BPV}.inc
require boost-${BPV}.inc
At the moment oe-core have recipe specific names and code for the same
value:
MAJOR.MINOR.PATCH:
MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:2])}"
CMAKE_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:2])}"
MAJOR.MINOR:
WESTON_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:1])}"
SHRT_VER =
"${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
VIMDIR =
"vim${@d.getVar('PV').split('.')[0]}${@d.getVar('PV').split('.')[1]}"
SHRT_VER = "${@oe.utils.trim_version("${PV}", 2)}"
NAMEVER = "${@oe.utils.trim_version("${PV}", 2)}"
SHRT_VER = "${@oe.utils.trim_version("${PV}", 2)}"
MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
MAJOR:
MAJ_VER = "${@oe.utils.trim_version("${PV}", 2).split('.')[0]}"
ICU_MAJOR_VER = "${@d.getVar('PV').split('.')[0]}"
MINOR:
MIN_VER = "${@oe.utils.trim_version("${PV}", 2).split('.')[1]}"
Sometimes the same name is used for different values:
MAJOR_VERSION = "${@oe.utils.trim_version("${PV}", 1)}"
WESTON_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:1])}"
MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:2])}"
Maybe the bitbake.conf isn't the ride place but I think a common name
for the base / short version (MAJOR.MINOR), base package version
(MAJOR.MINOR.PATCH) and major, minor and patch would be helpful.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2022-03-31 7:16 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-30 8:16 [RFC PATCH] bitbake.conf: Add base package version (BPV) variable Stefan Herbrechtsmeier
2022-03-30 8:41 ` [OE-core] " Alexander Kanavin
2022-03-30 8:41 ` Alexander Kanavin
2022-03-30 11:42 ` Stefan Herbrechtsmeier
2022-03-30 11:46 ` Alexander Kanavin
2022-03-30 11:51 ` Richard Purdie
2022-03-30 16:23 ` Stefan Herbrechtsmeier
2022-03-30 17:32 ` Khem Raj
2022-03-31 7:15 ` Stefan Herbrechtsmeier
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.