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

Martin Jansa martin.jansa at gmail.com
Mon Oct 5 12:46:56 UTC 2015


On Mon, Oct 05, 2015 at 01:49:25PM +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:
> >> I've been puzzling with this for many hours now, but I can't seem to figure
> >> this out.
> >>
> >> I have a recipe that doesn't mention MACHINE anywhere, but still the
> >> sstate-cache won't be re-used for other machines, because OE somehow insists
> >> the package does depend on $MACHINE.
> >>
> >> The workaround I could find is to put something like this in the recipe:
> >>
> >> MACHINE[vardepvalue] = "any"
> >>
> >> (Similar stupid hacks like "vardepsexclude" will probably work too, but I'm
> >> not interested in forcing this particular recipe, but I'm trying to figure out
> >> what makes bitbake think it matters)
> >>
> >> Since it builds for an FPGA type, the package has
> >> PACKAGE_ARCH="${FPGA_FAMILY}" set, and FGPA_FAMILY is set in local.conf.
> >>
> >>
> >> When switching machines, "bitbake -S printdiff fpga-image-dyplo-test" reports
> >> that MACHINE changed and that is what caused sstate not beign reused. But the
> >> recipe does not use anything related to $MACHINE at all.
> >>
> >> Is there a way to make it tell me WHY it thinks that MACHINE is important to
> >> the recipe?
> >
> > Very briefly (sorry travelling), find the task that you want to know
> > more around and find the sigdata file in the stamps directory for it.
> > Run "bitbake-diffsigs <sigdatafile>" and it will show you how the
> > dependencies are calculated. You can compare two sigdata files using the
> > same command, "bitbake-diffsigs <sigdatafile1> <sigdatafile2>".
> 
> Thanks, that reveiled the issue.
> 
> I was smart in local.conf and calculated the FPGA name from the MACHINE name. 
> That yields the same word, but somehow the dependency on the MACHINE variable 
> is kept.
> 
> A simple fix is then to just use a ":=" assignment for FPGA_FAMILY so that the 
> link to MACHINE is lost, but that then results in another rebuild:
> 
>    List of dependencies for variable FPGA_FAMILY changed from 
> 'set(['MACHINE'])' to 'set([])'
>    Dependency on Variable MACHINE was removed
> 
> 
> The FPGA packages take long to build (4 hours for just one is no exception, on 
> an i7 machine) so preventing them to be rebuilt is really important here.
> 
> But having found the issue, I guess after a round of rebuilds, it'll go away now.
> 
> 
> 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'.

You can set vardepvalue flag like this:
X[vardepvalue] = "${X}"
if all you care is the value of X not the expression used to construct
it. This can help with your FGPA_FAMILY and is more readable (at least
to me) then immediate assignment.

This cannot be applied by default, because in some cases you have e.g.
TOPDIR variable used in value and then it's better to exclude just
TOPDIR from the variable dependencies and keep the rest of variables
tracked (using just the value would cause different signatures for 2
builds with different TOPDIR).

> In particular, I've noticed this happening when switching between AUTOREV and 
> a fixed revision in a recipe.
> 
> 
> 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: mike.looijmans at topicproducts.com
> Website: www.topicproducts.com
> 
> Please consider the environment before printing this e-mail
> 
> 
> 
> 
> 
> -- 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20151005/97d76b45/attachment-0002.sig>


More information about the Openembedded-core mailing list