Skip to contentSkip to conversation

Bitbake / oe-core anomaly with multilibs

DISCUSSION Mark Hatle 3 participants 5 messages Mar 18, 2013 – Mar 19, 2013

lore
Share & tools
lore

Mark Hatle

author
#0 lore raw

I found a strange situation today and I'm looking for an explanation to see if it's a bug or not.

Between a .bb and .bbappend file, I end up with a situation where "reproducer.bb" and "reproducer.bbappend" get the following:

RDEPENDS_${PN} += "hello1"
RDEPENDS_reproducer += "hello2"

When evaluatated (bitbake -e reproducer) I get:

#
# $RDEPENDS_reproducer [2 operations]
# append /home/mhatle/git/oss/oe-core/local/recipes-sample/hello/reproducer_1.0.bb:16
# "hello2"
# rename from RDEPENDS_${PN} data.py:161 [expandKeys]
# " hello1"
# computed:
# " hello1"
RDEPENDS_reproducer="hello1"

So that tells me that it was initially set to "hello2", and then the ${PN} expansion occurred, causing it to be set to "hello1".

So my first question is, should this be "hello1", "hello2", "hello1 hello2" or "hello2 hello1"?

The second issue is a bit stranger.. if I change the build from "reproducer" to "lib32-reproducer", I get a different result:

# $RDEPENDS_lib32-reproducer [3 operations]
# rename from RDEPENDS_${PN} data.py:161 [expandKeys]
# " hello1"
# rename from RDEPENDS_reproducer classextend.py:95 [rename_package_variables]
# " hello2"
# set classextend.py:71 [map_depends_variable]
# "lib32-hello2"
# computed:
# "lib32-hello2"
RDEPENDS_lib32-reproducer="lib32-hello2"

This time the system pulled in the ${PN} version first (obviously expanded it), and then turned out and found the RDEPENDS_reproducer, and remapped it to RDEPENDS_lib32-reproducer replacing the origin ${PN} version.

So I have two concerns, the first is the value is 'different' from the non-multilib version, and second, what should the expected output be for this item?

Thanks for any insight!
--Mark

#1 lore raw
Quoted 22 lines · Mark Hatle

I found a strange situation today and I'm looking for an explanation to see if it's a bug or not.

Between a .bb and .bbappend file, I end up with a situation where "reproducer.bb" and "reproducer.bbappend" get the following:

RDEPENDS_${PN} += "hello1"
RDEPENDS_reproducer += "hello2"

When evaluatated (bitbake -e reproducer) I get:

#
# $RDEPENDS_reproducer [2 operations]
# append
/home/mhatle/git/oss/oe-core/local/recipes-sample/hello/reproducer_1.0.bb:16
# "hello2"
# rename from RDEPENDS_${PN} data.py:161 [expandKeys]
# " hello1"
# computed:
# " hello1"
RDEPENDS_reproducer="hello1"

Quoted 5 lines

So that tells me that it was initially set to "hello2", and then the ${PN} expansion occurred, causing it to be set to "hello1".

So my first question is, should this be "hello1", "hello2", "hello1 hello2" or "hello2 hello1"?

expandKeys tramples existing values so that result doesn't surprise me even if its not what you expect.

Quoted 14 lines

The second issue is a bit stranger.. if I change the build from "reproducer" to "lib32-reproducer", I get a different result:

# $RDEPENDS_lib32-reproducer [3 operations]
# rename from RDEPENDS_${PN} data.py:161 [expandKeys]
# " hello1"
# rename from RDEPENDS_reproducer classextend.py:95 [rename_package_variables]
# " hello2"
# set classextend.py:71 [map_depends_variable]
# "lib32-hello2"
# computed:
# "lib32-hello2"
RDEPENDS_lib32-reproducer="lib32-hello2"

Quoted 6 lines

This time the system pulled in the ${PN} version first (obviously expanded it), and then turned out and found the RDEPENDS_reproducer, and remapped it to RDEPENDS_lib32-reproducer replacing the origin ${PN} version.

So I have two concerns, the first is the value is 'different' from the non-multilib version, and second, what should the expected output be for this item?

Again, I'm not surprised. The multilib remapping code gets executed at the end, after expandKeys and in this case last wins. So I can see why the system is doing it, even if you don't like the end result.

Setting multiple conflicting keys like this is dangerous :(

We've tried to fix this before and ended up just digging deeper holes with more problems.

Cheers,

Richard

author
#2 lore raw
Quoted 53 lines · Richard Purdie
Quoted 22 lines · Mark Hatle

I found a strange situation today and I'm looking for an explanation to see if it's a bug or not.

Between a .bb and .bbappend file, I end up with a situation where "reproducer.bb" and "reproducer.bbappend" get the following:

RDEPENDS_${PN} += "hello1"
RDEPENDS_reproducer += "hello2"

When evaluatated (bitbake -e reproducer) I get:

#
# $RDEPENDS_reproducer [2 operations]
# append
/home/mhatle/git/oss/oe-core/local/recipes-sample/hello/reproducer_1.0.bb:16
# "hello2"
# rename from RDEPENDS_${PN} data.py:161 [expandKeys]
# " hello1"
# computed:
# " hello1"
RDEPENDS_reproducer="hello1"

Quoted 5 lines

So that tells me that it was initially set to "hello2", and then the ${PN} expansion occurred, causing it to be set to "hello1".

So my first question is, should this be "hello1", "hello2", "hello1 hello2" or "hello2 hello1"?

expandKeys tramples existing values so that result doesn't surprise me even if its not what you expect.

Quoted 14 lines

The second issue is a bit stranger.. if I change the build from "reproducer" to "lib32-reproducer", I get a different result:

# $RDEPENDS_lib32-reproducer [3 operations]
# rename from RDEPENDS_${PN} data.py:161 [expandKeys]
# " hello1"
# rename from RDEPENDS_reproducer classextend.py:95 [rename_package_variables]
# " hello2"
# set classextend.py:71 [map_depends_variable]
# "lib32-hello2"
# computed:
# "lib32-hello2"
RDEPENDS_lib32-reproducer="lib32-hello2"

Quoted 6 lines

This time the system pulled in the ${PN} version first (obviously expanded it), and then turned out and found the RDEPENDS_reproducer, and remapped it to RDEPENDS_lib32-reproducer replacing the origin ${PN} version.

So I have two concerns, the first is the value is 'different' from the non-multilib version, and second, what should the expected output be for this item?

Quoted 8 lines

Again, I'm not surprised. The multilib remapping code gets executed at the end, after expandKeys and in this case last wins. So I can see why the system is doing it, even if you don't like the end result.

Setting multiple conflicting keys like this is dangerous :(

We've tried to fix this before and ended up just digging deeper holes with more problems.

Is there any way we can issue a warning from the parser or something when it finds conflicting keys? My concern isn't that conflicting keys are causing a problem -- but more that someone may not realize this is a problem, and they are getting incorrect results.

I know since posting this query, I've had a few people comment to me that they saw the same problem and it took them a very long time to diagnose it and figure out it "just didn't work".

--Mark

Quoted 4 lines

Cheers,

Richard

#3 lore raw
Quoted 63 lines · Mark Hatle
Quoted 53 lines · Richard Purdie
Quoted 22 lines · Mark Hatle

I found a strange situation today and I'm looking for an explanation to see if it's a bug or not.

Between a .bb and .bbappend file, I end up with a situation where "reproducer.bb" and "reproducer.bbappend" get the following:

RDEPENDS_${PN} += "hello1"
RDEPENDS_reproducer += "hello2"

When evaluatated (bitbake -e reproducer) I get:

#
# $RDEPENDS_reproducer [2 operations]
# append
/home/mhatle/git/oss/oe-core/local/recipes-sample/hello/reproducer_1.0.bb:16
# "hello2"
# rename from RDEPENDS_${PN} data.py:161 [expandKeys]
# " hello1"
# computed:
# " hello1"
RDEPENDS_reproducer="hello1"

Quoted 5 lines

So that tells me that it was initially set to "hello2", and then the ${PN} expansion occurred, causing it to be set to "hello1".

So my first question is, should this be "hello1", "hello2", "hello1 hello2" or "hello2 hello1"?

expandKeys tramples existing values so that result doesn't surprise me even if its not what you expect.

Quoted 14 lines

The second issue is a bit stranger.. if I change the build from "reproducer" to "lib32-reproducer", I get a different result:

# $RDEPENDS_lib32-reproducer [3 operations]
# rename from RDEPENDS_${PN} data.py:161 [expandKeys]
# " hello1"
# rename from RDEPENDS_reproducer classextend.py:95 [rename_package_variables]
# " hello2"
# set classextend.py:71 [map_depends_variable]
# "lib32-hello2"
# computed:
# "lib32-hello2"
RDEPENDS_lib32-reproducer="lib32-hello2"

Quoted 6 lines

This time the system pulled in the ${PN} version first (obviously expanded it), and then turned out and found the RDEPENDS_reproducer, and remapped it to RDEPENDS_lib32-reproducer replacing the origin ${PN} version.

So I have two concerns, the first is the value is 'different' from the non-multilib version, and second, what should the expected output be for this item?

Quoted 8 lines

Again, I'm not surprised. The multilib remapping code gets executed at the end, after expandKeys and in this case last wins. So I can see why the system is doing it, even if you don't like the end result.

Setting multiple conflicting keys like this is dangerous :(

We've tried to fix this before and ended up just digging deeper holes with more problems.

Quoted 8 lines

Is there any way we can issue a warning from the parser or something when it finds conflicting keys? My concern isn't that conflicting keys are causing a problem -- but more that someone may not realize this is a problem, and they are getting incorrect results.

I know since posting this query, I've had a few people comment to me that they saw the same problem and it took them a very long time to diagnose it and figure out it "just didn't work".

We could probably have data.expandKeys() check for existing values and then error if its overwriting something else. I have no idea how often the metadata does that for "correct" reasons...

Cheers,

Richard

#4 lore raw
Quoted 82 lines · Richard Purdie
Quoted 3 lines · Mark Hatle
Quoted 2 lines · Richard Purdie
Quoted 1 line · Mark Hatle

I found a strange situation today and I'm looking for an explanation

to see if

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

it's a bug or not.

Between a .bb and .bbappend file, I end up with a situation where "reproducer.bb" and "reproducer.bbappend" get the following:

RDEPENDS_${PN} += "hello1"
RDEPENDS_reproducer += "hello2"

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

When evaluatated (bitbake -e reproducer) I get:

#
# $RDEPENDS_reproducer [2 operations]
# append
/home/mhatle/git/oss/oe-core/local/recipes-sample/hello/

reproducer_1.0.bb:16

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

# "hello2"
# rename from RDEPENDS_${PN} data.py:161 [expandKeys]
# " hello1"
# computed:
# " hello1"
RDEPENDS_reproducer="hello1"

So that tells me that it was initially set to "hello2", and then the

${PN}

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

expansion occurred, causing it to be set to "hello1".

So my first question is, should this be "hello1", "hello2", "hello1

hello2" or

Quoted 6 lines
Quoted 6 lines
Quoted 1 line

"hello2 hello1"?

expandKeys tramples existing values so that result doesn't surprise me even if its not what you expect.

Quoted 1 line

The second issue is a bit stranger.. if I change the build from

"reproducer" to

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

"lib32-reproducer", I get a different result:

# $RDEPENDS_lib32-reproducer [3 operations]
# rename from RDEPENDS_${PN} data.py:161 [expandKeys]
# " hello1"
# rename from RDEPENDS_reproducer classextend.py:95

[rename_package_variables]

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

# " hello2"
# set classextend.py:71 [map_depends_variable]
# "lib32-hello2"
# computed:
# "lib32-hello2"
RDEPENDS_lib32-reproducer="lib32-hello2"

This time the system pulled in the ${PN} version first (obviously

expanded it),

Quoted 1 line
Quoted 1 line
Quoted 1 line

and then turned out and found the RDEPENDS_reproducer, and remapped

it to

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

RDEPENDS_lib32-reproducer replacing the origin ${PN} version.

So I have two concerns, the first is the value is 'different' from the non-multilib version, and second, what should the expected output be

for this item?

Quoted 11 lines
Quoted 9 lines

Again, I'm not surprised. The multilib remapping code gets executed at the end, after expandKeys and in this case last wins. So I can see why the system is doing it, even if you don't like the end result.

Setting multiple conflicting keys like this is dangerous :(

We've tried to fix this before and ended up just digging deeper holes with more problems.

Is there any way we can issue a warning from the parser or something

when it

Quoted 1 line

finds conflicting keys? My concern isn't that conflicting keys are

causing a

Quoted 1 line

problem -- but more that someone may not realize this is a problem, and

they are

Quoted 3 lines

getting incorrect results.

I know since posting this query, I've had a few people comment to me

Quoted 8 lines

that they

Quoted 1 line

saw the same problem and it took them a very long time to diagnose it

and figure

Quoted 1 line

out it "just didn't work".

We could probably have data.expandKeys() check for existing values and then error if its overwriting something else. I have no idea how often the metadata does that for "correct" reasons...

I expect if the metadata really wants that, it could use a RecipePreFinalise hook.

Signature · 1 line
Christopher Larson