Merge pull request #50553 from PatriceVignola:fix-configure-bazelisk-windows

PiperOrigin-RevId: 384706651
Change-Id: I6c0f4cb25047a127648aa89e8bb82251054f9769
This commit is contained in:
TensorFlower Gardener
2021-07-14 08:56:54 -07:00

View File

@@ -479,12 +479,13 @@ def check_bazel_version(min_version, max_version):
Returns:
The bazel version detected.
"""
if which('bazel') is None:
bazel_executable = which('bazel')
if bazel_executable is None:
print('Cannot find bazel. Please install bazel.')
sys.exit(1)
stderr = open(os.devnull, 'wb')
curr_version = run_shell(['bazel', '--version'],
curr_version = run_shell([bazel_executable, '--version'],
allow_non_zero=True,
stderr=stderr)
if curr_version.startswith('bazel '):
@@ -849,7 +850,8 @@ def set_gcc_host_compiler_path(environ_cp):
environ_cp,
var_name='GCC_HOST_COMPILER_PATH',
var_default=default_gcc_host_compiler_path,
ask_for_var='Please specify which gcc should be used by nvcc as the host compiler.',
ask_for_var='Please specify which gcc should be used by nvcc as the host '
'compiler.',
check_success=os.path.exists,
resolve_symlinks=True,
error_msg='Invalid gcc path. %s cannot be found.',