hack: generate vtproto files for buildx

Integrates vtproto into buildx. The generated files dockerfile has been
modified to copy the buildkit equivalent file to ensure files are laid
out in the appropriate way for imports.

An import has also been included to change the grpc codec to the version
in buildkit that supports vtproto. This will allow buildx to utilize the
speed and memory improvements from that.

Also updates the gc control options for prune.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
This commit is contained in:
Jonathan A. Sternberg
2024-10-08 13:35:06 -05:00
parent d353f5f6ba
commit 64c5139ab6
109 changed files with 68070 additions and 2941 deletions

View File

@ -2,7 +2,7 @@
// versions:
// protoc-gen-go v1.34.1
// protoc v3.11.4
// source: caps.proto
// source: github.com/moby/buildkit/util/apicaps/pb/caps.proto
package moby_buildkit_v1_apicaps
@ -37,7 +37,7 @@ type APICap struct {
func (x *APICap) Reset() {
*x = APICap{}
if protoimpl.UnsafeEnabled {
mi := &file_caps_proto_msgTypes[0]
mi := &file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -50,7 +50,7 @@ func (x *APICap) String() string {
func (*APICap) ProtoMessage() {}
func (x *APICap) ProtoReflect() protoreflect.Message {
mi := &file_caps_proto_msgTypes[0]
mi := &file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -63,7 +63,7 @@ func (x *APICap) ProtoReflect() protoreflect.Message {
// Deprecated: Use APICap.ProtoReflect.Descriptor instead.
func (*APICap) Descriptor() ([]byte, []int) {
return file_caps_proto_rawDescGZIP(), []int{0}
return file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_rawDescGZIP(), []int{0}
}
func (x *APICap) GetID() string {
@ -108,49 +108,52 @@ func (x *APICap) GetDisabledAlternative() string {
return ""
}
var File_caps_proto protoreflect.FileDescriptor
var File_github_com_moby_buildkit_util_apicaps_pb_caps_proto protoreflect.FileDescriptor
var file_caps_proto_rawDesc = []byte{
0x0a, 0x0a, 0x63, 0x61, 0x70, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x18, 0x6d, 0x6f,
0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x61,
0x70, 0x69, 0x63, 0x61, 0x70, 0x73, 0x22, 0xda, 0x01, 0x0a, 0x06, 0x41, 0x50, 0x49, 0x43, 0x61,
0x70, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49,
0x44, 0x12, 0x18, 0x0a, 0x07, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01,
0x28, 0x08, 0x52, 0x07, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x44,
0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52,
0x0a, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0e, 0x44,
0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x04, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0e, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x61,
0x73, 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x11, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52,
0x65, 0x61, 0x73, 0x6f, 0x6e, 0x4d, 0x73, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11,
var file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_rawDesc = []byte{
0x0a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62,
0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x75, 0x74, 0x69, 0x6c, 0x2f,
0x61, 0x70, 0x69, 0x63, 0x61, 0x70, 0x73, 0x2f, 0x70, 0x62, 0x2f, 0x63, 0x61, 0x70, 0x73, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x18, 0x6d, 0x6f, 0x62, 0x79, 0x2e, 0x62, 0x75, 0x69, 0x6c,
0x64, 0x6b, 0x69, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x61, 0x70, 0x69, 0x63, 0x61, 0x70, 0x73, 0x22,
0xda, 0x01, 0x0a, 0x06, 0x41, 0x50, 0x49, 0x43, 0x61, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x45, 0x6e,
0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x45, 0x6e, 0x61,
0x62, 0x6c, 0x65, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74,
0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63,
0x61, 0x74, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0e, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64,
0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x44, 0x69,
0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x11,
0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x4d, 0x73,
0x67, 0x12, 0x30, 0x0a, 0x13, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x6c, 0x74,
0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13,
0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74,
0x69, 0x76, 0x65, 0x42, 0x43, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
0x6d, 0x2f, 0x6d, 0x6f, 0x62, 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f,
0x75, 0x74, 0x69, 0x6c, 0x2f, 0x61, 0x70, 0x69, 0x63, 0x61, 0x70, 0x73, 0x2f, 0x70, 0x62, 0x3b,
0x6d, 0x6f, 0x62, 0x79, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x5f, 0x76, 0x31,
0x5f, 0x61, 0x70, 0x69, 0x63, 0x61, 0x70, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65,
0x64, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x4d, 0x73, 0x67, 0x12, 0x30, 0x0a, 0x13, 0x44, 0x69,
0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 0x76,
0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65,
0x64, 0x41, 0x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x42, 0x43, 0x5a, 0x41,
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62, 0x79, 0x2f,
0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x75, 0x74, 0x69, 0x6c, 0x2f, 0x61, 0x70,
0x69, 0x63, 0x61, 0x70, 0x73, 0x2f, 0x70, 0x62, 0x3b, 0x6d, 0x6f, 0x62, 0x79, 0x5f, 0x62, 0x75,
0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x5f, 0x76, 0x31, 0x5f, 0x61, 0x70, 0x69, 0x63, 0x61, 0x70,
0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_caps_proto_rawDescOnce sync.Once
file_caps_proto_rawDescData = file_caps_proto_rawDesc
file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_rawDescOnce sync.Once
file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_rawDescData = file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_rawDesc
)
func file_caps_proto_rawDescGZIP() []byte {
file_caps_proto_rawDescOnce.Do(func() {
file_caps_proto_rawDescData = protoimpl.X.CompressGZIP(file_caps_proto_rawDescData)
func file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_rawDescGZIP() []byte {
file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_rawDescOnce.Do(func() {
file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_rawDescData)
})
return file_caps_proto_rawDescData
return file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_rawDescData
}
var file_caps_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_caps_proto_goTypes = []interface{}{
var file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_goTypes = []interface{}{
(*APICap)(nil), // 0: moby.buildkit.v1.apicaps.APICap
}
var file_caps_proto_depIdxs = []int32{
var file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
@ -158,13 +161,13 @@ var file_caps_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for field type_name
}
func init() { file_caps_proto_init() }
func file_caps_proto_init() {
if File_caps_proto != nil {
func init() { file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_init() }
func file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_init() {
if File_github_com_moby_buildkit_util_apicaps_pb_caps_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_caps_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*APICap); i {
case 0:
return &v.state
@ -181,18 +184,18 @@ func file_caps_proto_init() {
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_caps_proto_rawDesc,
RawDescriptor: file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_caps_proto_goTypes,
DependencyIndexes: file_caps_proto_depIdxs,
MessageInfos: file_caps_proto_msgTypes,
GoTypes: file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_goTypes,
DependencyIndexes: file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_depIdxs,
MessageInfos: file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_msgTypes,
}.Build()
File_caps_proto = out.File
file_caps_proto_rawDesc = nil
file_caps_proto_goTypes = nil
file_caps_proto_depIdxs = nil
File_github_com_moby_buildkit_util_apicaps_pb_caps_proto = out.File
file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_rawDesc = nil
file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_goTypes = nil
file_github_com_moby_buildkit_util_apicaps_pb_caps_proto_depIdxs = nil
}

View File

@ -0,0 +1,409 @@
// Code generated by protoc-gen-go-vtproto. DO NOT EDIT.
// protoc-gen-go-vtproto version: v0.6.1-0.20240319094008-0393e58bdf10
// source: github.com/moby/buildkit/util/apicaps/pb/caps.proto
package moby_buildkit_v1_apicaps
import (
fmt "fmt"
protohelpers "github.com/planetscale/vtprotobuf/protohelpers"
proto "google.golang.org/protobuf/proto"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
io "io"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
func (m *APICap) CloneVT() *APICap {
if m == nil {
return (*APICap)(nil)
}
r := new(APICap)
r.ID = m.ID
r.Enabled = m.Enabled
r.Deprecated = m.Deprecated
r.DisabledReason = m.DisabledReason
r.DisabledReasonMsg = m.DisabledReasonMsg
r.DisabledAlternative = m.DisabledAlternative
if len(m.unknownFields) > 0 {
r.unknownFields = make([]byte, len(m.unknownFields))
copy(r.unknownFields, m.unknownFields)
}
return r
}
func (m *APICap) CloneMessageVT() proto.Message {
return m.CloneVT()
}
func (this *APICap) EqualVT(that *APICap) bool {
if this == that {
return true
} else if this == nil || that == nil {
return false
}
if this.ID != that.ID {
return false
}
if this.Enabled != that.Enabled {
return false
}
if this.Deprecated != that.Deprecated {
return false
}
if this.DisabledReason != that.DisabledReason {
return false
}
if this.DisabledReasonMsg != that.DisabledReasonMsg {
return false
}
if this.DisabledAlternative != that.DisabledAlternative {
return false
}
return string(this.unknownFields) == string(that.unknownFields)
}
func (this *APICap) EqualMessageVT(thatMsg proto.Message) bool {
that, ok := thatMsg.(*APICap)
if !ok {
return false
}
return this.EqualVT(that)
}
func (m *APICap) MarshalVT() (dAtA []byte, err error) {
if m == nil {
return nil, nil
}
size := m.SizeVT()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBufferVT(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *APICap) MarshalToVT(dAtA []byte) (int, error) {
size := m.SizeVT()
return m.MarshalToSizedBufferVT(dAtA[:size])
}
func (m *APICap) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
if m == nil {
return 0, nil
}
i := len(dAtA)
_ = i
var l int
_ = l
if m.unknownFields != nil {
i -= len(m.unknownFields)
copy(dAtA[i:], m.unknownFields)
}
if len(m.DisabledAlternative) > 0 {
i -= len(m.DisabledAlternative)
copy(dAtA[i:], m.DisabledAlternative)
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.DisabledAlternative)))
i--
dAtA[i] = 0x32
}
if len(m.DisabledReasonMsg) > 0 {
i -= len(m.DisabledReasonMsg)
copy(dAtA[i:], m.DisabledReasonMsg)
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.DisabledReasonMsg)))
i--
dAtA[i] = 0x2a
}
if len(m.DisabledReason) > 0 {
i -= len(m.DisabledReason)
copy(dAtA[i:], m.DisabledReason)
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.DisabledReason)))
i--
dAtA[i] = 0x22
}
if m.Deprecated {
i--
if m.Deprecated {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x18
}
if m.Enabled {
i--
if m.Enabled {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x10
}
if len(m.ID) > 0 {
i -= len(m.ID)
copy(dAtA[i:], m.ID)
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ID)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *APICap) SizeVT() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.ID)
if l > 0 {
n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
}
if m.Enabled {
n += 2
}
if m.Deprecated {
n += 2
}
l = len(m.DisabledReason)
if l > 0 {
n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
}
l = len(m.DisabledReasonMsg)
if l > 0 {
n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
}
l = len(m.DisabledAlternative)
if l > 0 {
n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
}
n += len(m.unknownFields)
return n
}
func (m *APICap) UnmarshalVT(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protohelpers.ErrIntOverflow
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: APICap: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: APICap: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protohelpers.ErrIntOverflow
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protohelpers.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protohelpers.ErrInvalidLength
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.ID = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType)
}
var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protohelpers.ErrIntOverflow
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.Enabled = bool(v != 0)
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Deprecated", wireType)
}
var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protohelpers.ErrIntOverflow
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.Deprecated = bool(v != 0)
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field DisabledReason", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protohelpers.ErrIntOverflow
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protohelpers.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protohelpers.ErrInvalidLength
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.DisabledReason = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 5:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field DisabledReasonMsg", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protohelpers.ErrIntOverflow
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protohelpers.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protohelpers.ErrInvalidLength
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.DisabledReasonMsg = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 6:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field DisabledAlternative", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protohelpers.ErrIntOverflow
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protohelpers.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protohelpers.ErrInvalidLength
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.DisabledAlternative = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := protohelpers.Skip(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protohelpers.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}

View File

@ -1,3 +0,0 @@
package moby_buildkit_v1_apicaps //nolint:revive
//go:generate protoc -I=. -I=../../../vendor/ -I=../../../../../../ --go_out=paths=source_relative:. --go-grpc_out=paths=source_relative,require_unimplemented_servers=false:. caps.proto

View File

@ -0,0 +1,130 @@
// Package proto implements a custom encoding for grpc.
//
// The codec registered by this package has an important
// difference from the default codec. Unlike the default codec,
// it does not reset the input message when unmarshaling.
//
// This primarily impacts stream service calls. If you want
// to reuse a message and need it to be reset before calling
// RecvMsg, invoke the appropriate Reset method or proto.Reset
// before invoking RecvMsg or use a zero initialized message.
package proto
import (
"github.com/pkg/errors"
"google.golang.org/grpc/encoding"
"google.golang.org/grpc/mem"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/protoadapt"
// It is important that this import is included so
// we can overwrite the default codec with the same name.
grpcproto "google.golang.org/grpc/encoding/proto"
)
func init() {
encoding.RegisterCodecV2(codec{})
}
type codec struct{}
func (codec) Marshal(m any) (data mem.BufferSlice, err error) {
switch m := m.(type) {
case vtprotoMessage:
return marshalVT(data, m)
case protoadapt.MessageV2:
return marshal(data, m)
case protoadapt.MessageV1:
m2 := protoadapt.MessageV2Of(m)
return marshal(data, m2)
default:
return nil, errors.Errorf("failed to marshal, message is %T, want proto.Message", m)
}
}
func (codec) Unmarshal(data mem.BufferSlice, m any) error {
switch m := m.(type) {
case vtprotoMessage:
return unmarshalVT(data, m)
case protoadapt.MessageV2:
return unmarshal(data, m)
case protoadapt.MessageV1:
m2 := protoadapt.MessageV2Of(m)
return unmarshal(data, m2)
default:
return errors.Errorf("failed to unmarshal, message is %T, want proto.Message", m)
}
}
func (codec) Name() string {
return grpcproto.Name
}
type vtprotoMessage interface {
MarshalToSizedBufferVT(data []byte) (int, error)
SizeVT() int
UnmarshalVT(data []byte) error
}
func marshalVT(data mem.BufferSlice, m vtprotoMessage) (mem.BufferSlice, error) {
size := m.SizeVT()
if mem.IsBelowBufferPoolingThreshold(size) {
buf := make([]byte, size)
if _, err := m.MarshalToSizedBufferVT(buf); err != nil {
return nil, err
}
data = append(data, mem.SliceBuffer(buf))
} else {
pool := mem.DefaultBufferPool()
buf := pool.Get(size)
if _, err := m.MarshalToSizedBufferVT((*buf)[:size]); err != nil {
pool.Put(buf)
return nil, err
}
data = append(data, mem.NewBuffer(buf, pool))
}
return data, nil
}
func unmarshalVT(data mem.BufferSlice, m vtprotoMessage) error {
buf := data.MaterializeToBuffer(mem.DefaultBufferPool())
defer buf.Free()
return m.UnmarshalVT(buf.ReadOnlyData())
}
func marshal(data mem.BufferSlice, m proto.Message) (mem.BufferSlice, error) {
size := proto.Size(m)
if mem.IsBelowBufferPoolingThreshold(size) {
buf, err := proto.Marshal(m)
if err != nil {
return nil, err
}
data = append(data, mem.SliceBuffer(buf))
} else {
pool := mem.DefaultBufferPool()
buf := pool.Get(size)
if _, err := (proto.MarshalOptions{}).MarshalAppend((*buf)[:0], m); err != nil {
pool.Put(buf)
return nil, err
}
data = append(data, mem.NewBuffer(buf, pool))
}
return data, nil
}
func unmarshal(data mem.BufferSlice, m proto.Message) error {
buf := data.MaterializeToBuffer(mem.DefaultBufferPool())
defer buf.Free()
// We use merge true here for consistency with the vtproto implementation,
// but this won't impact performance most of the time. This is because
// the buffer that's most likely to impact performance is a bytes message
// and the default codec for protobuf will never reuse a buffer
// from the existing message.
//
// We don't want any surprises between the vtproto implementation and this
// implementation so we enable merge in case it causes a visible behavior
// difference.
return proto.UnmarshalOptions{Merge: true}.Unmarshal(buf.ReadOnlyData(), m)
}

View File

@ -1,3 +0,0 @@
package stack
//go:generate protoc -I=. -I=../../vendor/ --go_out=. --go_opt=paths=source_relative --go_opt=Mstack.proto=/util/stack stack.proto

View File

@ -2,7 +2,7 @@
// versions:
// protoc-gen-go v1.34.1
// protoc v3.11.4
// source: stack.proto
// source: github.com/moby/buildkit/util/stack/stack.proto
package stack
@ -35,7 +35,7 @@ type Stack struct {
func (x *Stack) Reset() {
*x = Stack{}
if protoimpl.UnsafeEnabled {
mi := &file_stack_proto_msgTypes[0]
mi := &file_github_com_moby_buildkit_util_stack_stack_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -48,7 +48,7 @@ func (x *Stack) String() string {
func (*Stack) ProtoMessage() {}
func (x *Stack) ProtoReflect() protoreflect.Message {
mi := &file_stack_proto_msgTypes[0]
mi := &file_github_com_moby_buildkit_util_stack_stack_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -61,7 +61,7 @@ func (x *Stack) ProtoReflect() protoreflect.Message {
// Deprecated: Use Stack.ProtoReflect.Descriptor instead.
func (*Stack) Descriptor() ([]byte, []int) {
return file_stack_proto_rawDescGZIP(), []int{0}
return file_github_com_moby_buildkit_util_stack_stack_proto_rawDescGZIP(), []int{0}
}
func (x *Stack) GetFrames() []*Frame {
@ -112,7 +112,7 @@ type Frame struct {
func (x *Frame) Reset() {
*x = Frame{}
if protoimpl.UnsafeEnabled {
mi := &file_stack_proto_msgTypes[1]
mi := &file_github_com_moby_buildkit_util_stack_stack_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -125,7 +125,7 @@ func (x *Frame) String() string {
func (*Frame) ProtoMessage() {}
func (x *Frame) ProtoReflect() protoreflect.Message {
mi := &file_stack_proto_msgTypes[1]
mi := &file_github_com_moby_buildkit_util_stack_stack_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -138,7 +138,7 @@ func (x *Frame) ProtoReflect() protoreflect.Message {
// Deprecated: Use Frame.ProtoReflect.Descriptor instead.
func (*Frame) Descriptor() ([]byte, []int) {
return file_stack_proto_rawDescGZIP(), []int{1}
return file_github_com_moby_buildkit_util_stack_stack_proto_rawDescGZIP(), []int{1}
}
func (x *Frame) GetName() string {
@ -162,45 +162,49 @@ func (x *Frame) GetLine() int32 {
return 0
}
var File_stack_proto protoreflect.FileDescriptor
var File_github_com_moby_buildkit_util_stack_stack_proto protoreflect.FileDescriptor
var file_stack_proto_rawDesc = []byte{
0x0a, 0x0b, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x73,
0x74, 0x61, 0x63, 0x6b, 0x22, 0x8f, 0x01, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x12, 0x24,
0x0a, 0x06, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c,
0x2e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x52, 0x06, 0x66, 0x72,
0x61, 0x6d, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6d, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18,
0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6d, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x10,
0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x70, 0x69, 0x64,
0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28,
0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65,
0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65,
0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x43, 0x0a, 0x05, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x12,
0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e,
0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x52, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x4c, 0x69, 0x6e, 0x65, 0x18,
0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x4c, 0x69, 0x6e, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
var file_github_com_moby_buildkit_util_stack_stack_proto_rawDesc = []byte{
0x0a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x62,
0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x75, 0x74, 0x69, 0x6c, 0x2f,
0x73, 0x74, 0x61, 0x63, 0x6b, 0x2f, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x12, 0x05, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x22, 0x8f, 0x01, 0x0a, 0x05, 0x53, 0x74, 0x61,
0x63, 0x6b, 0x12, 0x24, 0x0a, 0x06, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03,
0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x46, 0x72, 0x61, 0x6d, 0x65,
0x52, 0x06, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6d, 0x64, 0x6c,
0x69, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6d, 0x64, 0x6c, 0x69,
0x6e, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52,
0x03, 0x70, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18,
0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a,
0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09,
0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x43, 0x0a, 0x05, 0x46, 0x72,
0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x4c,
0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x4c, 0x69, 0x6e, 0x65, 0x42,
0x25, 0x5a, 0x23, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f,
0x62, 0x79, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x6b, 0x69, 0x74, 0x2f, 0x75, 0x74, 0x69, 0x6c,
0x2f, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_stack_proto_rawDescOnce sync.Once
file_stack_proto_rawDescData = file_stack_proto_rawDesc
file_github_com_moby_buildkit_util_stack_stack_proto_rawDescOnce sync.Once
file_github_com_moby_buildkit_util_stack_stack_proto_rawDescData = file_github_com_moby_buildkit_util_stack_stack_proto_rawDesc
)
func file_stack_proto_rawDescGZIP() []byte {
file_stack_proto_rawDescOnce.Do(func() {
file_stack_proto_rawDescData = protoimpl.X.CompressGZIP(file_stack_proto_rawDescData)
func file_github_com_moby_buildkit_util_stack_stack_proto_rawDescGZIP() []byte {
file_github_com_moby_buildkit_util_stack_stack_proto_rawDescOnce.Do(func() {
file_github_com_moby_buildkit_util_stack_stack_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_moby_buildkit_util_stack_stack_proto_rawDescData)
})
return file_stack_proto_rawDescData
return file_github_com_moby_buildkit_util_stack_stack_proto_rawDescData
}
var file_stack_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_stack_proto_goTypes = []interface{}{
var file_github_com_moby_buildkit_util_stack_stack_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_github_com_moby_buildkit_util_stack_stack_proto_goTypes = []interface{}{
(*Stack)(nil), // 0: stack.Stack
(*Frame)(nil), // 1: stack.Frame
}
var file_stack_proto_depIdxs = []int32{
var file_github_com_moby_buildkit_util_stack_stack_proto_depIdxs = []int32{
1, // 0: stack.Stack.frames:type_name -> stack.Frame
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
@ -209,13 +213,13 @@ var file_stack_proto_depIdxs = []int32{
0, // [0:1] is the sub-list for field type_name
}
func init() { file_stack_proto_init() }
func file_stack_proto_init() {
if File_stack_proto != nil {
func init() { file_github_com_moby_buildkit_util_stack_stack_proto_init() }
func file_github_com_moby_buildkit_util_stack_stack_proto_init() {
if File_github_com_moby_buildkit_util_stack_stack_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_stack_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_github_com_moby_buildkit_util_stack_stack_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Stack); i {
case 0:
return &v.state
@ -227,7 +231,7 @@ func file_stack_proto_init() {
return nil
}
}
file_stack_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_github_com_moby_buildkit_util_stack_stack_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Frame); i {
case 0:
return &v.state
@ -244,18 +248,18 @@ func file_stack_proto_init() {
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_stack_proto_rawDesc,
RawDescriptor: file_github_com_moby_buildkit_util_stack_stack_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_stack_proto_goTypes,
DependencyIndexes: file_stack_proto_depIdxs,
MessageInfos: file_stack_proto_msgTypes,
GoTypes: file_github_com_moby_buildkit_util_stack_stack_proto_goTypes,
DependencyIndexes: file_github_com_moby_buildkit_util_stack_stack_proto_depIdxs,
MessageInfos: file_github_com_moby_buildkit_util_stack_stack_proto_msgTypes,
}.Build()
File_stack_proto = out.File
file_stack_proto_rawDesc = nil
file_stack_proto_goTypes = nil
file_stack_proto_depIdxs = nil
File_github_com_moby_buildkit_util_stack_stack_proto = out.File
file_github_com_moby_buildkit_util_stack_stack_proto_rawDesc = nil
file_github_com_moby_buildkit_util_stack_stack_proto_goTypes = nil
file_github_com_moby_buildkit_util_stack_stack_proto_depIdxs = nil
}

View File

@ -2,6 +2,8 @@ syntax = "proto3";
package stack;
option go_package = "github.com/moby/buildkit/util/stack";
message Stack {
repeated Frame frames = 1;
repeated string cmdline = 2;
@ -14,4 +16,4 @@ message Frame {
string Name = 1;
string File = 2;
int32 Line = 3;
}
}

View File

@ -0,0 +1,660 @@
// Code generated by protoc-gen-go-vtproto. DO NOT EDIT.
// protoc-gen-go-vtproto version: v0.6.1-0.20240319094008-0393e58bdf10
// source: github.com/moby/buildkit/util/stack/stack.proto
package stack
import (
fmt "fmt"
protohelpers "github.com/planetscale/vtprotobuf/protohelpers"
proto "google.golang.org/protobuf/proto"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
io "io"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
func (m *Stack) CloneVT() *Stack {
if m == nil {
return (*Stack)(nil)
}
r := new(Stack)
r.Pid = m.Pid
r.Version = m.Version
r.Revision = m.Revision
if rhs := m.Frames; rhs != nil {
tmpContainer := make([]*Frame, len(rhs))
for k, v := range rhs {
tmpContainer[k] = v.CloneVT()
}
r.Frames = tmpContainer
}
if rhs := m.Cmdline; rhs != nil {
tmpContainer := make([]string, len(rhs))
copy(tmpContainer, rhs)
r.Cmdline = tmpContainer
}
if len(m.unknownFields) > 0 {
r.unknownFields = make([]byte, len(m.unknownFields))
copy(r.unknownFields, m.unknownFields)
}
return r
}
func (m *Stack) CloneMessageVT() proto.Message {
return m.CloneVT()
}
func (m *Frame) CloneVT() *Frame {
if m == nil {
return (*Frame)(nil)
}
r := new(Frame)
r.Name = m.Name
r.File = m.File
r.Line = m.Line
if len(m.unknownFields) > 0 {
r.unknownFields = make([]byte, len(m.unknownFields))
copy(r.unknownFields, m.unknownFields)
}
return r
}
func (m *Frame) CloneMessageVT() proto.Message {
return m.CloneVT()
}
func (this *Stack) EqualVT(that *Stack) bool {
if this == that {
return true
} else if this == nil || that == nil {
return false
}
if len(this.Frames) != len(that.Frames) {
return false
}
for i, vx := range this.Frames {
vy := that.Frames[i]
if p, q := vx, vy; p != q {
if p == nil {
p = &Frame{}
}
if q == nil {
q = &Frame{}
}
if !p.EqualVT(q) {
return false
}
}
}
if len(this.Cmdline) != len(that.Cmdline) {
return false
}
for i, vx := range this.Cmdline {
vy := that.Cmdline[i]
if vx != vy {
return false
}
}
if this.Pid != that.Pid {
return false
}
if this.Version != that.Version {
return false
}
if this.Revision != that.Revision {
return false
}
return string(this.unknownFields) == string(that.unknownFields)
}
func (this *Stack) EqualMessageVT(thatMsg proto.Message) bool {
that, ok := thatMsg.(*Stack)
if !ok {
return false
}
return this.EqualVT(that)
}
func (this *Frame) EqualVT(that *Frame) bool {
if this == that {
return true
} else if this == nil || that == nil {
return false
}
if this.Name != that.Name {
return false
}
if this.File != that.File {
return false
}
if this.Line != that.Line {
return false
}
return string(this.unknownFields) == string(that.unknownFields)
}
func (this *Frame) EqualMessageVT(thatMsg proto.Message) bool {
that, ok := thatMsg.(*Frame)
if !ok {
return false
}
return this.EqualVT(that)
}
func (m *Stack) MarshalVT() (dAtA []byte, err error) {
if m == nil {
return nil, nil
}
size := m.SizeVT()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBufferVT(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Stack) MarshalToVT(dAtA []byte) (int, error) {
size := m.SizeVT()
return m.MarshalToSizedBufferVT(dAtA[:size])
}
func (m *Stack) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
if m == nil {
return 0, nil
}
i := len(dAtA)
_ = i
var l int
_ = l
if m.unknownFields != nil {
i -= len(m.unknownFields)
copy(dAtA[i:], m.unknownFields)
}
if len(m.Revision) > 0 {
i -= len(m.Revision)
copy(dAtA[i:], m.Revision)
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Revision)))
i--
dAtA[i] = 0x2a
}
if len(m.Version) > 0 {
i -= len(m.Version)
copy(dAtA[i:], m.Version)
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Version)))
i--
dAtA[i] = 0x22
}
if m.Pid != 0 {
i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Pid))
i--
dAtA[i] = 0x18
}
if len(m.Cmdline) > 0 {
for iNdEx := len(m.Cmdline) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.Cmdline[iNdEx])
copy(dAtA[i:], m.Cmdline[iNdEx])
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Cmdline[iNdEx])))
i--
dAtA[i] = 0x12
}
}
if len(m.Frames) > 0 {
for iNdEx := len(m.Frames) - 1; iNdEx >= 0; iNdEx-- {
size, err := m.Frames[iNdEx].MarshalToSizedBufferVT(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = protohelpers.EncodeVarint(dAtA, i, uint64(size))
i--
dAtA[i] = 0xa
}
}
return len(dAtA) - i, nil
}
func (m *Frame) MarshalVT() (dAtA []byte, err error) {
if m == nil {
return nil, nil
}
size := m.SizeVT()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBufferVT(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Frame) MarshalToVT(dAtA []byte) (int, error) {
size := m.SizeVT()
return m.MarshalToSizedBufferVT(dAtA[:size])
}
func (m *Frame) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
if m == nil {
return 0, nil
}
i := len(dAtA)
_ = i
var l int
_ = l
if m.unknownFields != nil {
i -= len(m.unknownFields)
copy(dAtA[i:], m.unknownFields)
}
if m.Line != 0 {
i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Line))
i--
dAtA[i] = 0x18
}
if len(m.File) > 0 {
i -= len(m.File)
copy(dAtA[i:], m.File)
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.File)))
i--
dAtA[i] = 0x12
}
if len(m.Name) > 0 {
i -= len(m.Name)
copy(dAtA[i:], m.Name)
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *Stack) SizeVT() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if len(m.Frames) > 0 {
for _, e := range m.Frames {
l = e.SizeVT()
n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
}
}
if len(m.Cmdline) > 0 {
for _, s := range m.Cmdline {
l = len(s)
n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
}
}
if m.Pid != 0 {
n += 1 + protohelpers.SizeOfVarint(uint64(m.Pid))
}
l = len(m.Version)
if l > 0 {
n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
}
l = len(m.Revision)
if l > 0 {
n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
}
n += len(m.unknownFields)
return n
}
func (m *Frame) SizeVT() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Name)
if l > 0 {
n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
}
l = len(m.File)
if l > 0 {
n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
}
if m.Line != 0 {
n += 1 + protohelpers.SizeOfVarint(uint64(m.Line))
}
n += len(m.unknownFields)
return n
}
func (m *Stack) UnmarshalVT(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protohelpers.ErrIntOverflow
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: Stack: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Stack: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Frames", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protohelpers.ErrIntOverflow
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return protohelpers.ErrInvalidLength
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return protohelpers.ErrInvalidLength
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Frames = append(m.Frames, &Frame{})
if err := m.Frames[len(m.Frames)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Cmdline", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protohelpers.ErrIntOverflow
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protohelpers.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protohelpers.ErrInvalidLength
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Cmdline = append(m.Cmdline, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Pid", wireType)
}
m.Pid = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protohelpers.ErrIntOverflow
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Pid |= int32(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protohelpers.ErrIntOverflow
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protohelpers.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protohelpers.ErrInvalidLength
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Version = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 5:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protohelpers.ErrIntOverflow
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protohelpers.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protohelpers.ErrInvalidLength
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Revision = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := protohelpers.Skip(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protohelpers.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *Frame) UnmarshalVT(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protohelpers.ErrIntOverflow
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: Frame: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Frame: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protohelpers.ErrIntOverflow
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protohelpers.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protohelpers.ErrInvalidLength
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Name = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field File", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protohelpers.ErrIntOverflow
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protohelpers.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protohelpers.ErrInvalidLength
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.File = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Line", wireType)
}
m.Line = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protohelpers.ErrIntOverflow
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Line |= int32(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := protohelpers.Skip(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protohelpers.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}