aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/launcher/launcher.h
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2018-04-30 07:53:13 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-04-30 07:57:30 -0700
commit3e50e3565b1d39a8ab82d817bca9bc2eb3ca8fc1 (patch)
treecc3f392f17e4fb59adafc133ef683f8f38e8d59b /src/tools/launcher/launcher.h
parentb083de868ff2dab43ef2fed111aa860aed0f73c8 (diff)
Make runfiles usage on Windows more flexible to support remote execution.
When trying to find a runfile on Windows: 1. First look for the runfiles MANIFEST and find runfile locations using this if it exists (current behavior). 2. If no MANIFEST file exists, look for runfiles in the runfiles directory (new behavior). As part of this, remove setting RUNFILES_MANIFEST_ONLY for the benefit of test-setup.sh. Instead of telling it what to do, it decides what to do based on the observed state of the world. Launchers still set RUNFILES_MANIFEST_ONLY for the benefit of launched programs, since some may depend on this. Fixes https://github.com/bazelbuild/bazel/issues/4962. RELNOTES: Remote execution works for Windows binaries with launchers. PiperOrigin-RevId: 194785440
Diffstat (limited to 'src/tools/launcher/launcher.h')
-rw-r--r--src/tools/launcher/launcher.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/tools/launcher/launcher.h b/src/tools/launcher/launcher.h
index 088bd5d740..4dca6e000d 100644
--- a/src/tools/launcher/launcher.h
+++ b/src/tools/launcher/launcher.h
@@ -82,9 +82,12 @@ class BinaryLauncherBase {
// A map to store all the launch information.
const LaunchDataParser::LaunchInfo& launch_info;
- // Absolute path to the runfiles manifest file.
+ // Absolute path to the runfiles manifest file, if one exists.
const std::string manifest_file;
+ // Path to the runfiles directory, if one exists.
+ const std::string runfiles_dir;
+
// The commandline arguments recieved.
// The first argument is the path of this launcher itself.
std::vector<std::string> commandline_arguments;
@@ -111,7 +114,7 @@ class BinaryLauncherBase {
void CreateCommandLine(CmdLine* result, const std::string& executable,
const std::vector<std::string>& arguments) const;
- // Find manifest file of the binary
+ // Find manifest file of the binary.
//
// Expect the manifest file to be at
// 1. <path>/<to>/<binary>/<target_name>.runfiles/MANIFEST