@@ -143,7 +143,7 @@ def run_shell(cmd, allow_non_zero=False):
143
143
144
144
def cygpath (path ):
145
145
"""Convert path from posix to windows."""
146
- return run_shell ([ 'cygpath ' , '-m' , path ] )
146
+ return os . path . abspath ( path ). replace ( ' \\ ' , '/' )
147
147
148
148
149
149
def get_python_path (environ_cp , python_bin_path ):
@@ -196,7 +196,7 @@ def setup_python(environ_cp, bazel_version):
196
196
environ_cp ['PYTHON_BIN_PATH' ] = ''
197
197
198
198
# Convert python path to Windows style before checking lib and version
199
- if is_cygwin ():
199
+ if is_windows () or is_cygwin ():
200
200
python_bin_path = cygpath (python_bin_path )
201
201
202
202
# Get PYTHON_LIB_PATH
@@ -219,7 +219,7 @@ def setup_python(environ_cp, bazel_version):
219
219
python_major_version = get_python_major_version (python_bin_path )
220
220
221
221
# Convert python path to Windows style before writing into bazel.rc
222
- if is_cygwin ():
222
+ if is_windows () or is_cygwin ():
223
223
python_lib_path = cygpath (python_lib_path )
224
224
225
225
# Set-up env variables used by python_configure.bzl
@@ -600,7 +600,7 @@ def set_tf_cuda_version(environ_cp):
600
600
601
601
# Find out where the CUDA toolkit is installed
602
602
default_cuda_path = _DEFAULT_CUDA_PATH
603
- if is_cygwin ():
603
+ if is_windows () or is_cygwin ():
604
604
default_cuda_path = cygpath (
605
605
environ_cp .get ('CUDA_PATH' , _DEFAULT_CUDA_PATH_WIN ))
606
606
elif is_linux ():
@@ -660,7 +660,7 @@ def set_tf_cunn_version(environ_cp):
660
660
# unusable. Going through one more level of expansion to handle that.
661
661
cudnn_install_path = os .path .realpath (
662
662
os .path .expanduser (cudnn_install_path ))
663
- if is_cygwin ():
663
+ if is_windows () or is_cygwin ():
664
664
cudnn_install_path = cygpath (cudnn_install_path )
665
665
666
666
if is_windows ():
0 commit comments