aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Yun Peng <pcloudy@google.com>2016-09-28 20:36:26 +0000
committerGravatar Yun Peng <pcloudy@google.com>2016-09-29 09:03:55 +0000
commitc30432cc32886a2b50e2b902f7f572347a6886a4 (patch)
tree2453e51a3cfa0fd8343a51928fad5df5316bc1f6 /tools
parent71616b1549daee1eb5ec822c7bd1c744d8c58479 (diff)
Fix cc_configure on Windows
-- Change-Id: Id359bc6f442f302e3dbaa60cedd6536ecf4f92ec Reviewed-on: https://bazel-review.googlesource.com/#/c/6333 MOS_MIGRATED_REVID=134575379
Diffstat (limited to 'tools')
-rw-r--r--tools/cpp/cc_configure.bzl10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/cpp/cc_configure.bzl b/tools/cpp/cc_configure.bzl
index 235ecbff63..69daae5822 100644
--- a/tools/cpp/cc_configure.bzl
+++ b/tools/cpp/cc_configure.bzl
@@ -372,7 +372,10 @@ def _find_cc(repository_ctx):
def _find_python(repository_ctx):
"""Find where is python on Windows."""
if "BAZEL_PYTHON" in repository_ctx.os.environ:
- return repository_ctx.os.environ["BAZEL_PYTHON"]
+ python_binary = repository_ctx.os.environ["BAZEL_PYTHON"]
+ if not python_binary.endswith(".exe"):
+ python_binary = python_binary + ".exe"
+ return python_binary
auto_configure_warning("'BAZEL_PYTHON' is not set, start looking for python in PATH.")
python_binary = _which_cmd(repository_ctx, "python.exe")
auto_configure_warning("Python found at %s" % python_binary)
@@ -381,7 +384,10 @@ def _find_python(repository_ctx):
def _find_bash(repository_ctx):
"""Find where is bash on Windows."""
if "BAZEL_SH" in repository_ctx.os.environ:
- return repository_ctx.os.environ["BAZEL_SH"]
+ bash_binary = repository_ctx.os.environ["BAZEL_SH"]
+ if not bash_binary.endswith(".exe"):
+ bash_binary = bash_binary + ".exe"
+ return bash_binary
auto_configure_warning("'BAZEL_SH' is not set, start looking for bash in PATH.")
bash_binary = _which_cmd(repository_ctx, "bash.exe")
auto_configure_warning("Bash binary found at %s" % bash_binary)