mkatychev opened PR #12857 from mkatychev:fix/bindgen-include-bytes to bytecodealliance:main:
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->Use
include_bytesen lieu ofinclude_stringto allow WASM encoded components to be passed intowasmtime::component::bindgen.
wit_parser::Resolve::push_pathseems to already support wasm-encoded format (Added in https://github.com/bytecodealliance/wasm-tools/pull/2415):The input
pathcan be one of:
- ...
- A wasm-encoded WIT package as a single file in either the text or binary format.
mkatychev requested pchickey for a review on PR #12857.
mkatychev requested wasmtime-core-reviewers for a review on PR #12857.
mkatychev commented on PR #12857:
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::expandmethod has already handled this case and is almost identical to the currentbindgen::expandfunction (barring an extrarustfmtprocess in wasmtime), has there already been discussions about their similarity and possible reuse?
alexcrichton submitted PR review:
Thanks!
alexcrichton commented on PR #12857:
should test cases be included in this PR or should that be handled upstream
Ah this is fine as-is, it's more-or-less well-tested already and relaxing to bytes I think is reasonable to have without a test.
has there already been discussions about their similarity and possible reuse?
nope, just some old code and you're witnessing how things evolved over time :)
If you'd like to help clean up with a PR that'd be much appreciated!
alexcrichton added PR #12857 fix(bindgen,format): enable wasm encoded to be used in the bindgen! macro to the merge queue.
alexcrichton merged PR #12857.
alexcrichton removed PR #12857 fix(bindgen,format): enable wasm encoded to be used in the bindgen! macro from the merge queue.
Last updated: Apr 12 2026 at 23:10 UTC