Skip to content

Commit

Permalink
Fix cc_configure on Windows
Browse files Browse the repository at this point in the history
--
Change-Id: Id359bc6f442f302e3dbaa60cedd6536ecf4f92ec
Reviewed-on: https://bazel-review.googlesource.com/#/c/6333
MOS_MIGRATED_REVID=134575379
  • Loading branch information
meteorcloudy committed Sep 29, 2016
1 parent 71616b1 commit c30432c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tools/cpp/cc_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit c30432c

Please sign in to comment.