mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-12 14:37:08 +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:
28
vendor/google.golang.org/grpc/preloader.go
generated
vendored
28
vendor/google.golang.org/grpc/preloader.go
generated
vendored
@ -20,6 +20,7 @@ package grpc
|
||||
|
||||
import (
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/mem"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
@ -31,9 +32,10 @@ import (
|
||||
// later release.
|
||||
type PreparedMsg struct {
|
||||
// Struct for preparing msg before sending them
|
||||
encodedData []byte
|
||||
encodedData mem.BufferSlice
|
||||
hdr []byte
|
||||
payload []byte
|
||||
payload mem.BufferSlice
|
||||
pf payloadFormat
|
||||
}
|
||||
|
||||
// Encode marshalls and compresses the message using the codec and compressor for the stream.
|
||||
@ -57,11 +59,27 @@ func (p *PreparedMsg) Encode(s Stream, msg any) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
p.encodedData = data
|
||||
compData, err := compress(data, rpcInfo.preloaderInfo.cp, rpcInfo.preloaderInfo.comp)
|
||||
|
||||
materializedData := data.Materialize()
|
||||
data.Free()
|
||||
p.encodedData = mem.BufferSlice{mem.NewBuffer(&materializedData, nil)}
|
||||
|
||||
// TODO: it should be possible to grab the bufferPool from the underlying
|
||||
// stream implementation with a type cast to its actual type (such as
|
||||
// addrConnStream) and accessing the buffer pool directly.
|
||||
var compData mem.BufferSlice
|
||||
compData, p.pf, err = compress(p.encodedData, rpcInfo.preloaderInfo.cp, rpcInfo.preloaderInfo.comp, mem.DefaultBufferPool())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
p.hdr, p.payload = msgHeader(data, compData)
|
||||
|
||||
if p.pf.isCompressed() {
|
||||
materializedCompData := compData.Materialize()
|
||||
compData.Free()
|
||||
compData = mem.BufferSlice{mem.NewBuffer(&materializedCompData, nil)}
|
||||
}
|
||||
|
||||
p.hdr, p.payload = msgHeader(p.encodedData, compData, p.pf)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user