On 05-10-15 15:22, Richard Purdie wrote:
On Mon, 2015-10-05 at 13:49 +0200, Mike Looijmans wrote:
On 05-10-15 12:18, Richard Purdie wrote:
On Mon, 2015-10-05 at 11:34 +0200, Mike Looijmans wrote:
...
For the bigger picture:

If I have a recipe that says:

X = "x"

And I refactor it a bit to read:

Y = "x"
X = "${Y}"

What is the logic behind having to rebuild the package now? Why does the
'source' of the contents matter to the hash? It won't generate different
output, regardless whether X is 'calculated' or just 'constant'.

In particular, I've noticed this happening when switching between AUTOREV and
a fixed revision in a recipe.

This is simply just the way the system is designed. It checksums the
intermediate steps as well as the endpoints. I guess in the above
example the system might do "export Y" for example.

In that case, "Y" would end up in the package's sstate hash, and hence it would rebuild when Y changes.

I have a workaround now, multiple workarounds actually, but I'm trying to understand why the system would be designed this way. Currently I'm tempted to splatter X[vardepvalue]="${X}" all over the place just to get rid of this annoying behaviour.

There are alternative ways to do things but its simply not the way
things were implemented. If you do need to collapse the dependency
chain, you can use vardepvalue which was added for that reason. There
are only a small number of places you really need to do that.

Lets make things more concrete. My distro.conf now reads:

FULL_OPTIMIZATION = "-O2 -pipe ${DEBUG_FLAGS}"

Say I want to build packages with varying optimization levels. I consider myself pretty smart, so in this distro.conf file, I change that line to:

OPT_LEVEL ?= "-O2"
FULL_OPTIMIZATION = "${OPT_LEVEL} -pipe ${DEBUG_FLAGS}"

So now I can replace the optimization level of some packages by simply changing the OPT_LEVEL variable.

Nice, but this will trigger a rebuild of ALL packages, event though the build flags did not change at all!

I can't think of any reason why this would be desirable. Why is it designed this way?



Kind regards,

Mike Looijmans
System Expert

TOPIC Embedded Products
Eindhovenseweg 32-C, NL-5683 KH Best
Postbus 440, NL-5680 AK Best
Telefoon: +31 (0) 499 33 69 79
Telefax: +31 (0) 499 33 69 70
E-mail: [email protected]
Website: www.topicproducts.com

Please consider the environment before printing this e-mail





--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to