aboutsummaryrefslogtreecommitdiffhomepage
path: root/setup.py
diff options
context:
space:
mode:
authorGravatar Eric Gribkoff <ericgribkoff@google.com>2018-11-30 10:40:39 -0800
committerGravatar Eric Gribkoff <ericgribkoff@google.com>2018-11-30 11:49:38 -0800
commitaa67cb24a7d82b74c938e769fb1fa56794efd8e1 (patch)
tree908833e155829cecd9225a546077d62c669f8042 /setup.py
parent37ee7b664e7aca69952f76d6335a1ff899e0ef6f (diff)
Allow building only the Python/Cython code in setup.py via new flag
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index ae86e6c9fb..7bdfc99e24 100644
--- a/setup.py
+++ b/setup.py
@@ -87,6 +87,7 @@ CLASSIFIERS = [
# present, then it will still attempt to use Cython.
BUILD_WITH_CYTHON = os.environ.get('GRPC_PYTHON_BUILD_WITH_CYTHON', False)
+
# Export this variable to use the system installation of openssl. You need to
# have the header files installed (in /usr/include/openssl) and during
# runtime, the shared library must be installed
@@ -105,6 +106,21 @@ BUILD_WITH_SYSTEM_ZLIB = os.environ.get('GRPC_PYTHON_BUILD_SYSTEM_ZLIB',
BUILD_WITH_SYSTEM_CARES = os.environ.get('GRPC_PYTHON_BUILD_SYSTEM_CARES',
False)
+# For local development use only: This skips building gRPC Core and its
+# dependencies, including protobuf and boringssl. This allows "incremental"
+# compilation by first building gRPC Core using make, then building only the
+# Python/Cython layers here.
+#
+# Note that this requires libboringssl.a in the libs/{dbg,opt}/ directory, which
+# may require configuring make to not use the system openssl implementation:
+#
+# make HAS_SYSTEM_OPENSSL_ALPN=0
+#
+# TODO(ericgribkoff) Respect the BUILD_WITH_SYSTEM_* flags alongside this option
+USE_PREBUILT_GRPC_CORE = os.environ.get(
+ 'GRPC_PYTHON_USE_PREBUILT_GRPC_CORE', False)
+
+
# If this environmental variable is set, GRPC will not try to be compatible with
# libc versions old than the one it was compiled against.
DISABLE_LIBC_COMPATIBILITY = os.environ.get('GRPC_PYTHON_DISABLE_LIBC_COMPATIBILITY', False)
@@ -249,7 +265,7 @@ def cython_extensions_and_necessity():
for name in CYTHON_EXTENSION_MODULE_NAMES]
config = os.environ.get('CONFIG', 'opt')
prefix = 'libs/' + config + '/'
- if "darwin" in sys.platform:
+ if "darwin" in sys.platform or USE_PREBUILT_GRPC_CORE:
extra_objects = [prefix + 'libares.a',
prefix + 'libboringssl.a',
prefix + 'libgpr.a',