From d91e5b4e09061dcab426e91861c0182c95b36b43 Mon Sep 17 00:00:00 2001 From: cushon Date: Mon, 7 Dec 2020 13:00:08 -0800 Subject: [PATCH] Stop hardcoding `-Xverify:none` in `SpawnAction` 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 https://github.com/bazelbuild/bazel/issues/11381 PiperOrigin-RevId: 346160835 --- .../build/lib/analysis/actions/SpawnAction.java | 1 - .../build/lib/analysis/actions/SpawnActionTest.java | 10 ++++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/analysis/actions/SpawnAction.java b/src/main/java/com/google/devtools/build/lib/analysis/actions/SpawnAction.java index 500ca758a6b3ec..de2257776a525e 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/actions/SpawnAction.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/actions/SpawnAction.java @@ -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); diff --git a/src/test/java/com/google/devtools/build/lib/analysis/actions/SpawnActionTest.java b/src/test/java/com/google/devtools/build/lib/analysis/actions/SpawnActionTest.java index 694844308ef8ca..b8ed06f12825d4 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/actions/SpawnActionTest.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/actions/SpawnActionTest.java @@ -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(); } @@ -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 = @@ -206,7 +204,7 @@ public void testBuilderWithJavaExecutableAndParameterFile2() throws Exception { assertThat(spawn.getArguments()) .containsExactly( "/bin/java", - "-Xverify:none", + "-jvmarg", "-cp", "pkg/exe.jar", @@ -242,7 +240,7 @@ public void testBuilderWithExtraExecutableArguments() throws Exception { assertThat(action.getArguments()) .containsExactly( "/bin/java", - "-Xverify:none", + "-jvmarg", "-cp", "pkg/exe.jar",