-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #255 from bytecodealliance/ydnar/cm-module
cm: extract package cm into its own distinct module
- Loading branch information
Showing
12 changed files
with
104 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.DS_Store | ||
/generated | ||
go.work.sum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), | |
|
||
## [Unreleased] | ||
|
||
### Changed | ||
|
||
- Breaking: package [`cm`](https://pkg.go.dev/go.bytecodealliance.org/cm) is now a separate [module](https://go.dev/ref/mod). This change was made in order to minimize the runtime dependencies of programs that depend on package `cm` but not the rest of the packages in this module. To update your code that depends on package `cm`, run `go get -u go.bytecodealliance.org/...`. | ||
|
||
### Fixed | ||
|
||
- [#264](https://github.com/bytecodealliance/go-modules/issues/264): fix lowering for imported functions that return named `bool` types. | ||
|
@@ -14,15 +18,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), | |
|
||
- `wit-bindgen-go wit` now accepts an `--interface` argument in the form of `monotonic-clock`, `wasi:clocks/monotonic-clock`, or `wasi:clocks/[email protected]`. This filters the serialized WIT to a specific interface and the other interface(s) it references. This can be used to generate focused WIT with a minimal set of dependencies, and can be combined with the `--world` argument to filter serialized WIT to the intersection of a specific world and interface. | ||
|
||
### Fixed | ||
|
||
- [#240](https://github.com/bytecodealliance/go-modules/issues/240): correctly handle cyclical data structures when generating variant lowering code. | ||
|
||
### Changed | ||
|
||
- Breaking: package `wit` no longer interprets `-` to read from stdin when loading JSON or WIT using `wit.LoadJSON` or `wit.LoadWIT`. Use `wit.DecodeJSON` or `wit.DecodeWIT` to read JSON or WIT from an `io.Reader`. | ||
- Breaking: `wit.ParseWIT` has been removed. Use `wit.DecodeWIT(bytes.NewReader(b))` instead. | ||
|
||
### Fixed | ||
|
||
- [#240](https://github.com/bytecodealliance/go-modules/issues/240): correctly handle cyclical data structures when generating variant lowering code. | ||
|
||
## [v0.4.0] — 2024-11-05 | ||
|
||
This module has been renamed. Going forward, please use `go.bytecodealliance.org` instead of `github.com/bytecodealliance/wasm-tools-go`. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Changelog | ||
|
||
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). | ||
|
||
## [Unreleased] | ||
|
||
Initial version, extracted into module [`go.bytecodealliance.org/cm`](https://pkg.go.dev/go.bytecodealliance.org/cm). | ||
|
||
[Unreleased]: <https://github.com/bytecodealliance/go-modules/compare/cm/v0.1.0..HEAD> | ||
[v0.1.0]: <https://github.com/bytecodealliance/go-modules/tree/cm/v0.1.0> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# go.bytecodealliance.org/cm | ||
|
||
[![pkg.go.dev](https://img.shields.io/badge/docs-pkg.go.dev-blue.svg)](https://pkg.go.dev/go.bytecodealliance.org/cm) [![build status](https://img.shields.io/github/actions/workflow/status/bytecodealliance/go-modules/test.yaml?branch=main)](https://github.com/bytecodealliance/go-modules/actions) | ||
|
||
## About | ||
|
||
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. | ||
|
||
### Note on Memory Safety | ||
|
||
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. | ||
|
||
## License | ||
|
||
This project is licensed under the Apache 2.0 license with the LLVM exception. See [LICENSE](../LICENSE) for more details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Release | ||
|
||
This document describes the steps to release a new version of module `go.bytecodealliance.org/cm`. | ||
|
||
## 1. Update [CHANGELOG.md](./CHANGELOG.md) | ||
|
||
1. Add the latest changes to [CHANGELOG.md](./CHANGELOG.md). | ||
1. Rename the Unreleased section to reflect the new version number. | ||
1. Update the links to new version tag in the footer of CHANGELOG.md | ||
1. Add today’s date (YYYY-MM-DD) after an em dash (—). | ||
1. Submit a [GitHub Pull Request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) with these updates. | ||
|
||
## 2. Create a new release | ||
|
||
Once the PR is merged, tag the new version in Git and push the tag to GitHub. | ||
|
||
**Note:** the tag **must** start with the prefix `cm/` in order to correctly tag this module. | ||
|
||
For example, to tag version `cm/v0.2.0`: | ||
|
||
```console | ||
git tag cm/v0.2.0 | ||
git push origin cm/v0.2.0 | ||
``` | ||
|
||
## 3. Update the root module | ||
|
||
Once the tag is pushed, you can update the root module to depend on the newly created version of package `cm` by running the following: | ||
|
||
```console | ||
go get -u go.bytecodealliance.org/cm@latest | ||
``` | ||
|
||
Then follow the instructions in [RELEASE.md](../RELEASE.md) to release a new version of the root module. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module go.bytecodealliance.org/cm | ||
|
||
go 1.22.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,6 @@ go 1.22.0 | |
|
||
use ( | ||
. | ||
./cm | ||
./tests | ||
) |
This file was deleted.
Oops, something went wrong.