diff --git a/BUILD.bazel b/BUILD.bazel index f7748fdf5d76a..df9cd6d5173c7 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -776,6 +776,7 @@ pyx_library( "python/ray/includes/*.pxd", "python/ray/includes/*.pxi", ]), + copts = COPTS, deps = [ "//:core_worker_lib", "//:raylet_lib", diff --git a/bazel/ray_deps_setup.bzl b/bazel/ray_deps_setup.bzl index a81e07db7a709..37a0a30d70aa9 100644 --- a/bazel/ray_deps_setup.bzl +++ b/bazel/ray_deps_setup.bzl @@ -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( diff --git a/thirdparty/patches/BUILD b/thirdparty/patches/BUILD new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/thirdparty/patches/grpc-cython-copts.patch b/thirdparty/patches/grpc-cython-copts.patch new file mode 100644 index 0000000000000..cdb7cffea2932 --- /dev/null +++ b/thirdparty/patches/grpc-cython-copts.patch @@ -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, + ) +--