-
Notifications
You must be signed in to change notification settings - Fork 996
internal: update wasm-tools-go to v0.3.0 #4529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
deadprogram
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am using this same version of wasm-tools-go elsewhere quite successfully so far.
|
Now merging, thanks for update @ydnar |
dgryski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM to merge with the exception of some comments about the generated code (but those shouldn't block merging this..)
| // [uint64]: https://pkg.go.dev/builtin#uint64 | ||
| // [float32]: https://pkg.go.dev/builtin#float32 | ||
| // [Canonical ABI]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/CanonicalABI.md | ||
| func U64ToF32(v uint64) float32 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment should probably apply to the upstream generator, but note that math already has
[func Float32bits(f float32) uint32](https://pkg.go.dev/math#Float32bits)
[func Float32frombits(b uint32) float32](https://pkg.go.dev/math#Float32frombits)
[func Float64bits(f float64) uint64](https://pkg.go.dev/math#Float64bits)
[func Float64frombits(b uint64) float64](https://pkg.go.dev/math#Float64frombits)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Memorializing IRL conversation this past week in San Francisco:
"We duplicate functionality from package math here to avoid a potential circular dependency in package runtime. Package cm intentionally depends only on unsafe."
|
|
||
| // String implements [fmt.Stringer], returning the variant case name of v. | ||
| func (v StreamError) String() string { | ||
| return stringsStreamError[v.Tag()] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again a comment for the generator here: should we be handling "unknown" types (Tag() >= 2) or just assume that will "never happen" and a crash regardless?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Memorializing IRL conversation this past week in San Francisco:
"Invalid variant cases are a bug, and a panic/crash is the intended behavior."
This updates the version of github.com/bytecodealliance/wasm-tools-go to v0.3.0 and regenerates the WASI 0.2 bindings in packages
internal/wasi/*andinternal/cm. This is a cherry-pick from #4501. cc @deadprogram