Patch Cython in grpc to use our COPTS (#6223)

This commit is contained in:
mehrdadn
2019-11-21 15:32:48 -08:00
committed by Philipp Moritz
parent 57e101e648
commit ba86c75c21
4 changed files with 34 additions and 0 deletions
+1
View File
@@ -776,6 +776,7 @@ pyx_library(
"python/ray/includes/*.pxd",
"python/ray/includes/*.pxi",
]),
copts = COPTS,
deps = [
"//:core_worker_lib",
"//:raylet_lib",
+3
View File
@@ -118,6 +118,9 @@ def ray_deps_setup():
commit = "93e8830070e9afcbaa992c75817009ee3f4b63a0",
remote = "https://github.com/grpc/grpc.git",
shallow_since = "1571118670 -0700",
patches = [
"//thirdparty/patches:grpc-cython-copts.patch",
],
)
git_repository(
View File
+30
View File
@@ -0,0 +1,30 @@
diff --git bazel/cython_library.bzl bazel/cython_library.bzl
index 48b41d74e8..6084734f59 100644
--- bazel/cython_library.bzl
+++ bazel/cython_library.bzl
@@ -7,7 +7,7 @@
# been written at cython/cython and tensorflow/tensorflow. We branch from
# Tensorflow's version as it is more actively maintained and works for gRPC
# Python's needs.
-def pyx_library(name, deps=[], py_deps=[], srcs=[], **kwargs):
+def pyx_library(name, deps=[], copts=[], py_deps=[], srcs=[], **kwargs):
"""Compiles a group of .pyx / .pxd / .py files.
First runs Cython to create .cpp files for each input .pyx or .py + .pxd
@@ -19,6 +19,7 @@ def pyx_library(name, deps=[], py_deps=[], srcs=[], **kwargs):
Args:
name: Name for the rule.
deps: C/C++ dependencies of the Cython (e.g. Numpy headers).
+ copts: C/C++ compiler options for Cython
py_deps: Pure Python dependencies of the final library.
srcs: .py, .pyx, or .pxd files to either compile or pass through.
**kwargs: Extra keyword arguments passed to the py_library.
@@ -58,6 +59,7 @@ def pyx_library(name, deps=[], py_deps=[], srcs=[], **kwargs):
native.cc_binary(
name=shared_object_name,
srcs=[stem + ".cpp"],
+ copts=copts,
deps=deps + ["@local_config_python//:python_headers"],
linkshared=1,
)
--