From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
To: Jussi Kukkonen <jussi.kukkonen@intel.com>,
"openembedded-core@lists.openembedded.org"
<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCHv3 1/1] native/nativesdk: Use fixed DISTRO_FEATURES
Date: Tue, 11 Apr 2017 15:32:40 +0000 [thread overview]
Message-ID: <8f6fdae166cb44babe9c975f584df839@XBOX02.axis.com> (raw)
In-Reply-To: <ea482eb749a7dbeb22743bf6ce3f31c447b970bf.1491920909.git.jussi.kukkonen@intel.com>
> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org
> [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of
> Jussi Kukkonen
> Sent: den 11 april 2017 16:36
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [PATCHv3 1/1] native/nativesdk: Use fixed
> DISTRO_FEATURES
>
> There seems to be little advantage to letting distro features affect
> native builds. There is a significant disadvantage: a change to
> DISTRO_FEATURES will trigger a lot of unnecessary native tasks. In a
> test like this:
> $ bitbake core-image-minimal
> # append " systemd" to DISTRO_FEATURES
> $ bitbake core-image-minimal
> The latter build takes 44 minutes (28%) of cpu-time less with this
> patch (skipping 135 native tasks). Sadly wall clock time was not
> affected as glibc remains the bottleneck.
>
> Set native distro features to DISTRO_FEATURES_NATIVE appended with
> an intersection of DISTRO_FEATURES and DISTRO_FEATURES_FILTER_NATIVE.
> Current default values (baitbake.conf) are
> * DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation" (as gtk-doc-
> native
> has much less dependencies when built without it)
> * DISTRO_FEATURES_NATIVE ?= "x11" (to enable native UIs even if target
> does not containe them)
>
> Do the variable setting in native_virtclass_handler() because otherwise
> it could still be overridden by appends and the feature backfilling.
> Shuffle the early returns so DISTRO_FEATURES gets set as long as
> the packagename ends with "-native".
>
> Add similar variables for nativesdk.
>
> Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
> ---
> meta/classes/native.bbclass | 14 ++++++++++----
> meta/classes/nativesdk.bbclass | 6 ++++++
> meta/conf/bitbake.conf | 9 +++++++++
> 3 files changed, 25 insertions(+), 4 deletions(-)
>
> diff --git a/meta/classes/native.bbclass b/meta/classes/native.bbclass
> index 1919fbc..aec1087 100644
> --- a/meta/classes/native.bbclass
> +++ b/meta/classes/native.bbclass
> @@ -121,14 +121,20 @@ PATH_prepend = "${COREBASE}/scripts/native-
> intercept:"
> SSTATE_SCAN_CMD ?= "${SSTATE_SCAN_CMD_NATIVE}"
>
> python native_virtclass_handler () {
> - classextend = e.data.getVar('BBCLASSEXTEND') or ""
> - if "native" not in classextend:
> - return
> -
> pn = e.data.getVar("PN")
> if not pn.endswith("-native"):
> return
>
> + # Set features here to prevent appends and distro features
> backfill
> + # from modifying native distro features
> + features = set(d.getVar("DISTRO_FEATURES_NATIVE").split())
> + filtered = set(bb.utils.filter("DISTRO_FEATURES", d.getVar("DISTRO_FEATURES_FILTER_NATIVE"), d).split())
> + d.setVar("DISTRO_FEATURES", " ".join(features | filtered))
You should sort the list of features to make it deterministic.
> +
> + classextend = e.data.getVar('BBCLASSEXTEND') or ""
> + if "native" not in classextend:
> + return
> +
> def map_dependencies(varname, d, suffix = ""):
> if suffix:
> varname = varname + "_" + suffix
> diff --git a/meta/classes/nativesdk.bbclass
> b/meta/classes/nativesdk.bbclass
> index ebcfb2d..655b456 100644
> --- a/meta/classes/nativesdk.bbclass
> +++ b/meta/classes/nativesdk.bbclass
> @@ -70,6 +70,12 @@ python nativesdk_virtclass_handler () {
> if not (pn.endswith("-nativesdk") or pn.startswith("nativesdk-")):
> return
>
> + # Set features here to prevent appends and distro features
> backfill
> + # from modifying nativesdk distro features
> + features = set(d.getVar("DISTRO_FEATURES_NATIVESDK").split())
> + filtered = set(bb.utils.filter("DISTRO_FEATURES", d.getVar("DISTRO_FEATURES_FILTER_NATIVESDK"), d).split())
> + d.setVar("DISTRO_FEATURES", " ".join(features | filtered))
Sort this one as well.
> +
> e.data.setVar("MLPREFIX", "nativesdk-")
> e.data.setVar("PN", "nativesdk-" + e.data.getVar("PN").replace("-
> nativesdk", "").replace("nativesdk-", ""))
> e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) +
> ":virtclass-nativesdk")
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index 5e98d45..dca6bd4 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -789,6 +789,15 @@ MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS ?= ""
> EXTRA_IMAGE_FEATURES ??= ""
> IMAGE_FEATURES += "${EXTRA_IMAGE_FEATURES}"
>
> +# Native distro features (will always be used for -native, even if
> they
> +# are not enabled for target)
> +DISTRO_FEATURES_NATIVE ?= "x11"
> +DISTRO_FEATURES_NATIVESDK ?= "x11"
> +# Normally target distro features will not be applied to native
> builds:
> +# Native distro features on this list will use the target feature
> value
> +DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation"
> +DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation"
> +
> DISTRO_FEATURES_BACKFILL = "pulseaudio sysvinit bluez5 gobject-
> introspection-data ldconfig"
> MACHINE_FEATURES_BACKFILL = "rtc qemu-usermode"
>
> --
> 2.1.4
//Peter
next prev parent reply other threads:[~2017-04-11 15:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-11 14:35 [PATCHv3 0/1] Use fixed DISTRO_FEATURES for native Jussi Kukkonen
2017-04-11 14:35 ` [PATCHv3 1/1] native/nativesdk: Use fixed DISTRO_FEATURES Jussi Kukkonen
2017-04-11 15:32 ` Peter Kjellerstedt [this message]
2017-04-11 17:16 ` Richard Purdie
2017-04-11 18:06 ` Peter Kjellerstedt
2017-04-11 21:12 ` Richard Purdie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8f6fdae166cb44babe9c975f584df839@XBOX02.axis.com \
--to=peter.kjellerstedt@axis.com \
--cc=jussi.kukkonen@intel.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox