mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-18 01:08:03 +08:00
vendor: update buildkit to v0.11@348e79dfed17
Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
5
vendor/github.com/moby/buildkit/client/llb/definition.go
generated
vendored
5
vendor/github.com/moby/buildkit/client/llb/definition.go
generated
vendored
@@ -29,6 +29,10 @@ type DefinitionOp struct {
|
||||
|
||||
// NewDefinitionOp returns a new operation from a marshalled definition.
|
||||
func NewDefinitionOp(def *pb.Definition) (*DefinitionOp, error) {
|
||||
if def == nil {
|
||||
return nil, errors.New("invalid nil input definition to definition op")
|
||||
}
|
||||
|
||||
ops := make(map[digest.Digest]*pb.Op)
|
||||
defs := make(map[digest.Digest][]byte)
|
||||
platforms := make(map[digest.Digest]*ocispecs.Platform)
|
||||
@@ -205,6 +209,7 @@ func (d *DefinitionOp) Inputs() []Output {
|
||||
dgst: input.Digest,
|
||||
index: input.Index,
|
||||
inputCache: d.inputCache,
|
||||
sources: d.sources,
|
||||
}
|
||||
existingIndexes := d.inputCache[input.Digest]
|
||||
indexDiff := int(input.Index) - len(existingIndexes)
|
||||
|
2
vendor/github.com/moby/buildkit/exporter/containerimage/exptypes/types.go
generated
vendored
2
vendor/github.com/moby/buildkit/exporter/containerimage/exptypes/types.go
generated
vendored
@@ -11,7 +11,7 @@ const (
|
||||
ExporterImageConfigDigestKey = "containerimage.config.digest"
|
||||
ExporterImageDescriptorKey = "containerimage.descriptor"
|
||||
ExporterInlineCache = "containerimage.inlinecache"
|
||||
ExporterBuildInfo = "containerimage.buildinfo"
|
||||
ExporterBuildInfo = "containerimage.buildinfo" // Deprecated: Build information is deprecated: https://github.com/moby/buildkit/blob/master/docs/deprecated.md
|
||||
ExporterPlatformsKey = "refs.platforms"
|
||||
ExporterEpochKey = "source.date.epoch"
|
||||
)
|
||||
|
4
vendor/github.com/moby/buildkit/frontend/gateway/grpcclient/client.go
generated
vendored
4
vendor/github.com/moby/buildkit/frontend/gateway/grpcclient/client.go
generated
vendored
@@ -927,11 +927,11 @@ func (ctr *container) Start(ctx context.Context, req client.StartRequest) (clien
|
||||
|
||||
if msg == nil {
|
||||
// empty message from ctx cancel, so just start shutting down
|
||||
// input, but continue processing more exit/done messages
|
||||
// input
|
||||
closeDoneOnce.Do(func() {
|
||||
close(done)
|
||||
})
|
||||
continue
|
||||
return ctx.Err()
|
||||
}
|
||||
|
||||
if file := msg.GetFile(); file != nil {
|
||||
|
29
vendor/github.com/moby/buildkit/session/session.go
generated
vendored
29
vendor/github.com/moby/buildkit/session/session.go
generated
vendored
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"net"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
|
||||
"github.com/moby/buildkit/identity"
|
||||
@@ -36,14 +37,16 @@ type Attachable interface {
|
||||
|
||||
// Session is a long running connection between client and a daemon
|
||||
type Session struct {
|
||||
id string
|
||||
name string
|
||||
sharedKey string
|
||||
ctx context.Context
|
||||
cancelCtx func()
|
||||
done chan struct{}
|
||||
grpcServer *grpc.Server
|
||||
conn net.Conn
|
||||
mu sync.Mutex // synchronizes conn run and close
|
||||
id string
|
||||
name string
|
||||
sharedKey string
|
||||
ctx context.Context
|
||||
cancelCtx func()
|
||||
done chan struct{}
|
||||
grpcServer *grpc.Server
|
||||
conn net.Conn
|
||||
closeCalled bool
|
||||
}
|
||||
|
||||
// NewSession returns a new long running session
|
||||
@@ -99,6 +102,11 @@ func (s *Session) ID() string {
|
||||
|
||||
// Run activates the session
|
||||
func (s *Session) Run(ctx context.Context, dialer Dialer) error {
|
||||
s.mu.Lock()
|
||||
if s.closeCalled {
|
||||
s.mu.Unlock()
|
||||
return nil
|
||||
}
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
s.cancelCtx = cancel
|
||||
s.done = make(chan struct{})
|
||||
@@ -118,15 +126,18 @@ func (s *Session) Run(ctx context.Context, dialer Dialer) error {
|
||||
}
|
||||
conn, err := dialer(ctx, "h2c", meta)
|
||||
if err != nil {
|
||||
s.mu.Unlock()
|
||||
return errors.Wrap(err, "failed to dial gRPC")
|
||||
}
|
||||
s.conn = conn
|
||||
s.mu.Unlock()
|
||||
serve(ctx, s.grpcServer, conn)
|
||||
return nil
|
||||
}
|
||||
|
||||
// Close closes the session
|
||||
func (s *Session) Close() error {
|
||||
s.mu.Lock()
|
||||
if s.cancelCtx != nil && s.done != nil {
|
||||
if s.conn != nil {
|
||||
s.conn.Close()
|
||||
@@ -134,6 +145,8 @@ func (s *Session) Close() error {
|
||||
s.grpcServer.Stop()
|
||||
<-s.done
|
||||
}
|
||||
s.closeCalled = true
|
||||
s.mu.Unlock()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
3
vendor/github.com/moby/buildkit/util/buildinfo/types/types.go
generated
vendored
3
vendor/github.com/moby/buildkit/util/buildinfo/types/types.go
generated
vendored
@@ -1,3 +1,6 @@
|
||||
// Package binfotypes implements types for build information.
|
||||
//
|
||||
// Deprecated: Build information is deprecated: https://github.com/moby/buildkit/blob/master/docs/deprecated.md
|
||||
package binfotypes
|
||||
|
||||
import (
|
||||
|
16
vendor/github.com/moby/buildkit/util/gitutil/git_ref.go
generated
vendored
16
vendor/github.com/moby/buildkit/util/gitutil/git_ref.go
generated
vendored
@@ -73,22 +73,12 @@ func ParseGitRef(ref string) (*GitRef, error) {
|
||||
}
|
||||
}
|
||||
|
||||
refSplitBySharp := strings.SplitN(ref, "#", 2)
|
||||
res.Remote = refSplitBySharp[0]
|
||||
var fragment string
|
||||
res.Remote, fragment, _ = strings.Cut(ref, "#")
|
||||
if len(res.Remote) == 0 {
|
||||
return res, errdefs.ErrInvalidArgument
|
||||
}
|
||||
|
||||
if len(refSplitBySharp) > 1 {
|
||||
refSplitBySharpSplitByColon := strings.SplitN(refSplitBySharp[1], ":", 2)
|
||||
res.Commit = refSplitBySharpSplitByColon[0]
|
||||
if len(res.Commit) == 0 {
|
||||
return res, errdefs.ErrInvalidArgument
|
||||
}
|
||||
if len(refSplitBySharpSplitByColon) > 1 {
|
||||
res.SubDir = refSplitBySharpSplitByColon[1]
|
||||
}
|
||||
}
|
||||
res.Commit, res.SubDir, _ = strings.Cut(fragment, ":")
|
||||
repoSplitBySlash := strings.Split(res.Remote, "/")
|
||||
res.ShortName = strings.TrimSuffix(repoSplitBySlash[len(repoSplitBySlash)-1], ".git")
|
||||
return res, nil
|
||||
|
2
vendor/github.com/moby/buildkit/util/imageutil/buildinfo.go
generated
vendored
2
vendor/github.com/moby/buildkit/util/imageutil/buildinfo.go
generated
vendored
@@ -9,6 +9,8 @@ import (
|
||||
)
|
||||
|
||||
// BuildInfo returns build info from image config.
|
||||
//
|
||||
// Deprecated: Build information is deprecated: https://github.com/moby/buildkit/blob/master/docs/deprecated.md
|
||||
func BuildInfo(dt []byte) (*binfotypes.BuildInfo, error) {
|
||||
if len(dt) == 0 {
|
||||
return nil, nil
|
||||
|
2
vendor/github.com/moby/buildkit/util/progress/progressui/init.go
generated
vendored
2
vendor/github.com/moby/buildkit/util/progress/progressui/init.go
generated
vendored
@@ -14,7 +14,7 @@ var colorError aec.ANSI
|
||||
|
||||
func init() {
|
||||
// As recommended on https://no-color.org/
|
||||
if _, ok := os.LookupEnv("NO_COLOR"); ok {
|
||||
if v := os.Getenv("NO_COLOR"); v != "" {
|
||||
// nil values will result in no ANSI color codes being emitted.
|
||||
return
|
||||
} else if runtime.GOOS == "windows" {
|
||||
|
Reference in New Issue
Block a user