Remove --batch deprecation warnings
Recognize that there are valid use cases for --batch, but also that it's a
second-class one-off that might not support all of the latest and greatest
features.
RELNOTES: None
PiperOrigin-RevId: 281331495
diff --git a/site/docs/user-manual.html b/site/docs/user-manual.html
index 9fd79f2..aadaca8 100644
--- a/site/docs/user-manual.html
+++ b/site/docs/user-manual.html
@@ -2815,13 +2815,6 @@
<h4 id='flag--batch'><code class='flag'>--batch</code></h4>
<p>
- WARNING: <code class='flag'>--batch</code> is deprecated. For build isolation, we recommend
- using the command option <code class='flag'>--nokeep_state_after_build</code>, which guarantees
- that no incremental in-memory state is kept between builds. In order to restart the
- Bazel server and JVM after a build, please explicitly do so using the "shutdown" command.
-</p>
-
-<p>
Batch mode causes Bazel to not use the standard client/server mode described
<a href='guide.html#client/server'>above</a>, instead running a bazel java process for a
single command, which has been used for more predictable semantics with respect
@@ -2844,6 +2837,17 @@
is less critical, such as continuous builds.
</p>
+<p>
+ <i>WARNING:</i> <code class='flag'>--batch</code> is sufficiently slower than standard
+ client/server mode. Additionally it might not support all of the features and optimizations which
+ are made possible by a persistent Bazel server. If you're using <code class='flag'>--batch</code>
+ for the purpose of build isolation, we recommend using the command option
+ <code class='flag'>--nokeep_state_after_build</code>, which guarantees that no incremental
+ in-memory state is kept between builds. In order to restart the Bazel server and JVM after a
+ build, please explicitly do so using the "shutdown" command.
+</p>
+
+
<h4 id='flag--max_idle_secs'><code class='flag'>--max_idle_secs <var>n</var></code></h4>
<p>
This option specifies how long, in seconds, the Bazel server process
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/BazelStartupOptionsModule.java b/src/main/java/com/google/devtools/build/lib/bazel/BazelStartupOptionsModule.java
index da2f903..0ea737a 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/BazelStartupOptionsModule.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/BazelStartupOptionsModule.java
@@ -13,13 +13,8 @@
// limitations under the License.
package com.google.devtools.build.lib.bazel;
-import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
-import com.google.devtools.build.lib.events.Event;
import com.google.devtools.build.lib.runtime.BlazeModule;
-import com.google.devtools.build.lib.runtime.BlazeServerStartupOptions;
-import com.google.devtools.build.lib.runtime.CommandEnvironment;
-import com.google.devtools.build.lib.util.AbruptExitException;
import com.google.devtools.common.options.Option;
import com.google.devtools.common.options.OptionDocumentationCategory;
import com.google.devtools.common.options.OptionEffectTag;
@@ -91,24 +86,4 @@
public Iterable<Class<? extends OptionsBase>> getStartupOptions() {
return ImmutableList.of(Options.class);
}
-
- /**
- * Post a deprecation warning about batch mode. This is in beforeCommand, and not earlier, so that
- * we can post the warning event to the correctly set up channels.
- */
- @Override
- public void beforeCommand(CommandEnvironment env) throws AbruptExitException {
- BlazeServerStartupOptions startupOptions =
- Preconditions.checkNotNull(
- env.getRuntime()
- .getStartupOptionsProvider()
- .getOptions(BlazeServerStartupOptions.class));
- if (startupOptions.batch) {
- env.getReporter()
- .handle(
- Event.warn(
- "--batch mode is deprecated. Please instead explicitly shut down your Bazel "
- + "server using the command \"bazel shutdown\"."));
- }
- }
}
diff --git a/src/test/shell/integration/client_test.sh b/src/test/shell/integration/client_test.sh
index 7635775..febb2d2 100755
--- a/src/test/shell/integration/client_test.sh
+++ b/src/test/shell/integration/client_test.sh
@@ -198,7 +198,6 @@
local pid2=$(bazel --batch --nobatch info server_pid 2> $TEST_log)
assert_equals "$pid1" "$pid2"
expect_not_log "WARNING.* Running B\\(azel\\|laze\\) server needs to be killed"
- expect_not_log "WARNING.* --batch mode is deprecated."
}
# Regression test for #1875189, "bazel client should pass through '--help' like
@@ -229,7 +228,6 @@
local pid2=$(bazel --batch info server_pid 2> $TEST_log)
assert_not_equals "$pid1" "$pid2"
expect_log "WARNING.* Running B\\(azel\\|laze\\) server needs to be killed"
- expect_log "WARNING.* --batch mode is deprecated."
}
function test_cmdline_not_written_in_batch_mode() {