feat(tvix): Introduce build event streams in worker protocol

Introduces a new `BuildEvent` proto type which is streamed in response
to calls that trigger builds of derivations.

This type can currently supply build statuses, log lines and
information about builds starting.

This is in preparation for threading build logs through the processes.

Since we have nowhere to send the logs (yet), a null sink is used
instead.

Co-authored-by: Griffin Smith <grfn@gws.fyi>
Change-Id: If7332337b89506c7e404cd20174acdaa1a3be4e8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1793
Tested-by: BuildkiteCI
Reviewed-by: glittershark <grfn@gws.fyi>
Reviewed-by: kanepyork <rikingcoding@gmail.com>
This commit is contained in:
Vincent Ambo 2020-08-20 02:32:51 +01:00 committed by tazjin
parent 883de9b8d7
commit 19e874a985
5 changed files with 92 additions and 25 deletions

View file

@ -92,7 +92,7 @@ nix::proto::BuildStatus BuildResult::status_to_proto() {
}
std::optional<BuildResult> BuildResult::FromProto(
const nix::proto::BuildDerivationResponse& resp) {
const nix::proto::BuildResult& resp) {
BuildResult result;
switch (resp.status()) {
case proto::BuildStatus::Built:
@ -125,7 +125,7 @@ std::optional<BuildResult> BuildResult::FromProto(
return {};
}
result.errorMsg = resp.error_message();
result.errorMsg = resp.msg();
return result;
}