vendor: update buildkit

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2023-02-10 18:19:57 +01:00
parent b1949b7388
commit 8311b0963a
433 changed files with 34791 additions and 13411 deletions

View File

@ -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++

View File

@ -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
}

View File

@ -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,
})

View File

@ -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

View File

@ -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 {

View File

@ -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" {

View File

@ -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
}

View File

@ -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

View File

@ -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"
)

View File

@ -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"
)