feat(3p/nix): Add BuildDerivation proto

Change-Id: Ib66b4ff2da72677e74b6a713186c72f66d9f6f88
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1208
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
This commit is contained in:
Griffin Smith 2020-07-15 22:32:30 -04:00 committed by glittershark
parent db4ac8ea7c
commit f4baaf79e2

View file

@ -85,6 +85,10 @@ service Worker {
// Check the integrity of the Nix store // Check the integrity of the Nix store
rpc VerifyStore(VerifyStoreRequest) returns (VerifyStoreResponse); 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 { enum HashType {
@ -117,6 +121,22 @@ enum GCAction {
DeleteSpecific = 3; 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 // Generic type for any RPC call that just reads or returns a single
// store path. // store path.
message StorePath { message StorePath {
@ -254,3 +274,14 @@ message VerifyStoreResponse {
// True if errors remain (???) // True if errors remain (???)
bool errors = 1; bool errors = 1;
} }
message BuildDerivationRequest {
// Only used for informational purposes.
StorePath drvPath = 1;
BuildMode buildMode = 2;
}
message BuildDerivationResponse {
BuildStatus status = 1;
string errorMessage = 2;
}