From f4baaf79e285d72375e27f9329cbd39d57f8cb4d Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Wed, 15 Jul 2020 22:32:30 -0400 Subject: [PATCH] feat(3p/nix): Add BuildDerivation proto Change-Id: Ib66b4ff2da72677e74b6a713186c72f66d9f6f88 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1208 Tested-by: BuildkiteCI Reviewed-by: tazjin --- third_party/nix/src/proto/worker.proto | 31 ++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/third_party/nix/src/proto/worker.proto b/third_party/nix/src/proto/worker.proto index d983b261c..b24d5e97e 100644 --- a/third_party/nix/src/proto/worker.proto +++ b/third_party/nix/src/proto/worker.proto @@ -85,6 +85,10 @@ service Worker { // Check the integrity of the Nix store rpc VerifyStore(VerifyStoreRequest) returns (VerifyStoreResponse); + + // Build a single non-materialized derivation (i.e. not from an + // on-disk .drv file). + rpc BuildDerivation(BuildDerivationRequest) returns (BuildDerivationResponse); } enum HashType { @@ -117,6 +121,22 @@ enum GCAction { DeleteSpecific = 3; } +enum BuildStatus { + Built = 0; + Substituted = 1; + AlreadyValid = 2; + PermanentFailure = 3; + InputRejected = 4; + OutputRejected = 5; + TransientFailure = 6; // possibly transient + CachedFailure = 7; // no longer used + TimedOut = 8; + MiscFailure = 9; + DependencyFailed = 10; + LogLimitExceeded = 11; + NotDeterministic = 12; +}; + // Generic type for any RPC call that just reads or returns a single // store path. message StorePath { @@ -254,3 +274,14 @@ message VerifyStoreResponse { // True if errors remain (???) bool errors = 1; } + +message BuildDerivationRequest { + // Only used for informational purposes. + StorePath drvPath = 1; + BuildMode buildMode = 2; +} + +message BuildDerivationResponse { + BuildStatus status = 1; + string errorMessage = 2; +}