Skip to content

Commit f8caee4

Browse files
meteorcloudyyifeif
authored andcommitted
Fix TensorFlow Windows build (tensorflow#12603)
1 parent 1ccd885 commit f8caee4

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

configure.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def run_shell(cmd, allow_non_zero=False):
143143

144144
def cygpath(path):
145145
"""Convert path from posix to windows."""
146-
return run_shell(['cygpath', '-m', path])
146+
return os.path.abspath(path).replace('\\', '/')
147147

148148

149149
def get_python_path(environ_cp, python_bin_path):
@@ -196,7 +196,7 @@ def setup_python(environ_cp, bazel_version):
196196
environ_cp['PYTHON_BIN_PATH'] = ''
197197

198198
# Convert python path to Windows style before checking lib and version
199-
if is_cygwin():
199+
if is_windows() or is_cygwin():
200200
python_bin_path = cygpath(python_bin_path)
201201

202202
# Get PYTHON_LIB_PATH
@@ -219,7 +219,7 @@ def setup_python(environ_cp, bazel_version):
219219
python_major_version = get_python_major_version(python_bin_path)
220220

221221
# Convert python path to Windows style before writing into bazel.rc
222-
if is_cygwin():
222+
if is_windows() or is_cygwin():
223223
python_lib_path = cygpath(python_lib_path)
224224

225225
# Set-up env variables used by python_configure.bzl
@@ -600,7 +600,7 @@ def set_tf_cuda_version(environ_cp):
600600

601601
# Find out where the CUDA toolkit is installed
602602
default_cuda_path = _DEFAULT_CUDA_PATH
603-
if is_cygwin():
603+
if is_windows() or is_cygwin():
604604
default_cuda_path = cygpath(
605605
environ_cp.get('CUDA_PATH', _DEFAULT_CUDA_PATH_WIN))
606606
elif is_linux():
@@ -660,7 +660,7 @@ def set_tf_cunn_version(environ_cp):
660660
# unusable. Going through one more level of expansion to handle that.
661661
cudnn_install_path = os.path.realpath(
662662
os.path.expanduser(cudnn_install_path))
663-
if is_cygwin():
663+
if is_windows() or is_cygwin():
664664
cudnn_install_path = cygpath(cudnn_install_path)
665665

666666
if is_windows():

tensorflow/python/eager/BUILD

+5
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ cuda_py_test(
121121
"//tensorflow/python:resource_variable_ops",
122122
"//tensorflow/python:training",
123123
],
124+
tags = ["no_windows"],
124125
)
125126

126127
cuda_py_test(
@@ -152,6 +153,7 @@ cuda_py_test(
152153
"//tensorflow/python:clip_ops",
153154
"//tensorflow/python:math_ops",
154155
],
156+
tags = ["no_windows"],
155157
)
156158

157159
py_library(
@@ -354,6 +356,7 @@ py_test(
354356
name = "benchmarks_test",
355357
srcs = ["benchmarks_test.py"],
356358
srcs_version = "PY2AND3",
359+
tags = ["no_windows"],
357360
deps = [
358361
":backprop",
359362
":context",
@@ -371,6 +374,7 @@ py_test(
371374
name = "tape_test",
372375
srcs = ["tape_test.py"],
373376
srcs_version = "PY2AND3",
377+
tags = ["no_windows"],
374378
deps = [
375379
":backprop",
376380
":context",
@@ -391,6 +395,7 @@ py_test(
391395
name = "tensor_node_test",
392396
srcs = ["tensor_node_test.py"],
393397
srcs_version = "PY2AND3",
398+
tags = ["no_windows"],
394399
deps = [
395400
":tensor",
396401
":tensor_node",

0 commit comments

Comments
 (0)