From dc91adea890ca9aecc5f349b373b53e7bcd63e3b Mon Sep 17 00:00:00 2001 From: Yun Peng Date: Wed, 22 May 2019 14:20:04 +0200 Subject: [PATCH] Windows, launcher: support python/bash toolchain Fixes https://github.com/bazelbuild/bazel/issues/7947 --- src/tools/launcher/bash_launcher.cc | 3 +++ src/tools/launcher/python_launcher.cc | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/tools/launcher/bash_launcher.cc b/src/tools/launcher/bash_launcher.cc index 0020d5f92d55d3..ee259996f88d3a 100644 --- a/src/tools/launcher/bash_launcher.cc +++ b/src/tools/launcher/bash_launcher.cc @@ -30,6 +30,9 @@ static constexpr const char* BASH_BIN_PATH = "bash_bin_path"; ExitCode BashBinaryLauncher::Launch() { wstring bash_binary = this->GetLaunchInfoByKey(BASH_BIN_PATH); + + bash_binary = this->Rlocation(bash_binary, true); + if (DoesFilePathExist(bash_binary.c_str())) { wstring bash_bin_dir = GetParentDirFromPath(bash_binary); wstring path_env; diff --git a/src/tools/launcher/python_launcher.cc b/src/tools/launcher/python_launcher.cc index c4d2d5c04670fd..cab80104db986c 100644 --- a/src/tools/launcher/python_launcher.cc +++ b/src/tools/launcher/python_launcher.cc @@ -30,6 +30,9 @@ static constexpr const char* WINDOWS_STYLE_ESCAPE_JVM_FLAGS = "escape_args"; ExitCode PythonBinaryLauncher::Launch() { wstring python_binary = this->GetLaunchInfoByKey(PYTHON_BIN_PATH); + + python_binary = this->Rlocation(python_binary, true); + // If specified python binary path doesn't exist, then fall back to // python.exe and hope it's in PATH. if (!DoesFilePathExist(python_binary.c_str())) {