From 35b18aa853523bdd1cd5af9a5ed2628484fecd96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Salavisa?= Date: Fri, 22 May 2026 09:53:11 +0100 Subject: [PATCH] fix(release): build kandev binary with -tags fts5 (#1007) * fix(release): build kandev binary with -tags fts5 The tasks_fts virtual table + sync triggers shipped in v0.50.0 (#914) require the fts5 SQLite build tag, which apps/backend/Makefile already sets. The release workflow did not, so published binaries lack the module and fail to open any DB that an FTS5-enabled build previously touched ("no such module: fts5" during schema init). Add -tags fts5 to the kandev build and propagate the standard version ldflags from the Makefile so kandev --version reports the released tag. Fixes #1006. Co-Authored-By: Claude Opus 4.7 * fix(release): propagate version ldflags to cross-compiled agentctl The linux/amd64 agentctl helper is built in a separate workflow step whose shell does not inherit LDFLAGS from the previous build step. Export LDFLAGS via \$GITHUB_ENV so the cross-compiled binary embeds the same Version/Commit/BuildTime metadata as the matrix-built agentctl, matching apps/backend/Makefile's build-agentctl-linux target. Co-Authored-By: Claude Opus 4.7 --------- Co-authored-by: Kandev Agent Co-authored-by: Claude Opus 4.7 --- .github/workflows/release.yml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 630138dd8f..e6d8e95c48 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -360,15 +360,31 @@ jobs: sudo apt-get update sudo apt-get install -y gcc-mingw-w64-x86-64 + # The `fts5` build tag is REQUIRED on the kandev binary. The office + # task search migrations create a `tasks_fts` virtual table using + # `USING fts5(...)`; without the tag, mattn/go-sqlite3 lacks the + # module and any subsequent boot against a DB that already has the + # virtual table fails with "no such module: fts5" during schema init. + # See issue #1006 for the regression this prevents. + # + # Version ldflags mirror apps/backend/Makefile so `kandev --version` + # reports the released tag instead of the build-time default "dev". - name: Build backend binaries env: CC: ${{ matrix.cc || '' }} + KANDEV_VERSION: ${{ needs.prepare.outputs.tag }} run: | cd apps/backend mkdir -p bin EXT=${{ matrix.goos == 'windows' && '.exe' || '' }} - go build -o bin/kandev${EXT} ./cmd/kandev - go build -o bin/agentctl${EXT} ./cmd/agentctl + COMMIT=$(git rev-parse --short HEAD) + BUILD_TIME=$(date -u '+%Y-%m-%dT%H:%M:%SZ') + LDFLAGS="-s -w -X main.Version=${KANDEV_VERSION} -X main.Commit=${COMMIT} -X main.BuildTime=${BUILD_TIME}" + # Export to subsequent steps so the cross-compiled agentctl helper + # below gets the same version metadata (matches Makefile parity). + echo "LDFLAGS=${LDFLAGS}" >> "${GITHUB_ENV}" + go build -tags fts5 -ldflags "${LDFLAGS}" -o bin/kandev${EXT} ./cmd/kandev + go build -ldflags "${LDFLAGS}" -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 @@ -379,7 +395,7 @@ jobs: - 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 + GOOS=linux GOARCH=amd64 CGO_ENABLED=0 CC= go build -ldflags "${LDFLAGS}" -o bin/agentctl-linux-amd64 ./cmd/agentctl - name: Package bundle run: |