tinygo
tinygo copied to clipboard
compiler: conform to latest iteration of wasm types proposal
Updates to current version of the wasm types proposal at https://github.com/golang/go/issues/66984.
Changes include:
- Removal of
intanduintas allowed types. - Restriction of
int8,uint8,int16, anduint16to struct fields, arrays, or pointer values. - Requires
structtypes in wasm params with 1 or more fields to includestructs.HostLayout. It enforces this for Go 1.23 or later.- TODO: revise this to minimum Go 1.24?
@dgryski @aykevl would you prefer I split this into two parts, one that upgrades the wasm-tools-go dependency and regenerates the bindings, and a separate one with the wasm types changes to package compiler?
would you prefer I split this into two parts, one that upgrades the wasm-tools-go dependency and regenerates the bindings, and a separate one with the wasm types changes to package compiler?
I personally would prefer that. :smile_cat:
would you prefer I split this into two parts, one that upgrades the wasm-tools-go dependency and regenerates the bindings, and a separate one with the wasm types changes to package compiler?
I personally would prefer that. 😸
Here you go: https://github.com/tinygo-org/tinygo/pull/4529
# github.com/tinygo-org/tinygo/compiler
compiler/symbol.go:469:33: c.pkg.GoVersion undefined (type *types.Package has no field or method GoVersion)
https://app.circleci.com/pipelines/github/tinygo-org/tinygo/11640/workflows/e46166fe-40b9-410a-95a9-d49be472b0d1/jobs/44676?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-checks-link&utm_content=summary&invite=true#step-112-0_39
@ydnar note the CI failure...
What's the minimum version of Go supported by TinyGo?
Looks like this field was added in 1.21: https://pkg.go.dev/go/types#Package.GoVersion
"Officially" should be same as Go itself. But we have been able to keep backwards compat quite a few versions of both Go and LLVM, as shown by the CircleCI tests.
"Officially" should be same as Go itself. But we have been able to keep backwards compat quite a few versions of both Go and LLVM, as shown by the CircleCI tests.
How does this project define compatibility?
- TinyGo can be built with version N of Go?
- or TinyGo can be used with version N of Go?
Asking because what % of users build TinyGo from source, and what % of those users are using older versions of Go? Versus what % of end-users of TinyGo who use a binary distribution use older versions of Go?
Usually we keep compatibility as long as it isn't too much of an issue to support. We tend to drop older versions when it's getting annoying to support these older versions. It's always surprising how many people rely on older Go versions but still expect to use a newer TinyGo version.
Also, to be clear: because it makes CI easier "can be built" and "can be used with" is usually the same version. The lower bound is currently LLVM 15 and Go 1.19:
https://github.com/tinygo-org/tinygo/blob/ef4f46f1d1550beb62324d750c496b2b4a7f76d0/.circleci/config.yml#L121-L123
I guess we could drop support for Go 1.19 and Go 1.20. That would leave Go 1.21-1.23 supported. I find it difficult to guess how many people would have an issue with this (note that Go 1.19 is the Go version in Debian 12).
@aykevl I updated this quite a bit. Can you take a look?
I can split this into two PRs, one for the package goenv changes (Parse and Compare), and a second for the wasm types.
I can split this into two PRs, one for the package goenv changes (Parse and Compare), and a second for the wasm types.
Sorry to be a pain, but I am fairly certain that will make it a lot easier to review. Thank you!
I can split this into two PRs, one for the package goenv changes (Parse and Compare), and a second for the wasm types.
Sorry to be a pain, but I am fairly certain that will make it a lot easier to review. Thank you!
Done! See #4536.
@ydnar I think this PR can be rebased now, if you please.
@deadprogram done!
Was this PR also meant to be squashed?
Now merging, thank you @ydnar for working on this and to @aykevl for helping review.