<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 7 April 2017 at 11:28, Richard Purdie <span dir="ltr"><<a href="mailto:richard.purdie@linuxfoundation.org" target="_blank">richard.purdie@linuxfoundation.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-HOEnZb"><div class="gmail-h5">On Fri, 2017-04-07 at 09:09 +0300, Jussi Kukkonen wrote:<br>
> There seems to be no advantage to letting distro features affect<br>
> native builds. There is a significant disadvantage: a change to<br>
> DISTRO_FEATURES will trigger a lot of unnecessary native tasks. In a<br>
> test like this:<br>
> $ bitbake core-image-minimal<br>
> # append " systemd" to DISTRO_FEATURES<br>
> $ bitbake core-image-minimal<br>
> The latter build takes 44 minutes (28%) of cpu-time less with this<br>
> patch (skipping 135 native tasks). Sadly wall clock time was not<br>
> affected as glibc remains the bottleneck.<br>
><br>
> Set DISTRO_FEATURES to a fixed value for native recipes to avoid the<br>
> unnecessary tasks: currently the default value is empty.<br>
><br>
> Do the variable setting in native_virtclass_handler() because<br>
> otherwise<br>
> it could still be overridden by appends and the feature backfilling.<br>
> Shuffle the early returns so DISTRO_FEATURES gets set as long as<br>
> the packagename ends with "-native".<br>
><br>
> Signed-off-by: Jussi Kukkonen <<a href="mailto:jussi.kukkonen@intel.com">jussi.kukkonen@intel.com</a>><br>
> ---<br>
> meta/classes/native.bbclass | 12 ++++++++----<br>
> meta/conf/bitbake.conf |<wbr> 2 ++<br>
> 2 files changed, 10 insertions(+), 4 deletions(-)<br>
><br>
> diff --git a/meta/classes/native.bbclass<br>
> b/meta/classes/native.bbclass<br>
> index 1919fbc..fbca4c6 100644<br>
> --- a/meta/classes/native.bbclass<br>
> +++ b/meta/classes/native.bbclass<br>
> @@ -121,14 +121,18 @@ PATH_prepend = "${COREBASE}/scripts/native-<br>
> intercept:"<br>
> SSTATE_SCAN_CMD ?= "${SSTATE_SCAN_CMD_NATIVE}"<br>
> <br>
> python native_virtclass_handler () {<br>
> - classextend = e.data.getVar('BBCLASSEXTEND') or ""<br>
> - if "native" not in classextend:<br>
> - return<br>
> -<br>
> pn = e.data.getVar("PN")<br>
> if not pn.endswith("-native"):<br>
> return<br>
> <br>
> + # Set features here to prevent appends and distro features<br>
> backfill<br>
> + # from modifying native distro features<br>
> + d.setVar("DISTRO_<wbr>FEATURES", "${NATIVE_DISTRO_FEATURES}")<br>
> +<br>
> + classextend = e.data.getVar('BBCLASSEXTEND') or ""<br>
> + if "native" not in classextend:<br>
> + return<br>
> +<br>
> def map_dependencies(varname, d, suffix = ""):<br>
> if suffix:<br>
> varname = varname + "_" + suffix<br>
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf<br>
> index 5e98d45..78a3470 100644<br>
> --- a/meta/conf/bitbake.conf<br>
> +++ b/meta/conf/bitbake.conf<br>
> @@ -789,6 +789,8 @@ MACHINE_ESSENTIAL_EXTRA_<wbr>RRECOMMENDS ?= ""<br>
> EXTRA_IMAGE_FEATURES ??= ""<br>
> IMAGE_FEATURES += "${EXTRA_IMAGE_FEATURES}"<br>
> <br>
> +NATIVE_DISTRO_FEATURES ?= ""<br>
> +<br>
> DISTRO_FEATURES_BACKFILL = "pulseaudio sysvinit bluez5 gobject-<br>
> introspection-data ldconfig"<br>
> MACHINE_FEATURES_BACKFILL = "rtc qemu-usermode"<br>
<br>
</div></div>Thanks for working on this, looks good.<br>
<br>
Most native variables are called XXX_NATIVE, not NATIVE_XXX so we might<br>
want to make this match?<br></blockquote><div><br></div><div>Will do.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Also, one question. Does this have any effect on qemu-native? Does<br>
qemu-native need/use x11 today?<br></blockquote><div><br></div><div>qemu itself does not use anything x11 since last year and the default native packageconfig is already not</div><div>dependent on distro features.</div><div><br></div><div>Now that you mentioned I had a closer look at qemu & SDL:</div><div> * qemu-native doesn't build with "sdl" by default, but someone might change that of course </div><div> * If that happens (and libsdl-native is not in ASSUME_PROVIDED), libsdl is built and by default depends on libx11</div><div>I completely expected this to fail now (without x11 in distro features) but it actually builds just fine. It turns out that a clever Burton has tweaked </div><div>REQUIRED_DISTRO_FEATURES_class-native for some X libraries for exactly this purpose already.<br></div><div><br></div><div><br></div><div>Jussi<br></div></div></div></div>