Skip to content

Commit

Permalink
[Core] Update grpc to 1.44.0 (ray-project#22384)
Browse files Browse the repository at this point in the history
Updates grpc to 1.44.0 to remove local patch needed for grpc to build.

EDIT: there have been changes to how python is found (mostly removing python2 support) and as such the local python-patch we have for grpc needs to be modified.

This time contributing it to upstream (grpc/grpc#28895) so that it'll get added in a newer version!

For anyone that comes across this:
Here is the error itself for why we need the grpc-python.patch file: https://buildkite.com/ray-project/ray-builders-pr/builds/24659#d293616f-225d-41f9-8de2-03780f12b13f/2386-2416
  • Loading branch information
acxz authored Mar 7, 2022
1 parent 549466a commit 5ebc32d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 88 deletions.
6 changes: 2 additions & 4 deletions bazel/ray_deps_setup.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,11 @@ def ray_deps_setup():
auto_http_archive(
name = "com_github_grpc_grpc",
# NOTE: If you update this, also update @boringssl's hash.
url = "https://github.com/grpc/grpc/archive/refs/tags/v1.43.2.tar.gz",
sha256 = "b74ce7d26fe187970d1d8e2c06a5d3391122f7bc1fdce569aff5e435fb8fe780",
url = "https://github.com/grpc/grpc/archive/refs/tags/v1.44.0.tar.gz",
sha256 = "8c05641b9f91cbc92f51cc4a5b3a226788d7a63f20af4ca7aaca50d92cc94a0d",
patches = [
"@com_github_ray_project_ray//thirdparty/patches:grpc-cython-copts.patch",
"@com_github_ray_project_ray//thirdparty/patches:grpc-python.patch",
# Delete after upgrading from 1.44.0
"@com_github_ray_project_ray//thirdparty/patches:grpc-remove-distutils.patch",
],
)

Expand Down
63 changes: 11 additions & 52 deletions thirdparty/patches/grpc-python.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
From 30bd860bd8a8bb223f3aab86afc2ed28c5bd5a7d Mon Sep 17 00:00:00 2001
From: acxz <17132214+acxz@users.noreply.github.com>
Date: Thu, 17 Feb 2022 11:07:42 -0500
Subject: [PATCH] fix python command on windows

---
third_party/py/python_configure.bzl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git third_party/py/python_configure.bzl third_party/py/python_configure.bzl
index 4e5218118ee5..7ec4459d6109 100644
--- third_party/py/python_configure.bzl
+++ third_party/py/python_configure.bzl
@@ -177,7 +177,7 @@ def _get_bash_bin(repository_ctx):
if bash_bin != None:
return bash_bin
else:
- bash_bin_path = repository_ctx.which("bash")
+ bash_bin_path = repository_ctx.which("bash" if not _is_windows(repository_ctx) else "sh.exe")
if bash_bin_path != None:
return str(bash_bin_path)
else:
@@ -208,7 +208,7 @@ def _get_python_lib(repository_ctx, python_bin, lib_path_key):
@@ -206,7 +206,7 @@ def _get_python_lib(repository_ctx, python_bin, lib_path_key):
" paths.append(path)\n" + "if len(paths) >=1:\n" +
" print(paths[0])\n" + "END"
)
Expand All @@ -19,45 +20,3 @@ diff --git third_party/py/python_configure.bzl third_party/py/python_configure.b
result = repository_ctx.execute([_get_bash_bin(repository_ctx), "-c", cmd])
return result.stdout.strip("\n")

@@ -293,11 +293,13 @@ def _create_single_version_package(

python_bin = _get_python_bin(repository_ctx, bin_path_key, default_bin_path, allow_absent)
if (python_bin == None or
- _check_python_bin(repository_ctx,
- python_bin,
- bin_path_key,
- allow_absent) == None) and allow_absent:
- python_include_rule = empty_include_rule
+ _check_python_bin(
+ repository_ctx,
+ python_bin,
+ bin_path_key,
+ allow_absent,
+ ) == None) and allow_absent:
+ python_include_rule = empty_include_rule
else:
python_lib = _get_python_lib(repository_ctx, python_bin, lib_path_key)
_check_python_lib(repository_ctx, python_lib)
@@ -348,17 +350,17 @@ def _python_autoconf_impl(repository_ctx):
repository_ctx,
"_python2",
_PYTHON2_BIN_PATH,
- "python2",
+ "python" if not _is_windows(repository_ctx) else "python.exe",
_PYTHON2_LIB_PATH,
- True
+ True,
)
_create_single_version_package(
repository_ctx,
"_python3",
_PYTHON3_BIN_PATH,
- "python3",
+ "python3" if not _is_windows(repository_ctx) else "python.exe",
_PYTHON3_LIB_PATH,
- False
+ False,
)
_tpl(repository_ctx, "BUILD")

--
32 changes: 0 additions & 32 deletions thirdparty/patches/grpc-remove-distutils.patch

This file was deleted.

0 comments on commit 5ebc32d

Please sign in to comment.