diff options
author | 2016-11-07 16:59:19 +0000 | |
---|---|---|
committer | 2016-11-08 09:13:53 +0000 | |
commit | 51e4817848eabe85529118a0188ffc30d0bbc6e5 (patch) | |
tree | 72b9c355b17f13188054cbbdde9bcfee08e371da | |
parent | a02eb27e502eab9069c8b17e2bc91743f1260d49 (diff) |
msvc_tool.py: Don't replace \ with \\ in NormPath
No need to use double back slash.
This could help ease the Windows long path issue.
Please see https://github.com/tensorflow/tensorflow/pull/5385
--
Change-Id: Iecca529209499062bfc1351e3a2b46dc51e0be09
Reviewed-on: https://bazel-review.googlesource.com/#/c/7210
MOS_MIGRATED_REVID=138397390
-rw-r--r-- | tools/cpp/wrapper/bin/pydir/msvc_tools.py.tpl | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/tools/cpp/wrapper/bin/pydir/msvc_tools.py.tpl b/tools/cpp/wrapper/bin/pydir/msvc_tools.py.tpl index 813b07d6cf..76df837ac6 100644 --- a/tools/cpp/wrapper/bin/pydir/msvc_tools.py.tpl +++ b/tools/cpp/wrapper/bin/pydir/msvc_tools.py.tpl @@ -295,18 +295,13 @@ class WindowsRunner(object): Error: if path is too long """ abspath = os.path.abspath(path) - long_path = abspath.replace('\\', '\\\\') # We must allow for the drive letter as well, which is three characters, and # the length of any compiler option ahead of the path, - if len(long_path) + MAX_DRIVE_LENGTH + MAX_OPTION_LENGTH < MAX_PATH: - return long_path - else: - # TODO(pcloudy): - # This still doesn't solve all the problems, because the compiler - # doesn't seem to support long path. - return "\\\\?\\" + long_path - return None + if len(abspath) + MAX_DRIVE_LENGTH + MAX_OPTION_LENGTH > MAX_PATH: + print('Warning: path "' + abspath + '" is > than 260 characters (' + + str(len(abspath)) + '); programs may crash with long arguments') + return abspath def SetupEnvironment(self): """Setup proper path for running. |