Skip to content

Commit

Permalink
Stop hardcoding -Xverify:none in SpawnAction
Browse files Browse the repository at this point in the history
The motivation was to improve startup performance of host tools that we trust.
The hard-coded flags for JavaBuilder and turbine were made obsolete by
`java_toolchain.jvm_opts`, which allows them to be configured in the toolchain
instead.

The option has been deprecated in Java 13 and will be removed in a future
release.

Fixes bazelbuild#11381

PiperOrigin-RevId: 346160835
  • Loading branch information
cushon authored and copybara-github committed Dec 7, 2020
1 parent 952c0d7 commit d91e5b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,6 @@ private Builder setJavaExecutable(PathFragment javaExecutable, Artifact deployJa
this.executableArgs =
CustomCommandLine.builder()
.addPath(javaExecutable)
.add("-Xverify:none")
.addAll(ImmutableList.copyOf(jvmArgs))
.addAll(ImmutableList.copyOf(launchArgs));
toolsBuilder.add(deployJar);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,7 @@ public void testBuilderWithJavaExecutable() throws Exception {
collectingAnalysisEnvironment.registerAction(actions);
SpawnAction action = (SpawnAction) actions[0];
assertThat(action.getArguments())
.containsExactly(
"/bin/java", "-Xverify:none", "-jvmarg", "-cp", "pkg/exe.jar", "MyMainClass")
.containsExactly("/bin/java", "-jvmarg", "-cp", "pkg/exe.jar", "MyMainClass")
.inOrder();
}

Expand All @@ -194,8 +193,7 @@ public void testBuilderWithJavaExecutableAndParameterFile2() throws Exception {

// The action reports all arguments, including those inside the param file
assertThat(action.getArguments())
.containsExactly(
"/bin/java", "-Xverify:none", "-jvmarg", "-cp", "pkg/exe.jar", "MyMainClass", "-X")
.containsExactly("/bin/java", "-jvmarg", "-cp", "pkg/exe.jar", "MyMainClass", "-X")
.inOrder();

Spawn spawn =
Expand All @@ -206,7 +204,7 @@ public void testBuilderWithJavaExecutableAndParameterFile2() throws Exception {
assertThat(spawn.getArguments())
.containsExactly(
"/bin/java",
"-Xverify:none",

"-jvmarg",
"-cp",
"pkg/exe.jar",
Expand Down Expand Up @@ -242,7 +240,7 @@ public void testBuilderWithExtraExecutableArguments() throws Exception {
assertThat(action.getArguments())
.containsExactly(
"/bin/java",
"-Xverify:none",

"-jvmarg",
"-cp",
"pkg/exe.jar",
Expand Down

0 comments on commit d91e5b4

Please sign in to comment.