Fix Windows CI (#9588)

Co-authored-by: Mehrdad <noreply@github.com>
This commit is contained in:
mehrdadn 2020-07-20 12:47:27 -07:00 committed by GitHub
parent 02cbd4fb7e
commit 3d0a3c47a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -178,8 +178,13 @@ def build(build_python, build_java):
"Detected: {}\n at: {!r}".format(sys.version, sys.executable))
raise OSError(msg)
bazel_env = dict(os.environ, PYTHON3_BIN_PATH=sys.executable)
if is_native_windows_or_msys():
BAZEL_SH = os.getenv("BAZEL_SH")
SHELL = bazel_env.get("SHELL")
if SHELL:
bazel_env.setdefault("BAZEL_SH", os.path.normpath(SHELL))
BAZEL_SH = bazel_env["BAZEL_SH"]
SYSTEMROOT = os.getenv("SystemRoot")
wsl_bash = os.path.join(SYSTEMROOT, "System32", "bash.exe")
if (not BAZEL_SH) and SYSTEMROOT and os.path.isfile(wsl_bash):
@ -222,7 +227,7 @@ def build(build_python, build_java):
bazel_targets += ["//java:ray_java_pkg"] if build_java else []
return subprocess.check_call(
[bazel, "build", "--verbose_failures", "--"] + bazel_targets,
env=dict(os.environ, PYTHON3_BIN_PATH=sys.executable))
env=bazel_env)
def walk_directory(directory):