forked from ray-project/ray
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "[Core] Update grpc to 1.44.0 (ray-project#22384)" (ray-projec…
- Loading branch information
Showing
3 changed files
with
88 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
From 30bd860bd8a8bb223f3aab86afc2ed28c5bd5a7d Mon Sep 17 00:00:00 2001 | ||
From: acxz <[email protected]> | ||
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 | ||
@@ -206,7 +206,7 @@ def _get_python_lib(repository_ctx, python_bin, lib_path_key): | ||
@@ -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): | ||
" paths.append(path)\n" + "if len(paths) >=1:\n" + | ||
" print(paths[0])\n" + "END" | ||
) | ||
|
@@ -20,3 +19,45 @@ index 4e5218118ee5..7ec4459d6109 100644 | |
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") | ||
|
||
-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
diff --git third_party/py/python_configure.bzl third_party/py/python_configure.bzl | ||
--- third_party/py/python_configure.bzl | ||
+++ third_party/py/python_configure.bzl | ||
@@ -199,8 +199,8 @@ def _get_python_lib(repository_ctx, python_bin, lib_path_key): | ||
" python_paths = os.getenv('PYTHONPATH').split(':')\n" + "try:\n" + | ||
" library_paths = site.getsitepackages()\n" + | ||
"except AttributeError:\n" + | ||
- " from distutils.sysconfig import get_python_lib\n" + | ||
- " library_paths = [get_python_lib()]\n" + | ||
+ " import sysconfig\n" + | ||
+ " library_paths = [sysconfig.get_path('purelib')]\n" + | ||
"all_paths = set(python_paths + library_paths)\n" + "paths = []\n" + | ||
"for path in all_paths:\n" + " if os.path.isdir(path):\n" + | ||
" paths.append(path)\n" + "if len(paths) >=1:\n" + | ||
@@ -237,14 +237,13 @@ def _get_python_include(repository_ctx, python_bin): | ||
python_bin, | ||
"-c", | ||
"from __future__ import print_function;" + | ||
- "from distutils import sysconfig;" + | ||
- "print(sysconfig.get_python_inc())", | ||
+ "import sysconfig;" + | ||
+ "print(sysconfig.get_path('include'))", | ||
], | ||
error_msg = "Problem getting python include path for {}.".format(python_bin), | ||
error_details = ( | ||
"Is the Python binary path set up right? " + "(See ./configure or " + | ||
- python_bin + ".) " + "Is distutils installed? " + | ||
- _HEADERS_HELP | ||
+ python_bin + ".) " + _HEADERS_HELP | ||
), | ||
) | ||
include_path = result.stdout.splitlines()[0] |