Skip to content

fix(bindgen,format): enable wasm encoded to be used in the bindgen! macro#12857

Open
mkatychev wants to merge 2 commits intobytecodealliance:mainfrom
mkatychev:fix/bindgen-include-bytes
Open

fix(bindgen,format): enable wasm encoded to be used in the bindgen! macro#12857
mkatychev wants to merge 2 commits intobytecodealliance:mainfrom
mkatychev:fix/bindgen-include-bytes

Conversation

@mkatychev
Copy link
Copy Markdown
Member

Use include_bytes en lieu of include_string to allow WASM encoded components to be passed into wasmtime::component::bindgen.

wit_parser::Resolve::push_path seems to already support wasm-encoded format (Added in bytecodealliance/wasm-tools#2415):

The input path can be one of:

  • ...
  • A wasm-encoded WIT package as a single file in either the text or binary format.

@mkatychev mkatychev requested a review from a team as a code owner March 27, 2026 17:43
@mkatychev mkatychev requested review from pchickey and removed request for a team March 27, 2026 17:43
@mkatychev
Copy link
Copy Markdown
Member Author

Couple of questions came up with this PR:

  • should test cases be included in this PR or should that be handled upstream (this PR mainly exposes further the functionality of wit-parser)

  • The wit-bindgen Config::expand method has already handled this case and is almost identical to the current bindgen::expand function (barring an extra rustfmt process in wasmtime), has there already been discussions about their similarity and possible reuse?

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.

1 participant