fix: handle new map Instruction variants in wit-bindgen-core 0.56 (supersedes #190)#192
Conversation
Bumps the wit group with 3 updates in the / directory: [wit-bindgen-core](https://github.com/bytecodealliance/wit-bindgen), [wit-component](https://github.com/bytecodealliance/wasm-tools) and [wit-bindgen](https://github.com/bytecodealliance/wit-bindgen). Updates `wit-bindgen-core` from 0.53.1 to 0.56.0 - [Release notes](https://github.com/bytecodealliance/wit-bindgen/releases) - [Commits](bytecodealliance/wit-bindgen@v0.53.1...v0.56.0) Updates `wit-component` from 0.245.1 to 0.246.2 - [Release notes](https://github.com/bytecodealliance/wasm-tools/releases) - [Commits](https://github.com/bytecodealliance/wasm-tools/commits) Updates `wit-bindgen` from 0.53.1 to 0.56.0 - [Release notes](https://github.com/bytecodealliance/wit-bindgen/releases) - [Commits](bytecodealliance/wit-bindgen@v0.53.1...v0.56.0) --- updated-dependencies: - dependency-name: wit-bindgen-core dependency-version: 0.56.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: wit - dependency-name: wit-component dependency-version: 0.246.2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: wit - dependency-name: wit-bindgen dependency-version: 0.56.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: wit ... Signed-off-by: dependabot[bot] <support@github.com>
wit-bindgen-core 0.56 added map<K,V> support, introducing MapLower, MapLift, IterMapKey, IterMapValue, and GuestDeallocateMap variants to Instruction. Gravity's match is intentionally exhaustive so that new upstream variants break the build rather than silently producing wrong Go. GuestDeallocateMap joins the existing "gravity doesn't generate the Guest code" group. The four Map lower/lift/iter variants todo!() until gravity grows Go map codegen. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
Summary
Supersedes #190. This branch contains the same wit group bump (wit-bindgen-core 0.53.1 → 0.56.0, wit-component 0.245.1 → 0.246.2, wit-bindgen 0.53.1 → 0.56.0) plus the codegen changes required to make it compile.
wit-bindgen-core 0.56 adds first-class
map<K,V>support (bytecodealliance/wit-bindgen#1562, #1583), which introduces five newInstructionvariants. Gravity'smatch inst { ... }incmd/gravity/src/codegen/func.rsis intentionally non-exhaustive-free (no_ =>arm) so upstream additions break the build rather than silently emit wrong Go.New variants handled:
GuestDeallocateMap { .. }— joined to the existing "gravity doesn't generate the Guest code" group alongsideGuestDeallocateList, etc.MapLower { .. },MapLift { .. },IterMapKey { .. },IterMapValue { .. }— collapsed into a singletodo!("implement instruction: {inst:?}")arm. Gravity has no Go map codegen yet; if a WIT world withmap<K,V>is ever fed in, this panics with a clear variant name (same pattern used forFutureLower,StreamLower, etc.).Test plan
cargo build --locked— cleancargo test --locked— passescargo build -p example-* --target wasm32-unknown-unknown --releasecargo test --locked --test cli— all 8 snapshot tests pass (no drift from wit-component 0.246)cd examples && go generate ./... && go test ./...— all Go e2e tests against wazero passOnce this merges, #190 can be closed.
🤖 Generated with Claude Code