Stream: git-wasmtime

Topic: wasmtime / PR #14867 Fix `bindgen!` with labelled imports...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 19 2026 at 21:59):

jrandolf opened PR #14867 from jrandolf:bindgen-labelled-imports to bytecodealliance:main:

This fixes several bindgen! bugs with labelled (implements) imports and exports, one commit each:

There's no harness for proc-macro errors, so the error cases are unit tests in crates/wit-bindgen/tests/errors.rs that call Opts::generate directly. Most of the diff is new snapshots.

Closes #14855
Closes #14856

view this post on Zulip Wasmtime GitHub notifications bot (Oct 19 2026 at 22:19):

jrandolf has marked PR #14867 as ready for review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 19 2026 at 22:19):

jrandolf removed the review request for wasmtime-core-reviewers from PR #14867.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 19 2026 at 22:19):

jrandolf requested alexcrichton for a review on PR #14867.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 19 2026 at 22:19):

jrandolf requested wasmtime-core-reviewers for a review on PR #14867.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 01:09):

github-actions[bot] added the label wasmtime:api on PR #14867.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 16:11):

:memo: alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 16:11):

:speech_balloon: alexcrichton created PR review comment:

Why is clone_of handled here? I would naively expect that to not be necessary, but I could very well be missing something

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 16:11):

:speech_balloon: alexcrichton created PR review comment:

This seems a bit odd here -- shouldn't this loop break of some kind once a named_imports key is found? Otherwise multiple keys could be considered used despite only actually using one of them.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 16:11):

:speech_balloon: alexcrichton created PR review comment:

Personally I think it's ok to skip these tests for now. I think having things manually tested is generally fine for errors

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 16:11):

:speech_balloon: alexcrichton created PR review comment:

I'm a bit hesitant about how ad-hoc this feels (and detection of duplicate exports). I think it's reasonable to detect this for an improved error, but I think it'd be best to integrate this in such a way where it's not just sprinkled in a few places which is quite easy to forget in the future.

Alternatively though this is a sign that we should generate bindings differently -- if an arbitrary *.wit file can't be reflected into the bindings here that in-and-of-itself arguably a bug where the bindings should be adjusted.

Would you be ok splitting this out to a separate PR or perhaps an issue to further discuss?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 16:11):

:speech_balloon: alexcrichton created PR review comment:

Does the handling of this map still need to be present in import? For one-off maps like this I prefer to have the handling in as little places as possible as otherwise it can get pretty tough to see how this is changing over time.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 18:58):

:memo: jrandolf submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 18:58):

:speech_balloon: jrandolf created PR review comment:

Done

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 18:58):

:memo: jrandolf submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 18:58):

:speech_balloon: jrandolf created PR review comment:

Done

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 18:58):

:memo: jrandolf submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 18:58):

:speech_balloon: jrandolf created PR review comment:

Agreed, I've taken that commit out of this PR. I'll follow up separately, probably by looking at whether the bindings can be generated so these don't clash in the first place.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 18:58):

jrandolf edited PR #14867:

This fixes several bindgen! bugs with labelled (implements) imports, one commit each:

Most of the diff is new snapshots.

#14856 also covers labels clashing with the names generated for other exports. That's not fixed here; I'll follow up on it separately.

Closes #14855

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 19:08):

jrandolf updated PR #14867.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 22:37):

jrandolf updated PR #14867.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 22:48):

:memo: jrandolf submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 22:48):

:speech_balloon: jrandolf created PR review comment:

wit-parser gives each labelled import its own copy of the interface (clone_of points at the original), while named-import bindings are generated once per interface, so the copies are skipped. I've added a comment saying so.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 22:48):

:memo: jrandolf submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 22:48):

:speech_balloon: jrandolf created PR review comment:

Done, the map is now only filled in up front and import just reads it.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 22:48):

:memo: jrandolf submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 22:48):

:speech_balloon: jrandolf created PR review comment:

Follow-up is #14891: the generated names are now chosen so they can't clash, instead of erroring.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 22:50):

jrandolf requested alexcrichton for a review on PR #14867.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 21 2026 at 00:29):

jrandolf updated PR #14867.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 21 2026 at 14:24):

:thumbs_up: alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 21 2026 at 14:24):

alexcrichton added PR #14867 Fix bindgen! with labelled imports and exports to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 21 2026 at 14:56):

:check: alexcrichton merged PR #14867.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 21 2026 at 14:57):

alexcrichton removed PR #14867 Fix bindgen! with labelled imports and exports from the merge queue.


Last updated: Oct 31 2026 at 23:03 UTC