Skip to content

Commit 0a48527

Browse files
committed
[cpp] add explicit files for deps
and make `ray_cpp_pkg` private visibility Signed-off-by: Lonnie Liu <[email protected]>
1 parent 807e371 commit 0a48527

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

cpp/BUILD.bazel

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Bazel build
22
# C/C++ documentation: https://docs.bazel.build/versions/master/be/c-cpp.html
33

4+
load("//bazel:python.bzl", "py_test_module_list")
45
load("//bazel:ray.bzl", "COPTS")
56

67
cc_binary(
@@ -56,12 +57,12 @@ cc_library(
5657
strip_include_prefix = "include",
5758
visibility = ["//visibility:public"],
5859
deps = [
59-
"//src/ray/gcs/gcs_client:global_state_accessor_lib",
6060
"//:ray_common",
6161
"//src/ray/core_worker:core_worker_lib",
62+
"//src/ray/gcs/gcs_client:global_state_accessor_lib",
6263
"//src/ray/util",
63-
"//src/ray/util:process",
6464
"//src/ray/util:cmd_line_utils",
65+
"//src/ray/util:process",
6566
"@boost//:callable_traits",
6667
"@boost//:dll",
6768
"@com_google_absl//absl/flags:flag",
@@ -109,6 +110,15 @@ cc_binary(
109110
}),
110111
)
111112

113+
filegroup(
114+
name = "ray_cpp_pkg_files",
115+
srcs = [
116+
"default_worker",
117+
"libray_api.so",
118+
],
119+
visibility = ["//visibility:private"],
120+
)
121+
112122
genrule(
113123
name = "ray_cpp_pkg",
114124
srcs = [
@@ -163,7 +173,7 @@ genrule(
163173
echo "$$WORK_DIR" > $@
164174
""",
165175
local = 1,
166-
visibility = ["//visibility:public"],
176+
visibility = ["//visibility:private"],
167177
)
168178

169179
# test
@@ -200,8 +210,8 @@ cc_test(
200210
data = [
201211
"counter.so",
202212
"plus.so",
203-
"ray_cpp_pkg",
204213
"src/ray/test/cluster/test_cross_language_invocation.py",
214+
":ray_cpp_pkg_files",
205215
],
206216
linkstatic = True,
207217
tags = ["team:core"],
@@ -223,7 +233,7 @@ cc_test(
223233
],
224234
copts = COPTS,
225235
data = [
226-
"ray_cpp_pkg",
236+
":ray_cpp_pkg_files",
227237
"//java:libio_ray_ray_test.jar",
228238
],
229239
linkstatic = True,
@@ -392,8 +402,6 @@ cc_binary(
392402
],
393403
)
394404

395-
load("//bazel:python.bzl", "py_test_module_list")
396-
397405
py_test_module_list(
398406
size = "medium",
399407
extra_srcs = [],

python/setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,8 @@ def build(build_python, build_java, build_cpp):
528528
)
529529
raise OSError(msg)
530530

531-
bazel_env = dict(os.environ, PYTHON3_BIN_PATH=sys.executable)
531+
bazel_env = dict(os.environ)
532+
bazel_env["PYTHON3_BIN_PATH"] = sys.executable
532533

533534
if is_native_windows_or_msys():
534535
SHELL = bazel_env.get("SHELL")

0 commit comments

Comments
 (0)