Skip to content

build: restore Go 1.20 minimum - #57

Merged
xushiwei merged 2 commits into
goplus:mainfrom
cpunion:fix/restore-go120-minimum
Oct 24, 2026
Merged

xushiwei merged 2 commits into
goplus:mainfrom
cpunion:fix/restore-go120-minimum

Conversation

@cpunion

@cpunion cpunion commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

The Go 1.23 requirement was introduced with the qiniu/x dependency in #36 and remained after #41 removed that dependency. Restore go 1.20 so downstream modules can use the current native bindings without raising their minimum Go version.

Build and test with Go 1.20 and the latest stable Go in CI, with automatic toolchain switching disabled. Go 1.20 is retained for downstream compatibility verification; the stable job checks the current supported toolchain. These jobs validate the library and do not publish release artifacts. Update that job's setup-go action to v5, matching the existing LLGo job. No library source changes are needed. The ordinary Go suite executes the tests in c and c/bitfield and compiles the remaining packages; the separate LLGo jobs exercise the native bindings.

Validation on macOS arm64, based on main 1e54359:

  • Actual Go 1.20.14: go build ./... (49 packages), go test ./..., and go mod tidy -go=1.20 pass.
  • Actual Go 1.23.12 and Go 1.27.2: go test ./... passes.
  • LLGo 1.0.8, separately using Go 1.20.14 and Go 1.27.2: native binding tests pass, including C globals/environment, bitfields, time, C++ strings, LLVM demangling, and Python set construction. LLGo build caching was disabled.
  • git diff --check and actionlint -ignore 'SC2155:' pass. The ignore covers only the three existing SC2155 warnings in the unchanged LLGo build script.

Additional Linux/Windows amd64 cross-builds with CGO disabled encounter existing missing declarations (SigjmpBuf and net.EAI_*). The original go 1.23 module with Go 1.23.12 produces identical errors; these are not regressions from the version change. The previous CI run passed both ordinary Go jobs, native LLGo tests on Ubuntu/macOS, and the Windows LLVM demangle bridge; CI will revalidate the updated matrix.

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: build: restore Go 1.20 minimum

Clean, well-scoped change. Lowering the go.mod floor to go 1.20 so downstream modules don't have to raise their minimum, and validating both the new floor and a modern leg in CI, is the right approach. fail-fast: false, the per-leg name: build (Go ${{ matrix.go }}), and the setup-go v4->v5 bump (aligning the build job with the existing llgo-test job) are all good.

Verified locally

  • GOTOOLCHAIN=local go build ./... passes under the Go 1.20 language version — the downgrade compiles.
  • No Go 1.21+ language/stdlib features in the source (no min/max/clear builtins, no slices/maps/cmp imports), so 1.20 is a safe floor.
  • No README/docs/badge in the repo asserts a minimum Go version, so nothing is left stale by the directive change.

Note (non-blocking)

  • The new go test ./... step is effectively a compile smoke check on ubuntu-latest: 13 of 15 _test.go files are gated behind //go:build llgo/windows, so only c and c/bitfield actually run tests on the standard runner, and the step largely recompiles the same packages as the preceding go build -v ./.... That's fine for a build-health gate — just flagging that it doesn't broaden real test execution.

Minor, optional suggestions are inline. None block merging.

Comment thread go.mod Resolved
Comment thread .github/workflows/go.yml Resolved
Comment thread .github/workflows/go.yml Resolved
@xushiwei
xushiwei merged commit 9798482 into goplus:main Oct 24, 2026
5 checks passed
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.

2 participants