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 <felix.moessbauer@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Felix Moessbauer 2022-10-19 10:57:36 +02:00 committed by Jan Kiszka
parent cf95cfc57b
commit 102c4667d1
3 changed files with 6 additions and 2 deletions

View File

@ -94,6 +94,9 @@ Environment variables
| | that host most tools would probably take that | | | that host most tools would probably take that |
| | first one. | | | first one. |
+--------------------------+--------------------------------------------------+ +--------------------------+--------------------------------------------------+
| ``BB_NUMBER_THREADS`` | Environment variables to control the concurrency |
| ``PARALLEL_MAKE`` | |
+--------------------------+--------------------------------------------------+
.. |aws_cred| replace:: ``AWS_SHARED_CREDENTIALS_FILE`` .. |aws_cred| replace:: ``AWS_SHARED_CREDENTIALS_FILE``
.. |git_cred| replace:: ``GIT_CREDENTIAL_HELPER`` .. |git_cred| replace:: ``GIT_CREDENTIAL_HELPER``

View File

@ -466,7 +466,7 @@ if [ -n "${KAS_REPO_REF_DIR}" ]; then
fi fi
for var in TERM KAS_DISTRO KAS_MACHINE KAS_TARGET KAS_TASK \ 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 if [ -n "$(eval echo \$${var})" ]; then
set -- "$@" -e "${var}=$(eval echo \"\$${var}\")" set -- "$@" -e "${var}=$(eval echo \"\$${var}\")"
fi fi

View File

@ -105,7 +105,8 @@ class Context:
'No default locales set.', distro_bases) 'No default locales set.', distro_bases)
for key in ['http_proxy', 'https_proxy', 'ftp_proxy', 'no_proxy', 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) val = os.environ.get(key, None)
if val: if val:
self.environ[key] = val self.environ[key] = val