fix: build the acor package, not main.go alone, in the release - #247
Merged
Merged
Conversation
`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`.
13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
The
v1.6.0tag build failed after every CI gate passed:.goreleaser.yamlsetbuilds[].maintocmd/acor/main.go— a file, not a package. Go compiles a file path as the pseudo-packagecommand-line-argumentsand excludes its siblings, so the release binary was built frommain.goalone.That worked by accident. Until #244,
cmd/acorheld onlymain.goandmain_test.go, and test files are excluded from a build anyway. #244 addedcmd/acor/dictionary.go, which definesdispatchDictionary, andmain.go:224calls it — so the single-file build stopped compiling the moment that PR merged, and nothing said so until a tag was pushed.No existing gate could have caught this, which is the part worth fixing rather than just patching:
make build, CI, pre-commitgo build ./cmd/acor(package)go build cmd/acor/main.go(file)The two builds compiled different things, so a green
mainproved nothing about the release. Naming the package collapses them into one build —make buildnow genuinely gates the release path.Type of Change
Checklist
make test) — no Go files changed; pre-commit skipped the Go hooks for that reasonmake vet— samemake lint) — samemake build) — same, and verified directly belowchangie new) — deliberately skipped: release-infrastructure only, and no published release ever carried the bug.changes/v1.6.0.mdis already batched and stays as writtenVerification
paths=cmd/acor— the package. The binary carries thedictionarycommand that the tag build could not compile.Additional Notes
No release artifacts were published by the failed run: the build dies before the publish step, so there is no
v1.6.0GitHub release and no GHCR image. The only thing that exists is thev1.6.0tag.After this merges, recovery follows RELEASE.md's rollback: delete the tag locally and remotely, re-tag the new
main, and push.changes/v1.6.0.mdis untouched and gets reused as-is.By submitting this PR, I agree that my contributions will be licensed under the Apache License 2.0.