Skip to contentSkip to conversation

PREFERRED_PROVIDER_x/y = "z" versus PREFERRED_PROVIDER += " x/y:z"

DISCUSSION Leon Woestenberg 2 participants 3 messages Sep 4, 2008

lore
Share & tools
lore
#0 lore raw

Hello,

can someone explain the (subtle) differences between

PREFERRED_PROVIDER_x/y = "z"
PREFERRED_PROVIDER += " x/y:z"
?

And also (to be completely clear) when to use what?

Thanks,

Signature · 1 line
Leon
#1 lore raw
Quoted 9 lines · Leon Woestenberg

Hello,

can someone explain the (subtle) differences between

PREFERRED_PROVIDER_x/y = "z"
PREFERRED_PROVIDER += " x/y:z"
?

And also (to be completely clear) when to use what?

As far as I remember, there's no real difference between those two things at the bitbake level. I think the latter syntax came first, but proved cumbersome, and the former was added afterwards as a more convenient mechanism. The main advantage of the former syntax is that it stacks: you can have an include file that sets PREFERRED_PROVIDER_foo to something, and a later-included file can easily override that assignment or defeat it altogether. With the latter syntax, anything other than a straightforward append involves a lot of messy string processing.

Personally I would recommend that you always use the former syntax. I can't think of any situation where the latter is necessary or desirable.

(Also, as a trivial pedantic point, note that the += operator already adds a space for you, so in your second example there is no need to add one explicitly.)

p.

#2 lore raw

Hello Phil,

Quoted 9 lines · Phil Blundell
Quoted 4 lines · Leon Woestenberg

can someone explain the (subtle) differences between PREFERRED_PROVIDER_x/y = "z" PREFERRED_PROVIDER += " x/y:z"
?

As far as I remember, there's no real difference between those two things at the bitbake level. I think the latter syntax came first, but

OK, I wonder if variables inside are handled identically in both cases?

PREFERRED_PROVIDERS += " virtual/${TARGET_PREFIX}g++:gcc-cross"

Quoted 3 lines

Personally I would recommend that you always use the former syntax. I can't think of any situation where the latter is necessary or desirable.

So, anyone objections if I change all occurences?

Regards,

Signature · 4 lines
Leon

* this question is intended to awaken those developers that know there
is a very subtle difference involved.