[OE-core] How to find out why my do_compile depends on $MACHINE

Christopher Larson clarson at kergoth.com
Tue Oct 6 15:40:38 UTC 2015


On Tue, Oct 6, 2015 at 5:55 AM, Mike Looijmans <mike.looijmans at topic.nl>
wrote:

> 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?


This behavior has bugged me for quite a while, I'd love to see this change
in the long term, assuming Richard isn't opposed to it. We should care
about the results, not how we got there, generally.
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20151006/bb4d2061/attachment-0002.html>


More information about the Openembedded-core mailing list