Repository navigation
Upgrade to buildx v0.38 and buildkit v0.34 - #627
jacobwgillespie wants to merge 56 commits into
Conversation
Replace the forked buildx v0.10 code and the depot/buildkit fork with upstream buildx v0.38.0 and buildkit v0.34.0. The build and bake commands now call buildx build.Build and the bake package. A Depot buildx driver keeps the per-machine responses, the shared context keys, and the build history settings that the fork provided.
The harness builds the CLI from a baseline revision and from the working tree, runs each scenario with both against local buildkitd, registry, and Depot API stand-ins, and compares the results.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Go 1.26 no longer supports windows/arm.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 27d048b090
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
After a multi-platform push, --iidfile now contains the digest of the merged image index. --lint now checks a Dockerfile given as a URL, and a Dockerfile from standard input with a remote context.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 400b1e0d86
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ListDepotNodes listed every container, because filters.FuzzyMatch does not add a filter. Containers of other programs with four underscores in their names were then removed by configure-docker --uninstall and by the driver update.
--lint now reads the Dockerfile from a bzip2, xz, or zstd context archive on standard input. A remote bake definition with targets of another project now fails with an error instead of skipping them.
The project of a compose service was applied after bake resolved the targets, and matched only by service name. A target that inherited a compose service lost the project, and the project of the compose service replaced the project_id of an HCL target with the same name. The compose project IDs are now written as an HCL file of target descriptions that comes before the other HCL files, so bake applies inheritance and the merge order of files to them.
The forked buildx set the SOURCE_DATE_EPOCH build argument from the environment. Upstream buildx sets it in its own commands, which Depot does not use. build, bake, and bake --print now set it again, unless the build arguments already contain it.
--load with an -o output that is not an image loaded nothing. Through the Depot registry, the old CLI failed with "multiple outputs currently unsupported"; otherwise it ignored --load. --load now adds an image output next to the other outputs and loads it, as buildx does.
Risk: high. Dismissed the prior approval because Cursor Bugbot left an unresolved potential issue after that approval. Human review is needed and no reviewers were assigned.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b647d61a3a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- A reference such as target.base.project_id failed, because project_id was removed before bake read the files. project_id is now moved into the description of each target for the build too, and references to it are renamed. One read of the files gives the build options and the project of each target. bake --print reads the descriptions separately. - The requested targets now come from the targets and groups that bake resolved, so target patterns such as 'mx-*' are loaded and listed in the metadata file. - Bake now prints the result of targets with a call attribute, and maps call = check to the lint request and call = build to a normal build, as buildx bake does. build and bake print check results and return their status code. Targets with a call are not loaded. - The CLI's own parse of compose files no longer repeats the warnings for unset variables that bake already prints.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 270fc0a693
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…riables, and a lowercase dockerfile
…t, and give whole-target reads project_id without projects
…, JSON template keys, and whole-target reads
…ion reads a whole target, and rewrite files in linear time
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a1f15d19ce
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ects, and self project reads with the project label
…icy entries from whole-target reads
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8f09f5e604
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…olicies cannot match it
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 201ed34296
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…solved project in a remote bake
There was a problem hiding this comment.
💡 Codex Review
cli/pkg/buildx/commands/build.go
Line 444 in bfb8b94
When depot build --cgroup-parent=... is used, validation still accepts the flag, but this options initializer no longer assigns in.cgroupParent to build.Options.CgroupParent. BuildKit therefore receives an empty parent and runs the build containers in its default cgroup, silently breaking resource-accounting or isolation setups that rely on the requested hierarchy. Include CgroupParent: in.cgroupParent in the options passed to the build.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Re the Codex review comment on |
Risk: high. Dismissing the prior approval because Cursor Bugbot reported an unresolved medium-severity finding on this head, so human review is needed and no reviewers were assigned.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0c07b64. Configure here.
Risk: high. Dismissed the prior approval because Cursor Bugbot reported an unresolved medium-severity finding on this head. Human review is needed and no reviewers were assigned.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0c07b644bc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ete export leases after a cancellation



Replaces the forked buildx v0.10 code (
pkg/buildx/{bake,build,builder,imagetools}, ~15k lines) and thedepot/buildkitfork with upstream buildx v0.38.0 and buildkit v0.34.0.depot buildanddepot bakenow call buildx's publicbuild.Buildandbakepackages; Depot behavior lives in a buildx driver, a gRPC interceptor, and the command layer.Also moves to docker/cli v29, the moby client, containerd v2, and Go 1.26.8.
Architecture
flowchart LR cmd["depot build / bake<br/>(pkg/buildx/commands)"] --> bb["buildx build.Build<br/>(upstream)"] cmd --> bake["buildx bake<br/>(upstream)"] bb --> drv["Depot driver<br/>(pkg/buildxdriver)"] drv --> ic["gRPC interceptor"] ic --> m1["amd64 builder"] ic --> m2["arm64 builder"] ic -. "per-machine solve responses" .-> cmd cmd --> post["metadata · fast --load · SBOMs · leases"]Driver (
pkg/buildxdriver): implements buildx v0.38'sdriver.Driver, acquires Depot machines, and usesdriver.BuildPreparerto keepInternal=true(no build history records on builders).Interceptor (
pkg/buildxdriver/interceptor.go) covers what buildx exposes no option for:--load,--sbom-dir, lease cleanup, and--metadata-fileneed each machine's response<dir>:<target>:<node>, the format from Use unique names for local context in bake #489, so bake targets that share a context directory but filter it differently don't overwrite each other, and existing context caches on builders stay validBake
project_id: upstream bake rejects unknown attributes, so before upstream bake reads the files, eachproject_idbecomes apolicyentry, and each reference such astarget.base.project_idortarget.base["project_id"]reads that entry. After the read, the CLI takes the project from the entry and removes it. Depot builders cannot enforce source policies, so no working bake file sets or readspolicy. Bake then resolves each target's project with the same variables, functions, inheritance, file order, and matrix expansion as other attributes, in the same read as the build options:The prefix contains a random value for each run, so no policy of the user can match it
Bake appends policy entries, parents before children and earlier files before later ones, so the last entry with a project selects it; an empty
project_iddoes not replace an inherited projectA target without a project reads as
"", as before. Reads oftarget.base.policyand of a whole target, such aslookup(target.base, "project_id", ""), do not show the entriesCompose
x-depot.project-idvalues become an HCL file of policy entries placed before the other HCL filesFiles that select no project are read unchanged, apart from
project_idreads of a whole target, which read""Known limitation: a matrix variable named
targetwhose matrix is not an object literal is read as a targetdepot buildctlproxy: advertises the capability list of the Depot buildkit v0.13.2 fork instead of the compiled-in v0.34 list, and forwards the new gateway methods.Behavior changes
bake --printomits an empty"network", showscacheonlyoutputs for linked targets, and escapes${and%{in values as$${and%%{, so that the output is valid bake inputunpack=falsedepot bake <remote-url>no longer panics. A remote definition can build targets of one project only; targets of another project cause an errordepot configure-docker --uninstalland the driver update remove only Depot driver containers, not every container with four underscores in its name--lintreads the Dockerfile from a context archive on stdin instead of./Dockerfilecallattribute print their result (outline,targets,check) instead of running a normal build;checkexits with its status code, as in buildx'mx-*'work with--loadand--metadata-file--loadwith another-ooutput now loads the image as well, as in buildx. Before, it was ignored, or failed withmultiple outputs currently unsupportedwhen loading through the Depot registry--lintwith a remote git or HTTP context lints the Dockerfile from that context, which the builder downloads, instead of the local./Dockerfile--metadata-filemerges machine responses in--platformorder instead of random orderpolicyattribute fail with an error. Depot builders run buildkit v0.13, which cannot enforce source policies; before, the attribute was ignored--platform linux/amd64/v4starts only the amd64 machine instead of every machine@depot/cli-win32-armnpm package, because Go 1.26 removedwindows/armhttp2: server … localhost). buildx's per-machine capability check opens such short sessions.Performance
Median wall time per scenario with 50 ms added round-trip latency to the builders (
go run ./validation -latency 25ms -count 4):mainValidation harness
validation/replaces unit tests for these commands with black-box runs of the CLI. It builds the CLI from a baseline revision and from the working tree, runs every scenario with both, and compares exit codes, output, files, loaded images, registry manifests, and Depot API calls.--load,--push,--save, lint, SBOMs, interrupts and API cancellation,depot pull,depot push,depot exec, anddocker build/docker buildx buildafterdepot configure-dockervalidationCI job runs-upstream, which skips the 14 scenarios that need the Depot buildkit exporter (fast--load,--sbom-dir), and uploads the JSON reportvalidation/README.mdNote
High Risk
Large dependency and architecture swap for core build/bake paths, with behavior and output changes; mitigated by the new validation harness and CI job but still touches critical build infrastructure.
Overview
Replaces the in-tree buildx v0.10 and depot/buildkit forks with upstream buildx v0.38 and buildkit v0.34, wiring Depot through a custom buildx driver, gRPC interceptor, and updated
pkg/buildx/commands(including bakeproject_id→policyshimming for upstream compatibility).Toolchain & packaging: Go 1.26.8, docker/cli v29, golangci-lint v2.14, containerd v2 / moby client; drops Windows 32-bit ARM binaries and
@depot/cli-win32-arm; removespkg/cleanuptmpfile defer cleanup.CLI polish: Filters noisy BuildKit session HTTP/2 handshake log lines via
logFilter; docker plugin metadata import update; newpkg/argumentsfor docker-compatible positional-arg errors; registry auth uses buildkitauthprovider.Quality gate: Adds
validation/black-box harness (~193 scenarios) and a CIvalidationjob (-upstream, artifact report). Examples module tracks new buildx progress APIs.Reviewed by Cursor Bugbot for commit 75ecdfc. Bugbot is set up for automated code reviews on this repo. Configure here.