py-grpcio: set parallel build jobs (#25616)

By default the number of parellel compiler processes launched by
py-grpcio equals the number of threads.  This commit limit it to
spack config build_jobs.
This commit is contained in:
Xiao-Yong 2021-08-25 20:08:05 -05:00 committed by GitHub
parent de3c0e62d0
commit 204b49fc1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,8 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyGrpcio(PythonPackage): class PyGrpcio(PythonPackage):
"""HTTP/2-based RPC framework.""" """HTTP/2-based RPC framework."""
@ -46,6 +48,7 @@ def setup_build_environment(self, env):
env.set('GRPC_PYTHON_BUILD_SYSTEM_CARES', True) env.set('GRPC_PYTHON_BUILD_SYSTEM_CARES', True)
# https://github.com/grpc/grpc/pull/24449 # https://github.com/grpc/grpc/pull/24449
env.set('GRPC_BUILD_WITH_BORING_SSL_ASM', '') env.set('GRPC_BUILD_WITH_BORING_SSL_ASM', '')
env.set('GRPC_PYTHON_BUILD_EXT_COMPILER_JOBS', str(make_jobs))
for dep in self.spec.dependencies(deptype='link'): for dep in self.spec.dependencies(deptype='link'):
query = self.spec[dep.name] query = self.spec[dep.name]