Skip to content

fix: handle new map Instruction variants in wit-bindgen-core 0.56 (supersedes #190)#192

Merged
arcjet-rei merged 2 commits intomainfrom
fix/wit-0.56-new-instruction-variants
Apr 21, 2026
Merged

fix: handle new map Instruction variants in wit-bindgen-core 0.56 (supersedes #190)#192
arcjet-rei merged 2 commits intomainfrom
fix/wit-0.56-new-instruction-variants

Conversation

@arcjet-rei
Copy link
Copy Markdown
Contributor

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 new Instruction variants. Gravity's match inst { ... } in cmd/gravity/src/codegen/func.rs is 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 alongside GuestDeallocateList, etc.
  • MapLower { .. }, MapLift { .. }, IterMapKey { .. }, IterMapValue { .. } — collapsed into a single todo!("implement instruction: {inst:?}") arm. Gravity has no Go map codegen yet; if a WIT world with map<K,V> is ever fed in, this panics with a clear variant name (same pattern used for FutureLower, StreamLower, etc.).

Test plan

  • cargo build --locked — clean
  • cargo test --locked — passes
  • Built all example wasm with cargo build -p example-* --target wasm32-unknown-unknown --release
  • cargo 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 pass
  • CI green on this PR

Once this merges, #190 can be closed.

🤖 Generated with Claude Code

dependabot Bot and others added 2 commits April 20, 2026 23:04
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>
@arcjet-rei arcjet-rei requested a review from a team as a code owner April 21, 2026 15:26
@socket-security
Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedcargo/​wit-bindgen@​0.53.1 ⏵ 0.56.07910093100100
Updatedcargo/​wit-bindgen-core@​0.53.1 ⏵ 0.56.010010093100100
Updatedcargo/​wit-component@​0.245.1 ⏵ 0.246.29710093100100

View full report

@socket-security
Copy link
Copy Markdown

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.

Action Severity Alert  (click "▶" to expand/collapse)
Warn Low
Environment variable access: cargo macro-string

Location: Package overview

From: ?cargo/wit-bindgen@0.56.0cargo/macro-string@0.2.0

ℹ Read more on: This package | This alert | What is environment variable access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should be clear about which environment variables they access, and care should be taken to ensure they only access environment variables they claim to.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore cargo/macro-string@0.2.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@arcjet-rei arcjet-rei merged commit 20db1d6 into main Apr 21, 2026
4 checks passed
@arcjet-rei arcjet-rei deleted the fix/wit-0.56-new-instruction-variants branch April 21, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants