Skip to content

Commit

Permalink
Bazel client: use PathAsJvmFlag for JVM flags
Browse files Browse the repository at this point in the history
The Windows-implementation of this function
shortens paths that we pass to the JVM, such as
the Bazel server jar's path, the log file path,
etc. These must be shortened because the JVM
doesn't handle long paths.

We don't shorten paths passed to the Bazel server
itself though because Bazel can handle long paths.

See #2107

--
PiperOrigin-RevId: 149548361
MOS_MIGRATED_REVID=149548361
  • Loading branch information
laszlocsomor authored and vladmos committed Mar 9, 2017
1 parent 0aaa6dd commit 4875b25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main/cpp/blaze.cc
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ static vector<string> GetArgumentArray() {

result.push_back("-XX:+HeapDumpOnOutOfMemoryError");
string heap_crash_path = globals->options->output_base;
result.push_back("-XX:HeapDumpPath=" + ConvertPath(heap_crash_path));
result.push_back("-XX:HeapDumpPath=" + blaze::PathAsJvmFlag(heap_crash_path));

result.push_back("-Xverify:none");

Expand Down Expand Up @@ -382,7 +382,7 @@ static vector<string> GetArgumentArray() {
java_library_path += blaze::ListSeparator();
}
first = false;
java_library_path += blaze::ConvertPath(
java_library_path += blaze::PathAsJvmFlag(
blaze_util::JoinPath(real_install_dir, blaze_util::Dirname(it)));
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/cpp/startup_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,8 @@ void StartupOptions::AddJVMArgumentSuffix(const string &real_install_dir,
const string &jar_path,
std::vector<string> *result) const {
result->push_back("-jar");
result->push_back(blaze::ConvertPath(
blaze_util::JoinPath(real_install_dir, jar_path)));
result->push_back(
blaze::PathAsJvmFlag(blaze_util::JoinPath(real_install_dir, jar_path)));
}

blaze_exit_code::ExitCode StartupOptions::AddJVMArguments(
Expand Down

0 comments on commit 4875b25

Please sign in to comment.