mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
protobuf: remove gogoproto
Removes gogo/protobuf from buildx and updates to a version of moby/buildkit where gogo is removed. This also changes how the proto files are generated. This is because newer versions of protobuf are more strict about name conflicts. If two files have the same name (even if they are relative paths) and are used in different protoc commands, they'll conflict in the registry. Since protobuf file generation doesn't work very well with `paths=source_relative`, this removes the `go:generate` expression and just relies on the dockerfile to perform the generation. Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
This commit is contained in:
11
vendor/github.com/moby/buildkit/solver/errdefs/source.go
generated
vendored
11
vendor/github.com/moby/buildkit/solver/errdefs/source.go
generated
vendored
@ -8,9 +8,10 @@ import (
|
||||
pb "github.com/moby/buildkit/solver/pb"
|
||||
"github.com/moby/buildkit/util/grpcerrors"
|
||||
"github.com/pkg/errors"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
func WithSource(err error, src Source) error {
|
||||
func WithSource(err error, src *Source) error {
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
@ -18,7 +19,7 @@ func WithSource(err error, src Source) error {
|
||||
}
|
||||
|
||||
type ErrorSource struct {
|
||||
Source
|
||||
*Source
|
||||
error
|
||||
}
|
||||
|
||||
@ -27,7 +28,7 @@ func (e *ErrorSource) Unwrap() error {
|
||||
}
|
||||
|
||||
func (e *ErrorSource) ToProto() grpcerrors.TypedErrorProto {
|
||||
return &e.Source
|
||||
return e.Source
|
||||
}
|
||||
|
||||
func Sources(err error) []*Source {
|
||||
@ -35,13 +36,13 @@ func Sources(err error) []*Source {
|
||||
var es *ErrorSource
|
||||
if errors.As(err, &es) {
|
||||
out = Sources(es.Unwrap())
|
||||
out = append(out, &es.Source)
|
||||
out = append(out, proto.Clone(es.Source).(*Source))
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func (s *Source) WrapError(err error) error {
|
||||
return &ErrorSource{error: err, Source: *s}
|
||||
return &ErrorSource{error: err, Source: s}
|
||||
}
|
||||
|
||||
func (s *Source) Print(w io.Writer) error {
|
||||
|
Reference in New Issue
Block a user