Skip to content

Commit 65345bf

Browse files
authored
Merge pull request #315 from bytecodealliance/ydnar/v0.6.1
all: prepare for v0.6.1
2 parents 7046cb8 + bd80c32 commit 65345bf

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
44

5+
## [v0.6.1] — 2025-03-16
6+
7+
### Changed
8+
9+
- Updated package `cm` to [v0.2.1](https://github.com/bytecodealliance/go-modules/releases/tag/cm%2Fv0.2.1) with JSON fixes.
10+
511
## [v0.6.0] — 2025-03-15
612

713
### Added
@@ -231,7 +237,8 @@ Initial version, supporting [TinyGo](https://tinygo.org/) + [WASI](https://wasi.
231237
- Because Go does not have a native tagged union type, pointers represented in `variant` and `result` types may not be visible to the garbage collector and may be freed while still in use.
232238
- Support for mainline [Go](https://go.dev/).
233239

234-
[Unreleased]: <https://github.com/bytecodealliance/go-modules/compare/v0.6.0..HEAD>
240+
[Unreleased]: <https://github.com/bytecodealliance/go-modules/compare/v0.6.1..HEAD>
241+
[v0.6.1]: <https://github.com/bytecodealliance/go-modules/compare/v0.6.0..v0.6.1>
235242
[v0.6.0]: <https://github.com/bytecodealliance/go-modules/compare/v0.5.0..v0.6.0>
236243
[v0.5.0]: <https://github.com/bytecodealliance/go-modules/compare/v0.4.1..v0.5.0>
237244
[v0.4.1]: <https://github.com/bytecodealliance/go-modules/compare/v0.4.0..v0.4.1>

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,17 @@ Package `wit/bindgen` contains code to generate Go bindings for [Component Model
1212

1313
Package `cm` contains helper types and functions used by generated packages, such as `option<t>`, `result<ok, err>`, `variant`, `list`, and `resource`. These are intended for use by generated [Component Model](https://github.com/WebAssembly/component-model/blob/main/design/mvp/Explainer.md#type-definitions) bindings, where the caller converts to a Go equivalent. It attempts to map WIT semantics to their equivalent in Go where possible.
1414

15-
#### Note on Memory Safety
16-
17-
Package `cm` and generated bindings from `wit-bindgen-go` may have compatibility issues with the Go garbage collector, as they directly represent `variant` and `result` types as tagged unions where a pointer shape may be occupied by a non-pointer value. The GC may detect and throw an error if it detects a non-pointer value in an area it expects to see a pointer. This is an area of active development.
18-
1915
## `wit-bindgen-go`
2016

2117
### WIT → Go
2218

23-
The `wit-bindgen-go` tool can generate Go bindings for WIT interfaces and worlds. If [`wasm-tools`](https://crates.io/crates/wasm-tools) is installed and in `$PATH`, then `wit-bindgen-go` can load WIT directly.
19+
`wit-bindgen-go` generates Go bindings for WIT interfaces and worlds. It generates a Go package for each WIT world and interface, with the necessary types, functions, methods, and ABI glue code. Generated code will depend on package `cm` for core Component Model types like `list<t>`.
2420

2521
```console
2622
wit-bindgen-go generate ../wasi-cli/wit
2723
```
2824

29-
Otherwise, pass the JSON representation of a fully-resolved WIT package:
25+
It also supports the [JSON representation](https://github.com/bytecodealliance/wasm-tools/pull/1203) of a fully-resolved WIT package:
3026

3127
```console
3228
wit-bindgen-go generate wasi-cli.wit.json
@@ -60,6 +56,10 @@ This will emit JSON on `stdout`, which can be piped to a file or another program
6056
wasm-tools component wit -j --all-features example.wit > example.wit.json
6157
```
6258

59+
## Memory Safety and Garbage Collection
60+
61+
Package `cm` and generated bindings from `wit-bindgen-go` may have compatibility issues with the Go garbage collector. This is due to the memory representation of `variant` and `result` types as tagged unions where a pointer shape may be occupied by a non-pointer value. In Go (but not TinyGo), the GC may detect and throw an error if it detects a non-pointer value in an area it expects to see a pointer. This is an area of active development.
62+
6363
## License
6464

6565
This project is licensed under the Apache 2.0 license with the LLVM exception. See [LICENSE](LICENSE) for more details.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/sergi/go-diff v1.3.1
99
github.com/tetratelabs/wazero v1.9.0
1010
github.com/urfave/cli/v3 v3.0.0-beta1
11-
go.bytecodealliance.org/cm v0.2.0
11+
go.bytecodealliance.org/cm v0.2.1
1212
golang.org/x/mod v0.23.0
1313
golang.org/x/tools v0.30.0
1414
)

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc=
3535
github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
3636
github.com/urfave/cli/v3 v3.0.0-beta1 h1:6DTaaUarcM0wX7qj5Hcvs+5Dm3dyUTBbEwIWAjcw9Zg=
3737
github.com/urfave/cli/v3 v3.0.0-beta1/go.mod h1:FnIeEMYu+ko8zP1F9Ypr3xkZMIDqW3DR92yUtY39q1Y=
38-
go.bytecodealliance.org/cm v0.2.0 h1:HMkj1x1LZWU/Ghu2TtUk3VTyS7gyDHLyIfIut0Cpc5M=
39-
go.bytecodealliance.org/cm v0.2.0/go.mod h1:JD5vtVNZv7sBoQQkvBvAAVKJPhR/bqBH7yYXTItMfZI=
38+
go.bytecodealliance.org/cm v0.2.1 h1:sFUQRPfM+ku7hKgFwxGdwjghv4QtTLukpqsAHgE1Tek=
39+
go.bytecodealliance.org/cm v0.2.1/go.mod h1:JD5vtVNZv7sBoQQkvBvAAVKJPhR/bqBH7yYXTItMfZI=
4040
golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM=
4141
golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
4242
golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=

0 commit comments

Comments
 (0)