From c48bd963695ba8120f0420b9881f1b15b2fad781 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 1 May 2026 16:55:19 +0300 Subject: [PATCH] build: pass -tags desktop,production to go build (Wails requirement) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without these tags Wails aborts at startup with a "Wails applications will not build without the correct build tags" MessageBox. Local rebuild.sh, the cross-compile step in release.yml, and the windows build step in build.yml all needed the flag — only the local Wails dev wrapper was already passing it. Co-Authored-By: Claude Opus 4.7 (1M context) --- .gitea/workflows/build.yml | 4 +++- .gitea/workflows/release.yml | 6 +++++- rebuild.sh | 10 ++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 rebuild.sh diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index cce3781..3f52417 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -106,7 +106,9 @@ jobs: # flashes a console window. main.go calls AttachConsole on # startup so CLI invocations from cmd/PowerShell still print # to the parent terminal. - go build -trimpath -ldflags="-s -w -H=windowsgui \ + # -tags desktop,production is REQUIRED by Wails (see release.yml). + go build -trimpath -tags "desktop,production" \ + -ldflags="-s -w -H=windowsgui \ -X main.Version=dev-${SHORT_SHA} \ -X main.Commit=${SHORT_SHA} \ -X main.BuildDate=${BUILD_DATE}" \ diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index af574ce..0af23a1 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -78,7 +78,11 @@ jobs: # double-click experience doesn't flash a console window. main.go # calls AttachConsole on startup so CLI runs still print to the # parent terminal when launched from cmd/PowerShell. - go build -trimpath -ldflags="-s -w -H=windowsgui \ + # -tags desktop,production is REQUIRED by Wails — otherwise the + # binary aborts at startup with a "Wails applications will not + # build without the correct build tags" MessageBox. + go build -trimpath -tags "desktop,production" \ + -ldflags="-s -w -H=windowsgui \ -X main.Version=${{ steps.version.outputs.version }} \ -X main.Commit=${SHORT_SHA} \ -X main.BuildDate=${BUILD_DATE}" \ diff --git a/rebuild.sh b/rebuild.sh new file mode 100644 index 0000000..12452e4 --- /dev/null +++ b/rebuild.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -e +cd "$(dirname "$0")" +echo "[$(date +%H:%M:%S)] frontend..." +(cd internal/gui/frontend && npm run build 2>&1 | tail -3) +echo "[$(date +%H:%M:%S)] go build..." +CGO_ENABLED=0 go build -trimpath -tags "desktop,production" \ + -ldflags "-s -w -H=windowsgui -X main.Version=99.99.99-test" \ + -o drover-test.exe ./cmd/drover +echo "[$(date +%H:%M:%S)] OK $(stat -c %s drover-test.exe) bytes"