Skip to content

node: take the buildx first on the PATH, and say why a broken build session broke - #345

Merged
bsoneca merged 1 commit into
mainfrom
node/buildx-pinned-first
Nov 19, 2026
Merged

bsoneca merged 1 commit into
mainfrom
node/buildx-pinned-first

Conversation

@bsoneca

@bsoneca bsoneca commented Nov 19, 2026

Copy link
Copy Markdown
Owner

The engine took Homebrew's buildx 0.38.0 over the pinned 0.33.0, which is why aprende's served image failed at "load build context". With 0.33.0 the context loads.

  • Cause: buildx-binary tried names in a fixed order, so docker-buildx (Homebrew) beat aqua's docker-cli-plugin-docker-buildx. Homebrew's build uses Go 1.27, whose net/http refuses more than 500 header values. buildx sends each COPY source as one gRPC header value, and the served image lists about 7,900 (session: allow large filesync pattern lists in go1.27 moby/buildkit#7420, fixed in buildx 0.39.1).
  • Fix: the candidate whose folder is first on the PATH wins, the buildx used is logged, a broken session says why, and a failed bake shows the failed step's own output.
  • Tests: release_test.nu passes, with new cases for the PATH order, the hint and the failed step.
  • Not fixed here: the served image's one RUN is 1 MB, over the kernel's 128 KiB limit for a single argument (exec /bin/sh: argument list too long). That comes from the generated Dockerfile.

🤖 Generated with Claude Code

…ession broke

The pinned buildx (aqua names it docker-cli-plugin-docker-buildx) lost to a Homebrew
docker-buildx because the engine tried names in a fixed order, so a build meant for
0.33.0 ran on Homebrew's 0.38.0 (Go 1.27) and aprende's served image failed at
"load build context" with PROTOCOL_ERROR / 431: buildx sends a Dockerfile's COPY
sources to the buildkitd as gRPC header values, one per path, and Go 1.27's net/http
refuses more than 500 (moby/buildkit#7420, buildx 0.39.1). The engine now takes the
candidate whose folder is first on the PATH, prints the buildx it uses, adds that
hint to a broken-session error and shows the output of the step that failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bsoneca
bsoneca enabled auto-merge (squash) November 19, 2026 21:46
@bsoneca
bsoneca disabled auto-merge November 19, 2026 21:47
@bsoneca

bsoneca commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

Opus review: APPROVE, 0 must-fix (1 MEDIUM: failed-step output could echo a build arg — build args never carry secrets here, SOPS goes to the cluster only; 5 LOW: hint re-resolves buildx, redundant regex alternative, first failed step only, one weak assertion, no real-file which/symlink test). Follow-ups.

@bsoneca
bsoneca enabled auto-merge (squash) November 19, 2026 21:49
@bsoneca
bsoneca merged commit d4f8eda into main Nov 19, 2026
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant