Skip to content

Commit

Permalink
Launcher exports RUNFILES paths with fwd slashes
Browse files Browse the repository at this point in the history
  • Loading branch information
laszlocsomor committed Mar 28, 2019
1 parent 797bacc commit d2649fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/test/py/bazel/launcher_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def _buildJavaTargets(self, bazel_bin, binary_suffix):
self.assertEqual(stdout[0], 'hello java')
if self.IsWindows():
self.assertRegexpMatches(
stdout[1], r'java_runfiles=.*foo\\foo%s.runfiles' % binary_suffix)
stdout[1], r'java_runfiles=.*foo/foo%s.runfiles' % binary_suffix)
self.assertEqual(stdout[2], 'runfiles_manifest_only=1')
self.assertRegexpMatches(
stdout[3], r'^runfiles_manifest_file=[a-zA-Z]:[/\\].*MANIFEST$')
Expand Down
4 changes: 3 additions & 1 deletion src/tools/launcher/launcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,11 @@ ExitCode BinaryLauncherBase::LaunchProcess(const wstring& executable,
if (!manifest_exists && i.first == "RUNFILES_MANIFEST_FILE") {
manifest_exists = true;
}
string winpath = i.second;
std::replace(winpath.begin(), winpath.end(), '\\', '/');
SetEnv(
blaze_util::CstringToWstring(i.first.c_str()).get(),
blaze_util::CstringToWstring(i.second.c_str()).get());
blaze_util::CstringToWstring(winpath.c_str()).get());
}
// As of 2019-03-27 the list doesn't contain RUNFILES_MANIFEST_ONLY, so we set
// it manually.
Expand Down

0 comments on commit d2649fa

Please sign in to comment.