aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/runtime/BlazeWorkspace.java
diff options
context:
space:
mode:
authorGravatar ccalvarin <ccalvarin@google.com>2017-12-14 10:37:41 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2017-12-14 10:41:14 -0800
commit2192b56babc6c4f0e84d130a313a6710753cfae4 (patch)
tree14f4f36972dc22e7e6531ed004fe59cb7c44fb93 /src/main/java/com/google/devtools/build/lib/runtime/BlazeWorkspace.java
parent8b3ba50246fed6ff13d70299fb039cc66be465c4 (diff)
We accepted these by environment variable largely because setting it via invocation policy would require changing invocation policy for each command, which had caused the Bazel server to restart, loosing incremental state. This is fixed: changing invocation policy no longer causes Bazel to restart its servers, so accept these as normal options. We will soon no longer accept these flags by environment variable, but will accept both for a transition period, so that nobody relying on these values is broken by a single release. To inform users of this environment variable, anyone setting the environment variable without the flag will receive a warning but the value will be kept. The following release will no longer accept an environment variable. Note on format: invocation_id we accept only clean UUIDs, but for build_request_id, to help differentiate otherwise undifferentiable id types, we accept arbitrary prefixes before the UUID. The user is responsible for picking prefixes that are sane. RELNOTES: None. PiperOrigin-RevId: 179063120
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/runtime/BlazeWorkspace.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/runtime/BlazeWorkspace.java24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/BlazeWorkspace.java b/src/main/java/com/google/devtools/build/lib/runtime/BlazeWorkspace.java
index b606e63bf1..6a939ec372 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/BlazeWorkspace.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/BlazeWorkspace.java
@@ -36,6 +36,7 @@ import com.google.devtools.build.lib.vfs.FileSystemUtils;
import com.google.devtools.build.lib.vfs.Path;
import com.google.devtools.common.options.OptionsProvider;
import java.io.IOException;
+import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.Nullable;
@@ -186,13 +187,24 @@ public final class BlazeWorkspace {
/**
* Initializes a CommandEnvironment to execute a command in this workspace.
*
- * <p>This method should be called from the "main" thread on which the command will execute;
- * that thread will receive interruptions if a module requests an early exit.
+ * <p>This method should be called from the "main" thread on which the command will execute; that
+ * thread will receive interruptions if a module requests an early exit.
+ *
+ * @param warnings a list of warnings to which the CommandEnvironment can add any warning
+ * generated during initialization. This is needed because Blaze's output handling is not yet
+ * fully configured at this point.
*/
- public CommandEnvironment initCommand(Command command, OptionsProvider options) {
- CommandEnvironment env = new CommandEnvironment(
- runtime, this, new EventBus(eventBusExceptionHandler), Thread.currentThread(), command,
- options);
+ public CommandEnvironment initCommand(
+ Command command, OptionsProvider options, List<String> warnings) {
+ CommandEnvironment env =
+ new CommandEnvironment(
+ runtime,
+ this,
+ new EventBus(eventBusExceptionHandler),
+ Thread.currentThread(),
+ command,
+ options,
+ warnings);
skyframeExecutor.setClientEnv(env.getClientEnv());
return env;
}