Building grpcio-python without recompiling core files

126 views
Skip to first unread message

aa...@dropbox.com

unread,
Apr 18, 2018, 2:39:01 PM4/18/18
to grpc.io
I was wondering if it was reasonable to have a env variable that affected the `CORE_C_FILES` that is passed into Extension in setup.py (basically something like SKIP_COMPILING_CORE). I’d like to build grpcio python from source and link against grpc_core compiled separately.  My understanding of disttools is that when we pass in the gprc_core files as srcs (https://github.com/grpc/grpc/blob/master/setup.py#L220), it will compile and prefer to link those, even if we make the precompiled libraries available on library search path.

Right now I’ve accomplished this just by editing the setup.py locally. I think it might be useful for upstream/others as well as this allows me to build grpc python with :grpc as a dependency that handles compiling core, rather then recompiling it when building wheel using python setup.py build_ext. Unfortunately I’m using some in-house bazel rules to expose a bazel built grpcio-python that aren’t open source..

Mehrdad Afshari

unread,
Apr 21, 2018, 12:24:34 PM4/21/18
to grpc.io
We would love to at some point be able to build gRPC Python properly with Bazel. Last time I checked the blocker seemed to be lack of Cython support, so if you could send us a PR for to build with Bazel, we would love that! Barring that, if there's a sensible step to make the Python setup.py more adaptable to a precompiled gRPC Core, please send us a PR for that too so we can look at the change. We'll happily try to upstream if it makes sense. Thanks!
Reply all
Reply to author
Forward
0 new messages