Merge pull request #217687 from OPNA2608/fix/py-grpcio_parallelism

python3Packages.grpcio: Fix build parallelism
This commit is contained in:
Sandro 2023-03-08 13:31:06 +01:00 committed by GitHub
commit 379ab86ded
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,7 +26,14 @@ buildPythonPackage rec {
propagatedBuildInputs = [ six protobuf ]
++ lib.optionals (isPy27) [ enum34 futures ];
preBuild = lib.optionalString stdenv.isDarwin "unset AR";
preBuild = ''
export GRPC_PYTHON_BUILD_EXT_COMPILER_JOBS="$NIX_BUILD_CORES"
if [ -z "$enableParallelBuilding" ]; then
GRPC_PYTHON_BUILD_EXT_COMPILER_JOBS=1
fi
'' + lib.optionalString stdenv.isDarwin ''
unset AR
'';
GRPC_BUILD_WITH_BORING_SSL_ASM = "";
GRPC_PYTHON_BUILD_SYSTEM_OPENSSL = 1;
@ -36,6 +43,8 @@ buildPythonPackage rec {
# does not contain any tests
doCheck = false;
enableParallelBuilding = true;
pythonImportsCheck = [ "grpc" ];
meta = with lib; {