mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update buildkit
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
2
vendor/github.com/moby/buildkit/client/llb/exec.go
generated
vendored
2
vendor/github.com/moby/buildkit/client/llb/exec.go
generated
vendored
@ -339,7 +339,7 @@ func (e *ExecOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []
|
||||
inputIndex = pb.Empty
|
||||
}
|
||||
|
||||
outputIndex := pb.OutputIndex(-1)
|
||||
outputIndex := pb.SkipOutput
|
||||
if !m.noOutput && !m.readonly && m.cacheID == "" && !m.tmpfs {
|
||||
outputIndex = pb.OutputIndex(outIndex)
|
||||
outIndex++
|
||||
|
2
vendor/github.com/moby/buildkit/client/llb/fileop.go
generated
vendored
2
vendor/github.com/moby/buildkit/client/llb/fileop.go
generated
vendored
@ -702,7 +702,7 @@ func (f *FileOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []
|
||||
pop.Inputs = state.inputs
|
||||
|
||||
for i, st := range state.actions {
|
||||
output := pb.OutputIndex(-1)
|
||||
output := pb.SkipOutput
|
||||
if i+1 == len(state.actions) {
|
||||
output = 0
|
||||
}
|
||||
|
4
vendor/github.com/moby/buildkit/solver/pb/caps.go
generated
vendored
4
vendor/github.com/moby/buildkit/solver/pb/caps.go
generated
vendored
@ -49,7 +49,7 @@ const (
|
||||
CapExecMetaUlimit apicaps.CapID = "exec.meta.ulimit"
|
||||
CapExecMetaRemoveMountStubsRecursive apicaps.CapID = "exec.meta.removemountstubs.recursive"
|
||||
CapExecMountBind apicaps.CapID = "exec.mount.bind"
|
||||
CapExecMountBindReadWriteNoOuput apicaps.CapID = "exec.mount.bind.readwrite-nooutput"
|
||||
CapExecMountBindReadWriteNoOutput apicaps.CapID = "exec.mount.bind.readwrite-nooutput"
|
||||
CapExecMountCache apicaps.CapID = "exec.mount.cache"
|
||||
CapExecMountCacheSharing apicaps.CapID = "exec.mount.cache.sharing"
|
||||
CapExecMountSelector apicaps.CapID = "exec.mount.selector"
|
||||
@ -288,7 +288,7 @@ func init() {
|
||||
})
|
||||
|
||||
Caps.Init(apicaps.Cap{
|
||||
ID: CapExecMountBindReadWriteNoOuput,
|
||||
ID: CapExecMountBindReadWriteNoOutput,
|
||||
Enabled: true,
|
||||
Status: apicaps.CapStatusExperimental,
|
||||
})
|
||||
|
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
|
||||
|
39
vendor/github.com/moby/buildkit/util/progress/progressui/display.go
generated
vendored
39
vendor/github.com/moby/buildkit/util/progress/progressui/display.go
generated
vendored
@ -21,11 +21,37 @@ import (
|
||||
"golang.org/x/time/rate"
|
||||
)
|
||||
|
||||
func DisplaySolveStatus(ctx context.Context, phase string, c console.Console, w io.Writer, ch chan *client.SolveStatus) ([]client.VertexWarning, error) {
|
||||
type displaySolveStatusOpts struct {
|
||||
phase string
|
||||
textDesc string
|
||||
consoleDesc string
|
||||
}
|
||||
|
||||
type DisplaySolveStatusOpt func(b *displaySolveStatusOpts)
|
||||
|
||||
func WithPhase(phase string) DisplaySolveStatusOpt {
|
||||
return func(b *displaySolveStatusOpts) {
|
||||
b.phase = phase
|
||||
}
|
||||
}
|
||||
|
||||
func WithDesc(text string, console string) DisplaySolveStatusOpt {
|
||||
return func(b *displaySolveStatusOpts) {
|
||||
b.textDesc = text
|
||||
b.consoleDesc = console
|
||||
}
|
||||
}
|
||||
|
||||
func DisplaySolveStatus(ctx context.Context, c console.Console, w io.Writer, ch chan *client.SolveStatus, opts ...DisplaySolveStatusOpt) ([]client.VertexWarning, error) {
|
||||
modeConsole := c != nil
|
||||
|
||||
disp := &display{c: c, phase: phase}
|
||||
printer := &textMux{w: w}
|
||||
dsso := &displaySolveStatusOpts{}
|
||||
for _, opt := range opts {
|
||||
opt(dsso)
|
||||
}
|
||||
|
||||
disp := &display{c: c, phase: dsso.phase, desc: dsso.consoleDesc}
|
||||
printer := &textMux{w: w, desc: dsso.textDesc}
|
||||
|
||||
if disp.phase == "" {
|
||||
disp.phase = "Building"
|
||||
@ -711,6 +737,7 @@ func addTime(tm *time.Time, d time.Duration) *time.Time {
|
||||
type display struct {
|
||||
c console.Console
|
||||
phase string
|
||||
desc string
|
||||
lineCount int
|
||||
repeated bool
|
||||
}
|
||||
@ -784,7 +811,11 @@ func (disp *display) print(d displayInfo, width, height int, all bool) {
|
||||
defer fmt.Fprint(disp.c, aec.Show)
|
||||
|
||||
out := fmt.Sprintf("[+] %s %.1fs (%d/%d) %s", disp.phase, time.Since(d.startTime).Seconds(), d.countCompleted, d.countTotal, statusStr)
|
||||
out = align(out, "", width)
|
||||
if disp.desc != "" {
|
||||
out = align(out, disp.desc, width-1)
|
||||
} else {
|
||||
out = align(out, "", width)
|
||||
}
|
||||
fmt.Fprintln(disp.c, out)
|
||||
lineCount := 0
|
||||
for _, j := range d.jobs {
|
||||
|
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" {
|
||||
|
4
vendor/github.com/moby/buildkit/util/progress/progressui/printer.go
generated
vendored
4
vendor/github.com/moby/buildkit/util/progress/progressui/printer.go
generated
vendored
@ -32,6 +32,7 @@ type textMux struct {
|
||||
last map[string]lastStatus
|
||||
notFirst bool
|
||||
nextIndex int
|
||||
desc string
|
||||
}
|
||||
|
||||
func (p *textMux) printVtx(t *trace, dgst digest.Digest) {
|
||||
@ -63,6 +64,9 @@ func (p *textMux) printVtx(t *trace, dgst digest.Digest) {
|
||||
if p.notFirst {
|
||||
fmt.Fprintln(p.w, "")
|
||||
} else {
|
||||
if p.desc != "" {
|
||||
fmt.Fprintf(p.w, "#0 %s\n\n", p.desc)
|
||||
}
|
||||
p.notFirst = true
|
||||
}
|
||||
|
||||
|
2
vendor/github.com/moby/buildkit/util/progress/progresswriter/printer.go
generated
vendored
2
vendor/github.com/moby/buildkit/util/progress/progresswriter/printer.go
generated
vendored
@ -87,7 +87,7 @@ func NewPrinter(ctx context.Context, out console.File, mode string) (Writer, err
|
||||
|
||||
go func() {
|
||||
// not using shared context to not disrupt display but let is finish reporting errors
|
||||
_, pw.err = progressui.DisplaySolveStatus(ctx, "", c, out, statusCh)
|
||||
_, pw.err = progressui.DisplaySolveStatus(ctx, c, out, statusCh)
|
||||
close(doneCh)
|
||||
}()
|
||||
return pw, nil
|
||||
|
2
vendor/github.com/moby/buildkit/util/tracing/detect/detect.go
generated
vendored
2
vendor/github.com/moby/buildkit/util/tracing/detect/detect.go
generated
vendored
@ -12,7 +12,7 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
"go.opentelemetry.io/otel/sdk/resource"
|
||||
sdktrace "go.opentelemetry.io/otel/sdk/trace"
|
||||
semconv "go.opentelemetry.io/otel/semconv/v1.7.0"
|
||||
semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
)
|
||||
|
||||
|
2
vendor/github.com/moby/buildkit/util/tracing/tracing.go
generated
vendored
2
vendor/github.com/moby/buildkit/util/tracing/tracing.go
generated
vendored
@ -12,7 +12,7 @@ import (
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/codes"
|
||||
"go.opentelemetry.io/otel/propagation"
|
||||
semconv "go.opentelemetry.io/otel/semconv/v1.7.0"
|
||||
semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user