cargo-component icon indicating copy to clipboard operation
cargo-component copied to clipboard

Use wasm-wasip2 target as default build target

Open ifsheldon opened this issue 1 year ago • 4 comments

https://github.com/bytecodealliance/cargo-component/blob/1e58afa097e153797e4195cf3f2bc749a3654f31/README.md?plain=1#L184

Hi! I saw this today, but the referred issue has been closed as complete. The latest cargo-component 0.19 still uses wasm-wasip1 as the default build target.

Rust in the latest stable 1.82 has promoted wasm-wasip2 as a tier-2 target, see https://github.com/rust-lang/rust/issues/129997. I think it's time to change the README and the behavior of cargo-component?

ifsheldon avatar Nov 19 '24 10:11 ifsheldon

Related: https://github.com/bytecodealliance/cargo-component/pull/356

pchickey avatar Nov 27 '24 17:11 pchickey

Yes. The current situation is, the wasm32-wasip2 target does a lot of things automatically, which is great and makes it easy to drop into existing Rust development workflows. But, it also doesn't support all the features of cargo component. I looked into it briefly, and didn't see anything supporting import name maps. So there's more to figure out here before we can switch cargo component to using wasm32-wasip2 internally.

sunfishcode avatar Nov 27 '24 17:11 sunfishcode

I've also now posted https://github.com/bytecodealliance/cargo-component/pull/359 to update the README text quoted above.

sunfishcode avatar Nov 27 '24 18:11 sunfishcode

OK, thanks. I am not super familiar with cargo-component.

I think this issue can be turned into a tracker if you can list missing features on the wasm32-wasip2 target.

ifsheldon avatar Nov 28 '24 03:11 ifsheldon