Skip to content

refactor(go): replace go generate with setup tool and flatten CGO structure#386

Merged
DorianZheng merged 2 commits into
mainfrom
refactor/go-sdk-setup-tool
Mar 15, 2026
Merged

refactor(go): replace go generate with setup tool and flatten CGO structure#386
DorianZheng merged 2 commits into
mainfrom
refactor/go-sdk-setup-tool

Conversation

@DorianZheng

Copy link
Copy Markdown
Member

Summary

  • Replace go generate workflow with a standalone cmd/setup tool that downloads libboxlite.a from GitHub Releases into the Go module cache
  • Flatten all platform CGO directives into a single bridge_cgo_prebuilt.go using #cgo darwin/#cgo linux prefixes
  • Remove lib/ subdirectories, per-platform wiring files, and internal/download/ — no submodules needed since .a files are downloaded, not committed

User workflow is now:

go get github.com/boxlite-ai/boxlite/sdks/go
go run github.com/boxlite-ai/boxlite/sdks/go/cmd/setup
go build ./...

Test plan

  • go build ./... passes with libboxlite.a present
  • go test -v ./... passes (15/15 tests)
  • CGO_ENABLED=0 go build ./cmd/setup/ builds setup tool as pure Go
  • Setup tool correctly detects platform (darwin-arm64) and version
  • .gitignore excludes sdks/go/libboxlite.a
  • Pre-push hook passes all tests

…ucture

Replace the go generate workflow with a standalone setup tool that
downloads libboxlite.a from GitHub Releases into the Go module cache.
Flatten all platform CGO directives into a single bridge_cgo_prebuilt.go
using #cgo darwin/#cgo linux prefixes, eliminating the lib/ subdirectories
and per-platform wiring files.

User workflow is now:
  go get github.com/boxlite-ai/boxlite/sdks/go
  go run github.com/boxlite-ai/boxlite/sdks/go/cmd/setup
  go build ./...
@DorianZheng DorianZheng merged commit f2be5f5 into main Mar 15, 2026
16 checks passed
@DorianZheng DorianZheng deleted the refactor/go-sdk-setup-tool branch March 15, 2026 05:17
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