From 102c4667d1ba993dca9d372910d9eecf1066993e Mon Sep 17 00:00:00 2001 From: Felix Moessbauer Date: Wed, 19 Oct 2022 10:57:36 +0200 Subject: [PATCH] forward build-concurrency related env vars This patch forwards environment variables to control the concurrency and parallelism of the build to bitbake. With that, the user can reduce the concurrency in case of running short on memory. Further, by reducing the concurrency on very large and NUMA machines, the build sometimes can be significantly speed up. Signed-off-by: Felix Moessbauer Signed-off-by: Jan Kiszka --- docs/command-line.rst | 3 +++ kas-container | 2 +- kas/context.py | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/command-line.rst b/docs/command-line.rst index 476807a..b6c3941 100644 --- a/docs/command-line.rst +++ b/docs/command-line.rst @@ -94,6 +94,9 @@ Environment variables | | that host most tools would probably take that | | | first one. | +--------------------------+--------------------------------------------------+ +| ``BB_NUMBER_THREADS`` | Environment variables to control the concurrency | +| ``PARALLEL_MAKE`` | | ++--------------------------+--------------------------------------------------+ .. |aws_cred| replace:: ``AWS_SHARED_CREDENTIALS_FILE`` .. |git_cred| replace:: ``GIT_CREDENTIAL_HELPER`` diff --git a/kas-container b/kas-container index 619c9a2..bc52863 100755 --- a/kas-container +++ b/kas-container @@ -466,7 +466,7 @@ if [ -n "${KAS_REPO_REF_DIR}" ]; then fi for var in TERM KAS_DISTRO KAS_MACHINE KAS_TARGET KAS_TASK \ - KAS_PREMIRRORS; do + KAS_PREMIRRORS BB_NUMBER_THREADS PARALLEL_MAKE; do if [ -n "$(eval echo \$${var})" ]; then set -- "$@" -e "${var}=$(eval echo \"\$${var}\")" fi diff --git a/kas/context.py b/kas/context.py index 2b768fc..6ca5291 100644 --- a/kas/context.py +++ b/kas/context.py @@ -105,7 +105,8 @@ class Context: 'No default locales set.', distro_bases) for key in ['http_proxy', 'https_proxy', 'ftp_proxy', 'no_proxy', - 'SSH_AUTH_SOCK']: + 'SSH_AUTH_SOCK', + 'BB_NUMBER_THREADS', 'PARALLEL_MAKE']: val = os.environ.get(key, None) if val: self.environ[key] = val