Add Bazel server process ID (pid) to the Build Event Protocol (BEP).
This field is also present in the master log and we're porting it to the BEP because
it's useful for tools to control the Bazel server process.
PiperOrigin-RevId: 214620730
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/NoBuildEvent.java b/src/main/java/com/google/devtools/build/lib/analysis/NoBuildEvent.java
index 270f2ee..8009e32 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/NoBuildEvent.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/NoBuildEvent.java
@@ -21,6 +21,7 @@
import com.google.devtools.build.lib.buildeventstream.BuildEventStreamProtos;
import com.google.devtools.build.lib.buildeventstream.GenericBuildEvent;
import com.google.devtools.build.lib.buildeventstream.ProgressEvent;
+import com.google.devtools.build.lib.util.ProcessUtils;
import java.util.Collection;
/** This event raised to indicate that no build will be happening for the given command. */
@@ -80,6 +81,7 @@
if (id != null) {
started.setUuid(id);
}
+ started.setServerPid(ProcessUtils.getpid());
return GenericBuildEvent.protoChaining(this).setStarted(started.build()).build();
}