diff options
author | Googler <noreply@google.com> | 2018-05-07 09:46:46 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-05-07 09:48:19 -0700 |
commit | 0b7f9f8a7be0fbfe84baf8e4d1dc652f81e20073 (patch) | |
tree | 0ae6da41d10ad3cf838d576522ce1834a076b089 /src/tools | |
parent | b5573a6df78527be0bb15da54df03f9981e1302d (diff) |
Add absolute path handling to Rlocation implementation used for remote execution on Windows from Java launcher.
Previously the test case would fail because it tried to run a path like this:
C:/temp/build-1dad9dd4-ee96-40c5-b551-c8ae12461e45/bazel-out/x64_windows-fastbuild/bin/foo/foo_test.exe.runfiles/C:/openjdk/bin/java.exe
Passing presubmit: https://buildkite.com/bazel/google-bazel-presubmit/builds/2558#b83dbc25-d9ad-4d49-8f78-cde9d6810741
RELNOTES: N/A
PiperOrigin-RevId: 195675424
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/launcher/BUILD | 1 | ||||
-rw-r--r-- | src/tools/launcher/launcher.cc | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/tools/launcher/BUILD b/src/tools/launcher/BUILD index 14d420d909..37b0e4dddc 100644 --- a/src/tools/launcher/BUILD +++ b/src/tools/launcher/BUILD @@ -28,6 +28,7 @@ cc_library( srcs = ["launcher.cc"], hdrs = ["launcher.h"], deps = [ + "//src/main/cpp/util:file", "//src/tools/launcher/util", "//src/tools/launcher/util:data_parser", ], diff --git a/src/tools/launcher/launcher.cc b/src/tools/launcher/launcher.cc index 515733814f..ea58e2cb75 100644 --- a/src/tools/launcher/launcher.cc +++ b/src/tools/launcher/launcher.cc @@ -20,6 +20,7 @@ #include <string> #include <vector> +#include "src/main/cpp/util/file_platform.h" #include "src/tools/launcher/launcher.h" #include "src/tools/launcher/util/data_parser.h" #include "src/tools/launcher/util/launcher_util.h" @@ -138,6 +139,10 @@ string BinaryLauncherBase::Rlocation(const string& path, // If the manifest file map is empty, then we're using the runfiles directory // instead. if (manifest_file_map.empty()) { + if (blaze_util::IsAbsolute(path)) { + return path; + } + string query_path = runfiles_dir; if (need_workspace_name) { query_path += "/" + this->workspace_name; |