From: "André Draszik" <git@andred.net>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH v2 3/4] bitbake.conf: omit XZ threads and RAM from sstate signatures
Date: Tue, 3 Mar 2020 16:05:12 +0000 [thread overview]
Message-ID: <20200303160513.17645-3-git@andred.net> (raw)
In-Reply-To: <20200303160513.17645-1-git@andred.net>
The number of threads used, and the amount of memory allowed
to be used, should not affect sstate signatures, as they
don't affect the outcome of the compression if xz operates
in multi-threaded mode [1].
Otherwise, it becomes impossible to re-use sstate from
automated builders on developer's machines (as the former
might execute bitbake with certain constraints different
compared to developer's machines).
This is in particular a problem with the opkg package writing
backend, as the OPKGBUILDCMD depends on XZ_DEFAULTS. Without
the vardepexclude, there is no re-use possible of the
package_write_ipk sstate.
Whitelist the maximum number of threads and the memory limit
given assumptions outlined in [2] below.
Signed-off-by: André Draszik <git@andred.net>
[1] When starting out in multi-threaded mode, the output is always
deterministic, as even if xz scales down to single-threaded later,
the archives are still split into blocks and size information is
still added, thus keeping them compatible with multi-threaded mode.
Also, when starting out in multi-threaded mode, xz never scales
down the compression level to accomodate memory usage restrictions,
it just scales down the number of threads and errors out if it
can not accomodate the memory limit.
[2] Assumptions
* We only support multi-threaded mode (threads >= 2), builds
should not try to use xz in single-threaded mode
* The thread limit should be set via XZ_THREADS, not via
modifying XZ_DEFAULTS or XZ_OPTS, or any other way
* The thread limit should not be set to xz's magic value
zero (0), as that will lead to single-threaded mode on
single-core systems.
---
meta/conf/bitbake.conf | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 131ba296d3..4b544a22cd 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -795,7 +795,10 @@ BB_NUMBER_THREADS ?= "${@oe.utils.cpu_count()}"
PARALLEL_MAKE ?= "-j ${@oe.utils.cpu_count()}"
# Default parallelism and resource usage for xz
-XZ_DEFAULTS ?= "--memlimit=50% --threads=${@oe.utils.cpu_count(at_least=2)}"
+XZ_MEMLIMIT ?= "50%"
+XZ_THREADS ?= "${@oe.utils.cpu_count(at_least=2)}"
+XZ_DEFAULTS ?= "--memlimit=${XZ_MEMLIMIT} --threads=${XZ_THREADS}"
+XZ_DEFAULTS[vardepsexclude] += "XZ_MEMLIMIT XZ_THREADS"
##################################################################
# Magic Cookie for SANITY CHECK
--
2.23.0.rc1
next prev parent reply other threads:[~2020-03-03 16:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-03 16:05 [PATCH v2 1/4] lib/oe/utils: allow to set a lower bound on returned cpu_count() André Draszik
2020-03-03 16:05 ` [PATCH v2 2/4] bitbake.conf: more deterministic xz compression (threads) André Draszik
2020-03-03 16:05 ` André Draszik [this message]
2020-03-03 16:05 ` [PATCH v2 4/4] reproducible: try to ensure reproducible xz archives André Draszik
2020-03-03 16:08 ` André Draszik
2020-03-04 0:31 ` Otavio Salvador
2020-03-04 6:03 ` 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=20200303160513.17645-3-git@andred.net \
--to=git@andred.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.