* question about BBVERSIONS OVERRIDES and PREFERRED_VERSION
@ 2016-08-21 15:46 张忠山
2016-08-22 6:55 ` 张忠山
0 siblings, 1 reply; 5+ messages in thread
From: 张忠山 @ 2016-08-21 15:46 UTC (permalink / raw)
To: bitbake-devel
I'm using bare bitbake cloned from 'git://git.openembedded.org/bitbake'
Revision id is: 309f5907a3661821e041ed14645b5d165007b058
I has a tese.bb, the content is:
OVERRIDES = ""
PN = "test"
PV = ""
PREFERRED_VERSION_test = 'xxx'
OVERRIDES .= "${@':' + ':'.join([x for x in
'${BBVERSIONS}'.split()])}"
BBVERSIONS = "develop 1.1.7"
PREFERRED_VERSION_test = '1.1.7'
NAME_1.1.7 = 'version is 1.1.7'
NAME_develop = 'version is develop'
python do_build() {
bb.plain("==%s==" % d.getVar("NAME", True))
}
Use 'bitbake test -e | less' to explore var setting.
I found:
# $PV [3 operations]
# set /home/zzs/temp/bitbake-hello-world/main/../mylayer/test.bb:4
# ""
# set ast.py:401 [verfunc]
# "1.1.7"
# set ast.py:401 [verfunc]
# "develop"
# pre-expansion value:
# "develop"
PV="develop"
I'm already set PREFERRED_VERSION_test = '1.1.7' sure. Why the 'PV' is
'develop'
And I try set BBVERSIONS = "develop 1.1.7 xx yy". Then 'PV' becomes 'yy'
So my first question is:
How can I select version '1.1.7' for test package through BBVERSIONS
and PREFERRED_VERSION
The second question comes from the override of var 'NAME'.
In the output of 'bitbake test -e' can found:
#
# $NAME
# override[develop]:set
/home/zzs/temp/bitbake-hello-world/main/../mylayer/test.bb:14
# "version is develop"
NAME="version is develop"
I'm already set NAME_1.1.7 why bitbake just found override 'develop' but
'1.1.7'
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: question about BBVERSIONS OVERRIDES and PREFERRED_VERSION
2016-08-21 15:46 question about BBVERSIONS OVERRIDES and PREFERRED_VERSION 张忠山
@ 2016-08-22 6:55 ` 张忠山
2016-08-22 9:56 ` 张忠山
0 siblings, 1 reply; 5+ messages in thread
From: 张忠山 @ 2016-08-22 6:55 UTC (permalink / raw)
To: bitbake-devel
I answer my first question
The reseaon is that PREFERRED_VERSION_xxx must in a conf file which
should put data to global area.
So I edit my bitbake.conf. Now it is:
BB_SIGNATURE_HANDLER = "basichash"
TMPDIR = "${TOPDIR}/tmp"
CACHE = "${TMPDIR}/cache"
STAMP = "${TMPDIR}/stamps"
T = "${TMPDIR}/work"
B = "${TMPDIR}"
PREFERRED_VERSION_test = '1.1.7'
And my test.bb Now is:
OVERRIDES = ""
PN = "test"
PV = ""
OVERRIDES .= "${@'test:' + ':'.join([x for x in '${BBVERSIONS}'.split()])}"
BBVERSIONS = "develop 1.1.7 pp"
NAME_1.1.7 = 'version is 1.1.7'
NAME_develop = 'version is develop'
NAME_pp = 'version is pp'
python do_build() {
bb.plain("==%s==" % d.getVar('NAME', True))
}
Use 'bitbake test -e' to examine the overrides of var 'NAME', It is
still not contain override for '1.1.7':
#
# $NAME [2 operations]
# override[develop]:set
/home/zzs/temp/bitbake-hello-world/main/../mylayer/test.bb:10
# "version is develop"
# override[pp]:set
/home/zzs/temp/bitbake-hello-world/main/../mylayer/test.bb:11
# "version is pp"
# pre-expansion value:
# "version is pp"
NAME="version is pp"
Why ? I expect it should contain override for '1.1.7', like this:
override[1.1.7]:set
/home/zzs/temp/bitbake-hello-world/main/../mylayer/test.bb:11
....
And I found all NAME_xxx, where xxx is [a-z] all OK? I has no idea about
this.
Anybody help me?
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: question about BBVERSIONS OVERRIDES and PREFERRED_VERSION
2016-08-22 6:55 ` 张忠山
@ 2016-08-22 9:56 ` 张忠山
2016-08-25 11:50 ` Richard Purdie
0 siblings, 1 reply; 5+ messages in thread
From: 张忠山 @ 2016-08-22 9:56 UTC (permalink / raw)
To: bitbake-devel
> Use 'bitbake test -e' to examine the overrides of var 'NAME', It is
> still not contain override for '1.1.7':
>
> #
> # $NAME [2 operations]
> # override[develop]:set
> /home/zzs/temp/bitbake-hello-world/main/../mylayer/test.bb:10
> # "version is develop"
> # override[pp]:set
> /home/zzs/temp/bitbake-hello-world/main/../mylayer/test.bb:11
> # "version is pp"
> # pre-expansion value:
> # "version is pp"
> NAME="version is pp"
>
> Why ? I expect it should contain override for '1.1.7', like this:
> override[1.1.7]:set
> /home/zzs/temp/bitbake-hello-world/main/../mylayer/test.bb:11
> ....
> And I found all NAME_xxx, where xxx is [a-z] all OK? I has no idea about
> this.
> Anybody help me?
>
I found using the flowwing patch can solve my problem about override for
'1.1.7':
============================================================
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index 2ab884b..216ba93 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -552,7 +552,7 @@ class DataSmart(MutableMapping):
# aka pay the cookie monster
override = var[var.rfind('_')+1:]
shortvar = var[:var.rfind('_')]
- while override and override.islower():
+ while override and (override + 'a').islower():
if shortvar not in self.overridedata:
self.overridedata[shortvar] = []
if [var, override] not in self.overridedata[shortvar]:
============================================================
But, I'm not sure this work for other env.
I don't know why just lower case override permited in this function.
Version string just include digit and point is very common, but
islower() return False for these strings.
This behavior is intended or a bug?
Or has another way to solve my problem?
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: question about BBVERSIONS OVERRIDES and PREFERRED_VERSION
2016-08-22 9:56 ` 张忠山
@ 2016-08-25 11:50 ` Richard Purdie
2016-08-25 12:25 ` 张忠山
0 siblings, 1 reply; 5+ messages in thread
From: Richard Purdie @ 2016-08-25 11:50 UTC (permalink / raw)
To: 张忠山, bitbake-devel
On Mon, 2016-08-22 at 17:56 +0800, 张忠山 wrote:
> But, I'm not sure this work for other env.
>
> I don't know why just lower case override permited in this function.
>
> Version string just include digit and point is very common, but
> islower() return False for these strings.
>
> This behavior is intended or a bug?
> Or has another way to solve my problem?
There was a discussion a while ago and we decided to only have bitbake
accept lower case overrides. I believe that the numeric piece isn't an
issue but the decimal point character probably is.
The reason for this was to try and avoid some of the performance costs
where any variable with a "_" in the name was potentially an override
character and this was costly for variable processing.
Cheers,
Richard
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: question about BBVERSIONS OVERRIDES and PREFERRED_VERSION
2016-08-25 11:50 ` Richard Purdie
@ 2016-08-25 12:25 ` 张忠山
0 siblings, 0 replies; 5+ messages in thread
From: 张忠山 @ 2016-08-25 12:25 UTC (permalink / raw)
To: bitbake-devel
>> But, I'm not sure this work for other env.
>>
>> I don't know why just lower case override permited in this function.
>>
>> Version string just include digit and point is very common, but
>> islower() return False for these strings.
>>
>> This behavior is intended or a bug?
>> Or has another way to solve my problem?
>
> There was a discussion a while ago and we decided to only have bitbake
> accept lower case overrides. I believe that the numeric piece isn't an
> issue but the decimal point character probably is.
>
> The reason for this was to try and avoid some of the performance costs
> where any variable with a "_" in the name was potentially an override
> character and this was costly for variable processing.
>
So, that's said I can't use override based upon version string just like
'1.1.7'
If it is true, Does it means 'BBVERSIONS' has no sense?
I can't believe that widly used version string format can't be used as
override!
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-08-25 12:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-21 15:46 question about BBVERSIONS OVERRIDES and PREFERRED_VERSION 张忠山
2016-08-22 6:55 ` 张忠山
2016-08-22 9:56 ` 张忠山
2016-08-25 11:50 ` Richard Purdie
2016-08-25 12:25 ` 张忠山
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.