Skip to content

[cpp] add explicit files for deps #54311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions cpp/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Bazel build
# C/C++ documentation: https://docs.bazel.build/versions/master/be/c-cpp.html

load("//bazel:python.bzl", "py_test_module_list")
load("//bazel:ray.bzl", "COPTS")

cc_binary(
Expand Down Expand Up @@ -56,12 +57,12 @@ cc_library(
strip_include_prefix = "include",
visibility = ["//visibility:public"],
deps = [
"//src/ray/gcs/gcs_client:global_state_accessor_lib",
"//:ray_common",
"//src/ray/core_worker:core_worker_lib",
"//src/ray/gcs/gcs_client:global_state_accessor_lib",
"//src/ray/util",
"//src/ray/util:process",
"//src/ray/util:cmd_line_utils",
"//src/ray/util:process",
"@boost//:callable_traits",
"@boost//:dll",
"@com_google_absl//absl/flags:flag",
Expand Down Expand Up @@ -109,6 +110,15 @@ cc_binary(
}),
)

filegroup(
Copy link
Preview

Copilot AI Jul 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] You may want to include the ray_cpp_pkg genrule output (ray_cpp_pkg.out) in the ray_cpp_pkg_files filegroup so that any downstream dependencies needing the manifest have access to it.

Copilot uses AI. Check for mistakes.

name = "ray_cpp_pkg_files",
srcs = [
"default_worker",
"libray_api.so",
],
visibility = ["//visibility:private"],
)

genrule(
name = "ray_cpp_pkg",
srcs = [
Expand Down Expand Up @@ -163,7 +173,7 @@ genrule(
echo "$$WORK_DIR" > $@
""",
local = 1,
visibility = ["//visibility:public"],
visibility = ["//visibility:private"],
)

# test
Expand Down Expand Up @@ -200,8 +210,8 @@ cc_test(
data = [
"counter.so",
"plus.so",
"ray_cpp_pkg",
"src/ray/test/cluster/test_cross_language_invocation.py",
":ray_cpp_pkg_files",
],
linkstatic = True,
tags = ["team:core"],
Expand All @@ -223,7 +233,7 @@ cc_test(
],
copts = COPTS,
data = [
"ray_cpp_pkg",
":ray_cpp_pkg_files",
"//java:libio_ray_ray_test.jar",
],
linkstatic = True,
Expand Down Expand Up @@ -392,8 +402,6 @@ cc_binary(
],
)

load("//bazel:python.bzl", "py_test_module_list")

py_test_module_list(
size = "medium",
extra_srcs = [],
Expand Down
3 changes: 2 additions & 1 deletion python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,8 @@ def build(build_python, build_java, build_cpp):
)
raise OSError(msg)

bazel_env = dict(os.environ, PYTHON3_BIN_PATH=sys.executable)
bazel_env = os.environ.copy()
bazel_env["PYTHON3_BIN_PATH"] = sys.executable

if is_native_windows_or_msys():
SHELL = bazel_env.get("SHELL")
Expand Down