From d5630da6746fb3218cba5751b463ede72f537253 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Almeida?= Date: Sat, 2 May 2026 15:52:35 +0100 Subject: [PATCH] fix(release): ship linux/amd64 agentctl in every release artifact MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remote executors (local Docker, remote Docker, Sprites) bind-mount the linux/amd64 agentctl into the container. The release pipeline only shipped a host-arch agentctl, so users who installed via the bundled binaries (npm/Homebrew/etc.) hit the same "agentctl linux binary not found" error the first time they tried a Docker executor — even on Linux, since the resolver expects the -linux-amd64 suffix. Changes: - .github/workflows/release.yml: cross-compile agentctl-linux-amd64 in the build-bundles matrix step (CGO off so it works from every host). Bundle ships kandev + host agentctl + agentctl-linux-amd64 in dist/kandev/bin/. The AgentctlResolver finds it next to the kandev binary automatically. - Dockerfile: same idea for the container image — produce both variants in the Go builder stage and copy the linux-amd64 helper into /app/apps/backend/bin/ so the resolver picks it up inside the image. A previous commit added the same dependency to \`make build\` for local dev installs; this commit closes the gap for end users. --- .github/workflows/release.yml | 12 ++++++++++++ Dockerfile | 8 ++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5a1ab444a0..6c5938dd52 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -94,6 +94,17 @@ jobs: go build -o bin/kandev${EXT} ./cmd/kandev go build -o bin/agentctl${EXT} ./cmd/agentctl + # Cross-compile a linux/amd64 agentctl regardless of the host platform. + # Remote executors (local Docker, remote Docker, Sprites) bind-mount this + # binary into the container — without it, Docker sessions fail with + # "agentctl linux binary not found" on Mac/Windows installs and even on + # Linux installs (the resolver looks for the -linux-amd64 suffix). + # CGO is off so this works from any host without extra toolchain setup. + - name: Build linux/amd64 agentctl helper + run: | + cd apps/backend + GOOS=linux GOARCH=amd64 CGO_ENABLED=0 CC= go build -o bin/agentctl-linux-amd64 ./cmd/agentctl + - name: Package bundle run: | rm -rf dist/kandev @@ -101,6 +112,7 @@ jobs: EXT=${{ matrix.goos == 'windows' && '.exe' || '' }} cp apps/backend/bin/kandev${EXT} dist/kandev/bin/ cp apps/backend/bin/agentctl${EXT} dist/kandev/bin/ + cp apps/backend/bin/agentctl-linux-amd64 dist/kandev/bin/ mkdir -p dist/kandev/web cp -R dist/web/. dist/kandev/web/ cd dist diff --git a/Dockerfile b/Dockerfile index 354ea12a33..be5dbc2d00 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,8 @@ RUN go mod download COPY apps/backend/ ./ RUN go build -ldflags "-s -w" -o /out/kandev ./cmd/kandev && \ - go build -ldflags "-s -w" -o /out/agentctl ./cmd/agentctl + go build -ldflags "-s -w" -o /out/agentctl ./cmd/agentctl && \ + GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-s -w" -o /out/agentctl-linux-amd64 ./cmd/agentctl # --------------------------------------------------------------------------- # Stage 2: Web + CLI builder — build Next.js standalone + CLI @@ -76,8 +77,11 @@ RUN userdel -r node && groupadd -r kandev && useradd -r -g kandev -u 1000 -m kan # /app/apps/web/.next/standalone/web/server.js RUN mkdir -p /app/apps/backend/bin /app/apps/web/.next /data/worktrees -# Copy Go binaries +# Copy Go binaries. The -linux-amd64 variant of agentctl is bind-mounted into +# Docker-executor sandboxes by the lifecycle manager; ship it next to kandev +# so the AgentctlResolver finds it without manual configuration. COPY --from=go-builder /out/kandev /app/apps/backend/bin/kandev +COPY --from=go-builder /out/agentctl-linux-amd64 /app/apps/backend/bin/agentctl-linux-amd64 COPY --from=go-builder /out/agentctl /usr/local/bin/agentctl # Copy Next.js standalone output