From 9aa66be7ec598ed9962389ee69c16913139edee9 Mon Sep 17 00:00:00 2001 From: "Jonathan A. Sternberg" Date: Tue, 29 Apr 2025 14:49:26 -0500 Subject: [PATCH] vendor: github.com/moby/buildkit v0.21.1 Signed-off-by: Jonathan A. Sternberg --- vendor.mod | 2 +- vendor.sum | 4 +-- .../moby/buildkit/control/control.go | 3 ++ .../moby/buildkit/frontend/dockerui/build.go | 30 +++++++++++-------- vendor/modules.txt | 2 +- 5 files changed, 25 insertions(+), 16 deletions(-) diff --git a/vendor.mod b/vendor.mod index 352b22dcf6..943184dca9 100644 --- a/vendor.mod +++ b/vendor.mod @@ -62,7 +62,7 @@ require ( github.com/miekg/dns v1.1.61 github.com/mistifyio/go-zfs/v3 v3.0.1 github.com/mitchellh/copystructure v1.2.0 - github.com/moby/buildkit v0.21.0 + github.com/moby/buildkit v0.21.1 github.com/moby/docker-image-spec v1.3.1 github.com/moby/go-archive v0.1.0 github.com/moby/ipvs v1.1.0 diff --git a/vendor.sum b/vendor.sum index d8a717130b..c692fdb53f 100644 --- a/vendor.sum +++ b/vendor.sum @@ -383,8 +383,8 @@ github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:F github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mndrix/tap-go v0.0.0-20171203230836-629fa407e90b/go.mod h1:pzzDgJWZ34fGzaAZGFW22KVZDfyrYW+QABMrWnJBnSs= -github.com/moby/buildkit v0.21.0 h1:+z4vVqgt0spLrOSxi4DLedRbIh2gbNVlZ5q4rsnNp60= -github.com/moby/buildkit v0.21.0/go.mod h1:mBq0D44uCyz2PdX8T/qym5LBbkBO3GGv0wqgX9ABYYw= +github.com/moby/buildkit v0.21.1 h1:wTjVLfirh7skZt9piaIlNo8WdiPjza1CDl2EArDV9bA= +github.com/moby/buildkit v0.21.1/go.mod h1:mBq0D44uCyz2PdX8T/qym5LBbkBO3GGv0wqgX9ABYYw= github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= github.com/moby/go-archive v0.1.0 h1:Kk/5rdW/g+H8NHdJW2gsXyZ7UnzvJNOy6VKJqueWdcQ= diff --git a/vendor/github.com/moby/buildkit/control/control.go b/vendor/github.com/moby/buildkit/control/control.go index a86f7dc5ae..dc73be3da0 100644 --- a/vendor/github.com/moby/buildkit/control/control.go +++ b/vendor/github.com/moby/buildkit/control/control.go @@ -376,6 +376,9 @@ func (c *Controller) Solve(ctx context.Context, req *controlapi.SolveRequest) (* atomic.AddInt64(&c.buildCount, 1) defer atomic.AddInt64(&c.buildCount, -1) + if req.Cache == nil { + req.Cache = &controlapi.CacheOptions{} // make sure cache options are initialized + } translateLegacySolveRequest(req) defer func() { diff --git a/vendor/github.com/moby/buildkit/frontend/dockerui/build.go b/vendor/github.com/moby/buildkit/frontend/dockerui/build.go index fe2dbd05de..6ced71d677 100644 --- a/vendor/github.com/moby/buildkit/frontend/dockerui/build.go +++ b/vendor/github.com/moby/buildkit/frontend/dockerui/build.go @@ -61,16 +61,12 @@ func (bc *Client) Build(ctx context.Context, fn BuildFunc) (*ResultBuilder, erro } else { p = platforms.DefaultSpec() } - - k := platforms.FormatAll(p) - p = extendWindowsPlatform(p, img.Platform) - p = platforms.Normalize(p) - + expPlat := makeExportPlatform(p, img.Platform) if bc.MultiPlatformRequested { - res.AddRef(k, ref) - res.AddMeta(fmt.Sprintf("%s/%s", exptypes.ExporterImageConfigKey, k), config) + res.AddRef(expPlat.ID, ref) + res.AddMeta(fmt.Sprintf("%s/%s", exptypes.ExporterImageConfigKey, expPlat.ID), config) if len(baseConfig) > 0 { - res.AddMeta(fmt.Sprintf("%s/%s", exptypes.ExporterImageBaseConfigKey, k), baseConfig) + res.AddMeta(fmt.Sprintf("%s/%s", exptypes.ExporterImageBaseConfigKey, expPlat.ID), baseConfig) } } else { res.SetRef(ref) @@ -79,10 +75,7 @@ func (bc *Client) Build(ctx context.Context, fn BuildFunc) (*ResultBuilder, erro res.AddMeta(exptypes.ExporterImageBaseConfigKey, baseConfig) } } - expPlatforms.Platforms[i] = exptypes.Platform{ - ID: k, - Platform: p, - } + expPlatforms.Platforms[i] = expPlat return nil }) } @@ -133,3 +126,16 @@ func extendWindowsPlatform(p, imgP ocispecs.Platform) ocispecs.Platform { } return p } + +func makeExportPlatform(p, imgP ocispecs.Platform) exptypes.Platform { + p = platforms.Normalize(p) + exp := exptypes.Platform{ + ID: platforms.FormatAll(p), + } + if p.OS == "windows" { + p = extendWindowsPlatform(p, imgP) + p = platforms.Normalize(p) + } + exp.Platform = p + return exp +} diff --git a/vendor/modules.txt b/vendor/modules.txt index f002e741a9..3936f96b9b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -758,7 +758,7 @@ github.com/mitchellh/hashstructure/v2 # github.com/mitchellh/reflectwalk v1.0.2 ## explicit github.com/mitchellh/reflectwalk -# github.com/moby/buildkit v0.21.0 +# github.com/moby/buildkit v0.21.1 ## explicit; go 1.23.0 github.com/moby/buildkit/api/services/control github.com/moby/buildkit/api/types