From c30432cc32886a2b50e2b902f7f572347a6886a4 Mon Sep 17 00:00:00 2001 From: Yun Peng Date: Wed, 28 Sep 2016 20:36:26 +0000 Subject: Fix cc_configure on Windows -- Change-Id: Id359bc6f442f302e3dbaa60cedd6536ecf4f92ec Reviewed-on: https://bazel-review.googlesource.com/#/c/6333 MOS_MIGRATED_REVID=134575379 --- tools/cpp/cc_configure.bzl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tools/cpp/cc_configure.bzl') 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) -- cgit v1.2.3