-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
[Bazel] Build error from source #14117
Comments
Looks like the problem stems from bazelbuild/bazel#12887 |
The fix sounds quite simple. Can you try that out and see if the issue is resolved in your local branch? |
I gave it a shot, but I think it is a bit more complicated than at first glance (or maybe I'm just not able to read the error messages properly). I think I made some progress by upgrading Line 248 in 019d84a
|
From bazelbuild/bazel#12887 (comment): diff --git a/bazel/ray_deps_build_all.bzl b/bazel/ray_deps_build_all.bzl
index a81480664..5cc79aec7 100644
--- a/bazel/ray_deps_build_all.bzl
+++ b/bazel/ray_deps_build_all.bzl
@@ -6,6 +6,7 @@ load("@com_github_jupp0r_prometheus_cpp//bazel:repositories.bzl", "prometheus_cp
load("@com_github_grpc_grpc//third_party/py:python_configure.bzl", "python_configure")
load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
load("@rules_proto_grpc//:repositories.bzl", "rules_proto_grpc_toolchains")
+load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains")
def ray_deps_build_all():
@@ -17,3 +18,5 @@ def ray_deps_build_all():
python_configure(name = "local_config_python")
grpc_deps()
rules_proto_grpc_toolchains()
+ rules_proto_dependencies()
+ rules_proto_toolchains()
\ No newline at end of file
diff --git a/bazel/ray_deps_setup.bzl b/bazel/ray_deps_setup.bzl
index c398dd15d..20b6bbda5 100644
--- a/bazel/ray_deps_setup.bzl
+++ b/bazel/ray_deps_setup.bzl
@@ -265,3 +265,10 @@ def ray_deps_setup():
urls = ["https://github.com/census-instrumentation/opencensus-proto/archive/v0.3.0.tar.gz"],
sha256 = "b7e13f0b4259e80c3070b583c2f39e53153085a6918718b1c710caf7037572b0",
)
+
+ auto_http_archive(
+ name = "rules_proto",
+ sha256 = "d8992e6eeec276d49f1d4e63cfa05bbed6d4a26cfe6ca63c972827a0d141ea3b",
+ strip_prefix = "rules_proto-cfdc2fa31879c0aebe31ce7702b1a9c8a4be02d2",
+ url = "https://github.com/bazelbuild/rules_proto/archive/cfdc2fa31879c0aebe31ce7702b1a9c8a4be02d2.tar.gz",
+ )
\ No newline at end of file
diff --git a/python/setup.py b/python/setup.py
index 62c516e9c..b46d9749c 100644
--- a/python/setup.py
+++ b/python/setup.py
@@ -28,7 +28,7 @@ logger = logging.getLogger(__name__)
# manually.
SUPPORTED_PYTHONS = [(3, 6), (3, 7), (3, 8)]
-SUPPORTED_BAZEL = (3, 2, 0)
+SUPPORTED_BAZEL = (4, 0, 0)
ROOT_DIR = os.path.dirname(__file__)
BUILD_JAVA = os.getenv("RAY_INSTALL_JAVA") == "1" ... should do it. Verified working build+tests w/ bazel 4.0.0 on macOS 11.2.2, ray at ea7d4c6. @rkooo567 Is this something you'd be open to a PR on? |
So did the PR for the above fix, but the CI build fails for other protobuf-version related reasons. I dont know enough about ray build chain to make the right changes in the build to make it work. It build completely fine locally for me with EDIT: RAY_INSTALL_JAVA=1 will build the java dependencies also, can reproduce the error using this (and fix it by bumping protobuf to |
From bazelbuild/bazel#12887 (comment) and bazelbuild/bazel#12887 (comment), update protobuf to latest version also works (built with @acxz 's py39 branch merged): diff --git a/bazel/ray_deps_setup.bzl b/bazel/ray_deps_setup.bzl
index fcef5edee..df099a67a 100644
--- a/bazel/ray_deps_setup.bzl
+++ b/bazel/ray_deps_setup.bzl
@@ -243,6 +243,12 @@ def ray_deps_setup():
sha256 = "781fa39693ec2984c71213cd633e9f6589eaaed75e3a9ac413237edec96fd3b9",
)
+ http_archive(
+ name = "com_google_protobuf",
+ strip_prefix = "protobuf-3.15.6",
+ urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.15.6.tar.gz"],
+ )
+
auto_http_archive(
name = "rules_proto_grpc",
url = "https://github.com/rules-proto-grpc/rules_proto_grpc/archive/a74fef39c5fe636580083545f76d1eab74f6450d.tar.gz", |
What is the problem?
Have the following build error when building from source using bazel 4.0.
Ray version and other system information (Python version, TensorFlow version, OS):
Bazel: 4.0
Reproduction (REQUIRED)
N/A
Please provide a short code snippet (less than 50 lines if possible) that can be copy-pasted to reproduce the issue. The snippet should have no external library dependencies (i.e., use fake or mock data / environments):
If the code snippet cannot be run by itself, the issue will be closed with "needs-repro-script".
The text was updated successfully, but these errors were encountered: