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-10-25 21:23:42 +0200
committerGravatar Dmitry Lomov <dslomov@google.com>2017-10-26 10:59:05 +0200
commitc6b6dbadd0a93936c51154b25abc5fbba8f2d1af (patch)
treebfa65849ed2566899489eb625d4640429169ae71 /src/main/java/com/google/devtools/build/lib/runtime/BlazeWorkspace.java
parenteea9ec288856a61538b9204f2e0f9e3311cab6a8 (diff)
Accept build IDs by flag.
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: 173432904
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 2a2d23edda..e682d4ef58 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;
}