We could try to parse the ${S}/debian/control file and detect this, but
I guess that doesn't work, as we would have to add the dependency
before running bitbake tasks (a common case is that the debian part is
fetched, hence the task need to run and then it's too late).
> >
>
> In fact, -native is practically overshooting. We would need a recipe
> target that only build the all package.
I thought about this as well. We would need a -all variant that is
basically identical to -native but adds the --no-arch-any sbuild flag.
However, this only helps for first-stage dependencies, as the
transitive dependencies still need to be build in -native. Further, we
need to ensure that either -all or -native is built, but not both. This
would need a model similar to the fetch_common_source task. That's a
lot of complexity for a minimal build-time improvement. By that, I
rather would like to avoid this optimization. If we really need it, we
still can add it in the future.
Felix
That's an interesting finding. If you model the PROVIDES correctly, you
don't have to add the explicit RDEPENDS to the -native variant. This is
what we should document instead of the -native dependency.
Will do so in a v2, once I have more feedback.
Felix
While adding a test, I noticed that this does not work: When building
the -all packages only from the native recipe, these are only added to
the HOST_ARCH repository, but not to the DISTRO_ARCH repo. By that,
they cannot be installed into the image.
>
> > Will do so in a v2, once I have more feedback.
> >
>
> I'm afraid we are not stable with this approach yet.
Yes, this needs more redesign. Probably we need a :class-all that then
deploys to its own repo which is consumed both by the host repo and the
distro repo.
Felix