From ca742bf558a51f25f119607050390dc694b398c5 Mon Sep 17 00:00:00 2001 From: Sung-Kyu Yoo Date: Sun, 6 Sep 2026 17:06:16 +0900 Subject: [PATCH] fix: build the acor package, not main.go alone, in the release MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `builds[].main` named `cmd/acor/main.go`, a file rather than a package. Go compiles a file path as `command-line-arguments` and drops its siblings in the same package, so the release binary was built from main.go alone. That held by accident: until #244, `cmd/acor` contained only `main.go` and `main_test.go`. #244 added `dictionary.go`, and `main.go:224` calls `dispatchDictionary` from it — so the v1.6.0 tag build failed with `undefined: dispatchDictionary` after every CI gate had passed. No gate could have caught it. `make build` and CI run `go build ./cmd/acor`, the package; GoReleaser was compiling something else. Naming the package makes the two builds the same build, so `make build` now gates the release path. Verified with `goreleaser build --snapshot --single-target`: builds `paths=cmd/acor`, and the binary's `--help` lists `dictionary`. --- .goreleaser.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 0a0f658..2161bc8 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -13,7 +13,12 @@ before: builds: - id: acor binary: acor - main: cmd/acor/main.go + # The package, not `cmd/acor/main.go`. A file path compiles that file alone as + # `command-line-arguments`, excluding its siblings in the same package — which + # held only while `cmd/acor` was one file, and stopped holding the moment + # `dictionary.go` arrived, failing the v1.6.0 tag build. Naming the package + # builds what `make build` builds, so that target now gates this one. + main: ./cmd/acor # Stamps `acor version`. Without this a release binary reports its "dev" # default, so a bug report would not say which release it came from. # .Version, not .Tag: it is the unprefixed number the brew formula, the OCI