chore(tvix/store/protof): buf format

Change-Id: I29b0fb62aa849ee01860dc7fe3dbba9b941ca172
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10238
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Reviewed-by: Adam Joseph <adam@westernsemico.com>
This commit is contained in:
Florian Klink 2023-12-09 15:23:29 +02:00 committed by clbot
parent 459d9e106f
commit 3c0a9a949a
6 changed files with 158 additions and 158 deletions

View file

@ -249,11 +249,11 @@ type NARInfo struct {
NarSha256 []byte `protobuf:"bytes,2,opt,name=nar_sha256,json=narSha256,proto3" json:"nar_sha256,omitempty"` NarSha256 []byte `protobuf:"bytes,2,opt,name=nar_sha256,json=narSha256,proto3" json:"nar_sha256,omitempty"`
// The signatures in a .narinfo file. // The signatures in a .narinfo file.
Signatures []*NARInfo_Signature `protobuf:"bytes,3,rep,name=signatures,proto3" json:"signatures,omitempty"` Signatures []*NARInfo_Signature `protobuf:"bytes,3,rep,name=signatures,proto3" json:"signatures,omitempty"`
// A list of references. To validate .narinfo signatures, a fingerprint // A list of references. To validate .narinfo signatures, a fingerprint needs
// needs to be constructed. // to be constructed.
// This fingerprint doesn't just contain the hashes of the output paths of // This fingerprint doesn't just contain the hashes of the output paths of all
// all references (like PathInfo.references), but their whole (base)names, // references (like PathInfo.references), but their whole (base)names, so we
// so we need to keep them somewhere. // need to keep them somewhere.
ReferenceNames []string `protobuf:"bytes,4,rep,name=reference_names,json=referenceNames,proto3" json:"reference_names,omitempty"` ReferenceNames []string `protobuf:"bytes,4,rep,name=reference_names,json=referenceNames,proto3" json:"reference_names,omitempty"`
// The StorePath of the .drv file producing this output. // The StorePath of the .drv file producing this output.
// The .drv suffix is omitted in its `name` field. // The .drv suffix is omitted in its `name` field.
@ -278,8 +278,8 @@ type NARInfo struct {
// There are some restrictions on the possible combinations. // There are some restrictions on the possible combinations.
// For example, `text` and `fixed:recursive` always imply sha256. // For example, `text` and `fixed:recursive` always imply sha256.
// //
// We use an enum to encode the possible combinations, and optimize // We use an enum to encode the possible combinations, and optimize for the
// for the common case, `fixed:recursive`, identified as `NAR_SHA256`. // common case, `fixed:recursive`, identified as `NAR_SHA256`.
Ca *NARInfo_CA `protobuf:"bytes,6,opt,name=ca,proto3" json:"ca,omitempty"` Ca *NARInfo_CA `protobuf:"bytes,6,opt,name=ca,proto3" json:"ca,omitempty"`
} }

View file

@ -204,11 +204,11 @@ var file_tvix_store_protos_rpc_pathinfo_proto_rawDesc = []byte{
0x0a, 0x24, 0x74, 0x76, 0x69, 0x78, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x0a, 0x24, 0x74, 0x76, 0x69, 0x78, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x69, 0x6e, 0x66, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x69, 0x6e, 0x66, 0x6f,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x74, 0x76, 0x69, 0x78, 0x2e, 0x73, 0x74, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x74, 0x76, 0x69, 0x78, 0x2e, 0x73, 0x74, 0x6f,
0x72, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x74, 0x76, 0x69, 0x78, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x21, 0x74, 0x76, 0x69, 0x78, 0x2f, 0x63, 0x61, 0x73, 0x74,
0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x70, 0x61, 0x74, 0x68, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x63, 0x61, 0x73, 0x74, 0x6f,
0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x74, 0x76, 0x69, 0x78, 0x2f, 0x63, 0x61, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x74, 0x76, 0x69, 0x78, 0x2f, 0x73,
0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x63, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x70, 0x61, 0x74, 0x68,
0x74, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x47, 0x0a, 0x12, 0x47, 0x65, 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x47, 0x0a, 0x12, 0x47, 0x65,
0x74, 0x50, 0x61, 0x74, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x74, 0x50, 0x61, 0x74, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x12, 0x26, 0x0a, 0x0e, 0x62, 0x79, 0x5f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x68, 0x61, 0x12, 0x26, 0x0a, 0x0e, 0x62, 0x79, 0x5f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x68, 0x61,
0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0c, 0x62, 0x79, 0x4f, 0x75, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0c, 0x62, 0x79, 0x4f, 0x75,

View file

@ -45,22 +45,22 @@ type PathInfoServiceClient interface {
// Uploading clients SHOULD obviously not steer other machines to try to // Uploading clients SHOULD obviously not steer other machines to try to
// substitute before from the remote end before having finished uploading // substitute before from the remote end before having finished uploading
// PathInfo, Directories and Blobs. // PathInfo, Directories and Blobs.
// The returned PathInfo object MAY contain additional narinfo signatures, // The returned PathInfo object MAY contain additional narinfo signatures, but
// but is otherwise left untouched. // is otherwise left untouched.
Put(ctx context.Context, in *PathInfo, opts ...grpc.CallOption) (*PathInfo, error) Put(ctx context.Context, in *PathInfo, opts ...grpc.CallOption) (*PathInfo, error)
// Calculate the NAR representation of the contents specified by the // Calculate the NAR representation of the contents specified by the
// root_node. The calculation SHOULD be cached server-side for subsequent // root_node. The calculation SHOULD be cached server-side for subsequent
// requests. // requests.
// //
// All references (to blobs or Directory messages) MUST already exist in // All references (to blobs or Directory messages) MUST already exist in the
// the store. // store.
// //
// The method can be used to produce a Nix fixed-output path, which // The method can be used to produce a Nix fixed-output path, which contains
// contains the (compressed) sha256 of the NAR content representation in // the (compressed) sha256 of the NAR content representation in the root_node
// the root_node name (suffixed with the name). // name (suffixed with the name).
// //
// It can also be used to calculate arbitrary NAR hashes of output paths, // It can also be used to calculate arbitrary NAR hashes of output paths, in
// in case a legacy Nix Binary Cache frontend is provided. // case a legacy Nix Binary Cache frontend is provided.
CalculateNAR(ctx context.Context, in *castore_go.Node, opts ...grpc.CallOption) (*CalculateNARResponse, error) CalculateNAR(ctx context.Context, in *castore_go.Node, opts ...grpc.CallOption) (*CalculateNARResponse, error)
// Return a stream of PathInfo messages matching the criteria specified in // Return a stream of PathInfo messages matching the criteria specified in
// ListPathInfoRequest. // ListPathInfoRequest.
@ -150,22 +150,22 @@ type PathInfoServiceServer interface {
// Uploading clients SHOULD obviously not steer other machines to try to // Uploading clients SHOULD obviously not steer other machines to try to
// substitute before from the remote end before having finished uploading // substitute before from the remote end before having finished uploading
// PathInfo, Directories and Blobs. // PathInfo, Directories and Blobs.
// The returned PathInfo object MAY contain additional narinfo signatures, // The returned PathInfo object MAY contain additional narinfo signatures, but
// but is otherwise left untouched. // is otherwise left untouched.
Put(context.Context, *PathInfo) (*PathInfo, error) Put(context.Context, *PathInfo) (*PathInfo, error)
// Calculate the NAR representation of the contents specified by the // Calculate the NAR representation of the contents specified by the
// root_node. The calculation SHOULD be cached server-side for subsequent // root_node. The calculation SHOULD be cached server-side for subsequent
// requests. // requests.
// //
// All references (to blobs or Directory messages) MUST already exist in // All references (to blobs or Directory messages) MUST already exist in the
// the store. // store.
// //
// The method can be used to produce a Nix fixed-output path, which // The method can be used to produce a Nix fixed-output path, which contains
// contains the (compressed) sha256 of the NAR content representation in // the (compressed) sha256 of the NAR content representation in the root_node
// the root_node name (suffixed with the name). // name (suffixed with the name).
// //
// It can also be used to calculate arbitrary NAR hashes of output paths, // It can also be used to calculate arbitrary NAR hashes of output paths, in
// in case a legacy Nix Binary Cache frontend is provided. // case a legacy Nix Binary Cache frontend is provided.
CalculateNAR(context.Context, *castore_go.Node) (*CalculateNARResponse, error) CalculateNAR(context.Context, *castore_go.Node) (*CalculateNARResponse, error)
// Return a stream of PathInfo messages matching the criteria specified in // Return a stream of PathInfo messages matching the criteria specified in
// ListPathInfoRequest. // ListPathInfoRequest.

View file

@ -25,6 +25,7 @@
buildPhase = '' buildPhase = ''
export HOME=$TMPDIR export HOME=$TMPDIR
buf lint buf lint
buf format -d --exit-code
buf generate buf generate
mkdir -p $out mkdir -p $out

View file

@ -48,7 +48,7 @@ message NARInfo {
message Signature { message Signature {
string name = 1; string name = 1;
bytes data = 2; bytes data = 2;
}; }
// This size of the NAR file, in bytes. // This size of the NAR file, in bytes.
uint64 nar_size = 1; uint64 nar_size = 1;
@ -59,11 +59,11 @@ message NARInfo {
// The signatures in a .narinfo file. // The signatures in a .narinfo file.
repeated Signature signatures = 3; repeated Signature signatures = 3;
// A list of references. To validate .narinfo signatures, a fingerprint // A list of references. To validate .narinfo signatures, a fingerprint needs
// needs to be constructed. // to be constructed.
// This fingerprint doesn't just contain the hashes of the output paths of // This fingerprint doesn't just contain the hashes of the output paths of all
// all references (like PathInfo.references), but their whole (base)names, // references (like PathInfo.references), but their whole (base)names, so we
// so we need to keep them somewhere. // need to keep them somewhere.
repeated string reference_names = 4; repeated string reference_names = 4;
// The StorePath of the .drv file producing this output. // The StorePath of the .drv file producing this output.
@ -90,8 +90,8 @@ message NARInfo {
// There are some restrictions on the possible combinations. // There are some restrictions on the possible combinations.
// For example, `text` and `fixed:recursive` always imply sha256. // For example, `text` and `fixed:recursive` always imply sha256.
// //
// We use an enum to encode the possible combinations, and optimize // We use an enum to encode the possible combinations, and optimize for the
// for the common case, `fixed:recursive`, identified as `NAR_SHA256`. // common case, `fixed:recursive`, identified as `NAR_SHA256`.
CA ca = 6; CA ca = 6;
message CA { message CA {

View file

@ -4,8 +4,8 @@ syntax = "proto3";
package tvix.store.v1; package tvix.store.v1;
import "tvix/store/protos/pathinfo.proto";
import "tvix/castore/protos/castore.proto"; import "tvix/castore/protos/castore.proto";
import "tvix/store/protos/pathinfo.proto";
option go_package = "code.tvl.fyi/tvix/store-go;storev1"; option go_package = "code.tvl.fyi/tvix/store-go;storev1";
@ -23,24 +23,23 @@ service PathInfoService {
// Uploading clients SHOULD obviously not steer other machines to try to // Uploading clients SHOULD obviously not steer other machines to try to
// substitute before from the remote end before having finished uploading // substitute before from the remote end before having finished uploading
// PathInfo, Directories and Blobs. // PathInfo, Directories and Blobs.
// The returned PathInfo object MAY contain additional narinfo signatures, // The returned PathInfo object MAY contain additional narinfo signatures, but
// but is otherwise left untouched. // is otherwise left untouched.
rpc Put(PathInfo) returns (PathInfo); rpc Put(PathInfo) returns (PathInfo);
// Calculate the NAR representation of the contents specified by the // Calculate the NAR representation of the contents specified by the
// root_node. The calculation SHOULD be cached server-side for subsequent // root_node. The calculation SHOULD be cached server-side for subsequent
// requests. // requests.
// //
// All references (to blobs or Directory messages) MUST already exist in // All references (to blobs or Directory messages) MUST already exist in the
// the store. // store.
// //
// The method can be used to produce a Nix fixed-output path, which // The method can be used to produce a Nix fixed-output path, which contains
// contains the (compressed) sha256 of the NAR content representation in // the (compressed) sha256 of the NAR content representation in the root_node
// the root_node name (suffixed with the name). // name (suffixed with the name).
// //
// It can also be used to calculate arbitrary NAR hashes of output paths, // It can also be used to calculate arbitrary NAR hashes of output paths, in
// in case a legacy Nix Binary Cache frontend is provided. // case a legacy Nix Binary Cache frontend is provided.
rpc CalculateNAR(tvix.castore.v1.Node) returns (CalculateNARResponse); rpc CalculateNAR(tvix.castore.v1.Node) returns (CalculateNARResponse);
// Return a stream of PathInfo messages matching the criteria specified in // Return a stream of PathInfo messages matching the criteria specified in
@ -57,7 +56,7 @@ message GetPathInfoRequest {
// /nix/store/xm35nga2g20mz5sm5l6n8v3bdm86yj83-cowsay-3.04 // /nix/store/xm35nga2g20mz5sm5l6n8v3bdm86yj83-cowsay-3.04
// this field would contain nixbase32dec("xm35nga2g20mz5sm5l6n8v3bdm86yj83"). // this field would contain nixbase32dec("xm35nga2g20mz5sm5l6n8v3bdm86yj83").
bytes by_output_hash = 1; bytes by_output_hash = 1;
}; }
} }
// The parameters that can be used to lookup (multiple) PathInfo objects. // The parameters that can be used to lookup (multiple) PathInfo objects.