Windows: fail gracefully when undname.exe is not found (#19600)
authorYun Peng <pcloudy@google.com>
Tue, 29 May 2018 03:04:59 +0000 (05:04 +0200)
committerGunhan Gulsoy <gunan@google.com>
Tue, 29 May 2018 03:04:59 +0000 (20:04 -0700)
* Windows: fail gracefully when undname.exe is not found

* Edit error message.

tensorflow/tools/def_file_filter/def_file_filter_configure.bzl

index 47539b2..f8f63e2 100644 (file)
@@ -31,7 +31,11 @@ def _def_file_filter_configure_impl(repository_ctx):
   vc_path = find_vc_path(repository_ctx)
   if vc_path == "visual-studio-not-found":
     auto_configure_fail("Visual C++ build tools not found on your machine")
-  undname_bin_path = find_msvc_tool(repository_ctx, vc_path, "undname.exe").replace("\\", "\\\\")
+
+  undname = find_msvc_tool(repository_ctx, vc_path, "undname.exe")
+  if undname == None:
+    auto_configure_fail("Couldn't find undname.exe under %s, please check your VC installation and set BAZEL_VC environment variable correctly." % vc_path)
+  undname_bin_path = undname.replace("\\", "\\\\")
 
   repository_ctx.template(
     "def_file_filter.py",