jrandolf opened PR #14837 from jrandolf:bindgen-map-path to bytecodealliance:main:
bindgen!generatedstd::collections::HashMap<K, V>for WIT maps, but theComponentType/Lift/Lowerimpls are on Wasmtime's internalHashMap, which ishashbrown::HashMapwhen thestdfeature is disabled, so any WIT usingmapfailed to compile in that configuration. This re-exports that type fromcomponent::__internaland uses it in generated code likeVecandStringalready are.To cover this in CI, the min-platform example gains a small world using a map, since that's the build that runs without
std(it fails withcannot find module or crate stdwithout this change). I'm not attached to that location if there's a better place for a no_std bindgen check.This is based on #14834; only the last commit is new.
Closes #14830
jrandolf has marked PR #14837 as ready for review.
jrandolf requested wasmtime-core-reviewers for a review on PR #14837.
jrandolf requested pchickey for a review on PR #14837.
jrandolf removed the review request for wasmtime-core-reviewers from PR #14837.
jrandolf updated PR #14837.
github-actions[bot] added the label wasmtime:api on PR #14837.
:memo: alexcrichton submitted PR review:
I'm not sure about this personally, I think this can lead to subtle breakages and confusion. This means that the output of
bindgen!is dependent on features enabled inwasmtime, but if there's multiple dependencies on thewasmtimecrate then you're not in full control over the features enabled. IIRC there was a similar discussion about this on thewit-bindgenrepository, but I forget the exact outcome there -- would you be up for searching over there and seeing how this relates to that solution?
alexcrichton removed the review request for pchickey from PR #14837.
jrandolf commented on PR #14837:
I looked at wit-bindgen as you suggested. You pushed back on switching on
stdthere for the same reason, and it ended up with amap_typeoption that defaults toBTreeMap. #14870 now does the same thing here,BTreeMapis inallocso the generated code doesn't depend on Wasmtime's features, so I'm closing this in favor of that.
:cross_mark: jrandolf closed without merge PR #14837.
Last updated: Oct 31 2026 at 23:03 UTC