diff options
author | Peter Marko <peter.marko@siemens.com> | 2025-03-04 19:59:58 +0100 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2025-03-06 09:49:24 -0500 |
commit | 7842d4eb450d4360bc28e6635d501b687a212bcd (patch) | |
tree | fbf726c7dfb3d709d6c82808799469fba265ecf8 | |
parent | fedd8cf51d6f6a2846bc266a9934e6d218bc2de6 (diff) | |
download | meta-openembedded-7842d4eb450d4360bc28e6635d501b687a212bcd.tar.gz |
python3-grpcio(-tools): fix build concurrency issue
Set GRPC_PYTHON_BUILD_EXT_COMPILER_JOBS to limit spawned compiler
processes. Without this it uses all available CPUs (via
multiprocessing.cpu_count()) and can exhaust build host since there are
lot of files to compile (e.g. with 128 cores it manages to spawn 128 gcc
processes)
Note that this is a general problem for all setuptools based builds with
build_ext compilation which can either compile with 1 thread or
cpu_count threads. grpcio hot-patches setuptools and allows to set
specific build concurrency value.
(From master rev: fe582374d3ba474164005942799eb2bddc52a080)
Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r-- | meta-python/recipes-devtools/python/python3-grpcio-tools_1.45.0.bb | 4 | ||||
-rw-r--r-- | meta-python/recipes-devtools/python/python3-grpcio_1.45.0.bb | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-grpcio-tools_1.45.0.bb b/meta-python/recipes-devtools/python/python3-grpcio-tools_1.45.0.bb index 1e919dd3af..be851ba990 100644 --- a/meta-python/recipes-devtools/python/python3-grpcio-tools_1.45.0.bb +++ b/meta-python/recipes-devtools/python/python3-grpcio-tools_1.45.0.bb | |||
@@ -14,4 +14,8 @@ SRC_URI[sha256sum] = "a016cfc21e0d91b3b036d3d4f968d1fdea865dfa03524cb1fbeca84719 | |||
14 | 14 | ||
15 | RDEPENDS:${PN} = "${PYTHON_PN}-grpcio" | 15 | RDEPENDS:${PN} = "${PYTHON_PN}-grpcio" |
16 | 16 | ||
17 | do_compile:prepend() { | ||
18 | export GRPC_PYTHON_BUILD_EXT_COMPILER_JOBS="${@oe.utils.parallel_make(d, False)}" | ||
19 | } | ||
20 | |||
17 | BBCLASSEXTEND = "native nativesdk" | 21 | BBCLASSEXTEND = "native nativesdk" |
diff --git a/meta-python/recipes-devtools/python/python3-grpcio_1.45.0.bb b/meta-python/recipes-devtools/python/python3-grpcio_1.45.0.bb index ca55a7f091..56b84dab72 100644 --- a/meta-python/recipes-devtools/python/python3-grpcio_1.45.0.bb +++ b/meta-python/recipes-devtools/python/python3-grpcio_1.45.0.bb | |||
@@ -35,6 +35,10 @@ BORING_SSL:arm = "1" | |||
35 | BORING_SSL ?= "0" | 35 | BORING_SSL ?= "0" |
36 | export GRPC_BUILD_WITH_BORING_SSL_ASM = "${BORING_SSL}" | 36 | export GRPC_BUILD_WITH_BORING_SSL_ASM = "${BORING_SSL}" |
37 | 37 | ||
38 | do_compile:prepend() { | ||
39 | export GRPC_PYTHON_BUILD_EXT_COMPILER_JOBS="${@oe.utils.parallel_make(d, False)}" | ||
40 | } | ||
41 | |||
38 | GRPC_CFLAGS ?= "" | 42 | GRPC_CFLAGS ?= "" |
39 | GRPC_CFLAGS:append:toolchain-clang = " -fvisibility=hidden -fno-wrapv -fno-exceptions" | 43 | GRPC_CFLAGS:append:toolchain-clang = " -fvisibility=hidden -fno-wrapv -fno-exceptions" |
40 | export GRPC_PYTHON_CFLAGS = "${GRPC_CFLAGS}" | 44 | export GRPC_PYTHON_CFLAGS = "${GRPC_CFLAGS}" |