Skip to content

A native main for gallery and gallery/iso, and a CI step that builds without tags - #78

Merged
tannevaled merged 1 commit into
mainfrom
iso-native-stub
Oct 11, 2026
Merged

tannevaled merged 1 commit into
mainfrom
iso-native-stub

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Defect. On a native host, go build ./... fails:

# github.com/go-widgets/gallery/iso
runtime.main_main·f: function main is undeclared in the main package

and, once iso is fixed, the same for the root package. Both are package main with their main behind a tag: js && wasm for both, and gallerynative too for the root. go test provides its own main, so the tests passed. CI built the root only for js/wasm and with gallerynative, and iso only for js/wasm, so nothing caught it.

Change.

  • stub_main.go (!(js && wasm) && !gallerynative) and iso/native.go (!(js && wasm)): an empty func main() {}, the app-template convention. The body holds no statement, so the coverage gate doesn't move (100.0% before and after).
  • CI: a go build ./... step, native and with no tags, that would have caught it. Control: without the two stubs it fails (rc=1); with them it passes.

Checked locally (go1.27.2): native build; GOOS=js GOARCH=wasm for . and ./iso; -tags gallerynative; vet; tests at 100.0%; linux on the 6 architectures; actionlint clean.

🤖 Generated with Claude Code

…without tags

Both are package main with their main behind a build tag (js && wasm, and
gallerynative for the root), so on a native host with no tag go build ./...
failed to link: "function main is undeclared in the main package". go test
supplies its own main and passed, and CI built the root only for js/wasm and
with gallerynative, so nothing said so. Two empty stubs (no statement, so the
coverage gate is unchanged at 100.0%) and a native go build ./... step, which
fails without the stubs and passes with them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit a13379b into main Oct 11, 2026
3 checks passed
@tannevaled
tannevaled deleted the iso-native-stub branch October 11, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant