From 8854bbc43195239943984f7067d8032657144d5e Mon Sep 17 00:00:00 2001 From: Charles Korn Date: Wed, 26 May 2021 09:45:13 +1000 Subject: [PATCH] Fix https://github.com/moby/buildkit/issues/2109. Signed-off-by: Charles Korn --- session/filesync/filesync.pb.go | 71 ++++++++++++++++++--------------- session/filesync/filesync.proto | 8 ++-- session/filesync/generate.go | 2 +- 3 files changed, 44 insertions(+), 37 deletions(-) diff --git a/session/filesync/filesync.pb.go b/session/filesync/filesync.pb.go index e31e0a0d421c..6110307abb0e 100644 --- a/session/filesync/filesync.pb.go +++ b/session/filesync/filesync.pb.go @@ -8,6 +8,7 @@ import ( context "context" fmt "fmt" proto "github.com/gogo/protobuf/proto" + types "github.com/tonistiigi/fsutil/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -80,21 +81,25 @@ func init() { func init() { proto.RegisterFile("filesync.proto", fileDescriptor_d1042549f1f24495) } var fileDescriptor_d1042549f1f24495 = []byte{ - // 217 bytes of a gzipped FileDescriptorProto + // 281 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4b, 0xcb, 0xcc, 0x49, 0x2d, 0xae, 0xcc, 0x4b, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0xc8, 0xcd, 0x4f, 0xaa, - 0xd4, 0x83, 0x0b, 0x96, 0x19, 0x2a, 0x29, 0x71, 0xf1, 0x38, 0x55, 0x96, 0xa4, 0x16, 0xfb, 0xa6, - 0x16, 0x17, 0x27, 0xa6, 0xa7, 0x0a, 0x09, 0x71, 0xb1, 0xa4, 0x24, 0x96, 0x24, 0x4a, 0x30, 0x2a, - 0x30, 0x6a, 0xf0, 0x04, 0x81, 0xd9, 0x46, 0xab, 0x19, 0xb9, 0x38, 0xdc, 0x32, 0x73, 0x52, 0x83, - 0x2b, 0xf3, 0x92, 0x85, 0xfc, 0xb8, 0x38, 0x5c, 0x32, 0xd3, 0xd2, 0x9c, 0xf3, 0x0b, 0x2a, 0x85, - 0xe4, 0xf4, 0xd0, 0xcd, 0xd3, 0x43, 0x36, 0x4c, 0x8a, 0x80, 0xbc, 0x06, 0xa3, 0x01, 0xa3, 0x90, - 0x3f, 0x17, 0x67, 0x48, 0x62, 0x51, 0x70, 0x49, 0x51, 0x6a, 0x62, 0x2e, 0x35, 0x0c, 0x34, 0x8a, - 0x82, 0x3a, 0x36, 0x35, 0x2f, 0x85, 0xda, 0x8e, 0x75, 0xb2, 0xbb, 0xf0, 0x50, 0x8e, 0xe1, 0xc6, - 0x43, 0x39, 0x86, 0x0f, 0x0f, 0xe5, 0x18, 0x1b, 0x1e, 0xc9, 0x31, 0xae, 0x78, 0x24, 0xc7, 0x78, - 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0xbe, 0x78, 0x24, 0xc7, - 0xf0, 0xe1, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, - 0xc7, 0x10, 0xc5, 0x01, 0x33, 0x33, 0x89, 0x0d, 0x1c, 0x0d, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x5e, 0xce, 0x52, 0xb3, 0x98, 0x01, 0x00, 0x00, + 0xd4, 0x83, 0x0b, 0x96, 0x19, 0x4a, 0xe9, 0xa6, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, + 0xe7, 0xea, 0x97, 0xe4, 0xe7, 0x65, 0x16, 0x97, 0x64, 0x66, 0xa6, 0x67, 0xea, 0xa7, 0x15, 0x97, + 0x96, 0x64, 0xe6, 0xe8, 0x97, 0x54, 0x16, 0xa4, 0x16, 0xeb, 0x97, 0x67, 0x16, 0xa5, 0x42, 0x0c,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x36, 0x70, 0x60, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, + 0xff, 0xe6, 0x17, 0x63, 0x59, 0x9f, 0x01, 0x00, 0x00, } func (this *BytesMessage) Equal(that interface{}) bool { @@ -174,8 +179,8 @@ func (c *fileSyncClient) DiffCopy(ctx context.Context, opts ...grpc.CallOption) } type FileSync_DiffCopyClient interface { - Send(*BytesMessage) error - Recv() (*BytesMessage, error) + Send(*types.Packet) error + Recv() (*types.Packet, error) grpc.ClientStream } @@ -183,12 +188,12 @@ type fileSyncDiffCopyClient struct { grpc.ClientStream } -func (x *fileSyncDiffCopyClient) Send(m *BytesMessage) error { +func (x *fileSyncDiffCopyClient) Send(m *types.Packet) error { return x.ClientStream.SendMsg(m) } -func (x *fileSyncDiffCopyClient) Recv() (*BytesMessage, error) { - m := new(BytesMessage) +func (x *fileSyncDiffCopyClient) Recv() (*types.Packet, error) { + m := new(types.Packet) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } @@ -205,8 +210,8 @@ func (c *fileSyncClient) TarStream(ctx context.Context, opts ...grpc.CallOption) } type FileSync_TarStreamClient interface { - Send(*BytesMessage) error - Recv() (*BytesMessage, error) + Send(*types.Packet) error + Recv() (*types.Packet, error) grpc.ClientStream } @@ -214,12 +219,12 @@ type fileSyncTarStreamClient struct { grpc.ClientStream } -func (x *fileSyncTarStreamClient) Send(m *BytesMessage) error { +func (x *fileSyncTarStreamClient) Send(m *types.Packet) error { return x.ClientStream.SendMsg(m) } -func (x *fileSyncTarStreamClient) Recv() (*BytesMessage, error) { - m := new(BytesMessage) +func (x *fileSyncTarStreamClient) Recv() (*types.Packet, error) { + m := new(types.Packet) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } @@ -252,8 +257,8 @@ func _FileSync_DiffCopy_Handler(srv interface{}, stream grpc.ServerStream) error } type FileSync_DiffCopyServer interface { - Send(*BytesMessage) error - Recv() (*BytesMessage, error) + Send(*types.Packet) error + Recv() (*types.Packet, error) grpc.ServerStream } @@ -261,12 +266,12 @@ type fileSyncDiffCopyServer struct { grpc.ServerStream } -func (x *fileSyncDiffCopyServer) Send(m *BytesMessage) error { +func (x *fileSyncDiffCopyServer) Send(m *types.Packet) error { return x.ServerStream.SendMsg(m) } -func (x *fileSyncDiffCopyServer) Recv() (*BytesMessage, error) { - m := new(BytesMessage) +func (x *fileSyncDiffCopyServer) Recv() (*types.Packet, error) { + m := new(types.Packet) if err := x.ServerStream.RecvMsg(m); err != nil { return nil, err } @@ -278,8 +283,8 @@ func _FileSync_TarStream_Handler(srv interface{}, stream grpc.ServerStream) erro } type FileSync_TarStreamServer interface { - Send(*BytesMessage) error - Recv() (*BytesMessage, error) + Send(*types.Packet) error + Recv() (*types.Packet, error) grpc.ServerStream } @@ -287,12 +292,12 @@ type fileSyncTarStreamServer struct { grpc.ServerStream } -func (x *fileSyncTarStreamServer) Send(m *BytesMessage) error { +func (x *fileSyncTarStreamServer) Send(m *types.Packet) error { return x.ServerStream.SendMsg(m) } -func (x *fileSyncTarStreamServer) Recv() (*BytesMessage, error) { - m := new(BytesMessage) +func (x *fileSyncTarStreamServer) Recv() (*types.Packet, error) { + m := new(types.Packet) if err := x.ServerStream.RecvMsg(m); err != nil { return nil, err } diff --git a/session/filesync/filesync.proto b/session/filesync/filesync.proto index 0ae293736809..9e39179285ee 100644 --- a/session/filesync/filesync.proto +++ b/session/filesync/filesync.proto @@ -4,9 +4,11 @@ package moby.filesync.v1; option go_package = "filesync"; +import "github.com/tonistiigi/fsutil/types/wire.proto"; + service FileSync{ - rpc DiffCopy(stream BytesMessage) returns (stream BytesMessage); - rpc TarStream(stream BytesMessage) returns (stream BytesMessage); + rpc DiffCopy(stream fsutil.types.Packet) returns (stream fsutil.types.Packet); + rpc TarStream(stream fsutil.types.Packet) returns (stream fsutil.types.Packet); } service FileSend{ @@ -17,4 +19,4 @@ service FileSend{ // BytesMessage contains a chunk of byte data message BytesMessage{ bytes data = 1; -} \ No newline at end of file +} diff --git a/session/filesync/generate.go b/session/filesync/generate.go index 261e87627238..fbd72742b856 100644 --- a/session/filesync/generate.go +++ b/session/filesync/generate.go @@ -1,3 +1,3 @@ package filesync -//go:generate protoc --gogoslick_out=plugins=grpc:. filesync.proto +//go:generate protoc -I=. -I=../../vendor/ -I=../../vendor/github.com/tonistiigi/fsutil/types/ --gogoslick_out=plugins=grpc:. filesync.proto