From acd35dd3cd1754f2f14c3b46b630e15c9974077d Mon Sep 17 00:00:00 2001 From: Teodor Calin Date: Wed, 8 Jul 2026 19:19:37 +0300 Subject: [PATCH] fix(publish): stop shipping a Go object archive as pilot-gateway MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The gateway build fallback (go build . on the library repo) produced an 'ar archive', not an executable — v1.12.4 wheels ship a 380KB pilotprotocol/bin/pilot-gateway that cannot run. Build only when ./cmd/gateway exists; otherwise skip with a log line. The runtime already tolerates a missing binary (clear error on invocation). Co-Authored-By: Claude Fable 5 --- .github/workflows/publish.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e6bc077..8501593 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -184,8 +184,17 @@ jobs: ( cd web4 && CGO_ENABLED=0 go build -ldflags "$LDFLAGS" -o "$OUT/pilot-updater" ./cmd/updater ) echo "Building gateway..." - ( cd gateway && go mod tidy && CGO_ENABLED=0 go build -ldflags "$LDFLAGS" -o "$OUT/pilot-gateway" ./cmd/gateway ) \ - || ( cd gateway && CGO_ENABLED=0 go build -ldflags "$LDFLAGS" -o "$OUT/pilot-gateway" . ) + # The gateway repo is currently a library (no ./cmd/gateway). The old + # fallback `go build .` compiled that library into a Go object archive + # and shipped it as "pilot-gateway" — a non-executable file (the v1.12.4 + # wheels contain it). Skip cleanly instead; the console script then + # fails with a clear missing-binary error, and the build resumes + # automatically if the repo grows a cmd/gateway again. + if [ -d gateway/cmd/gateway ]; then + ( cd gateway && go mod tidy && CGO_ENABLED=0 go build -ldflags "$LDFLAGS" -o "$OUT/pilot-gateway" ./cmd/gateway ) + else + echo "gateway repo has no cmd/gateway — skipping pilot-gateway binary" + fi echo "Building libpilot CGO shared library..." ( cd libpilot && CGO_ENABLED=1 go build -buildmode=c-shared -ldflags "-s -w" -o "$OUT/libpilot.$EXT" . )