-
Notifications
You must be signed in to change notification settings - Fork 20
Update a few aspects of the adapter build #17
Conversation
* Use the `wasm32-unknown-unknown` target for the adapter and specify flags in `.cargo/config.toml` to avoid having to pass the same flags everywhere. This allows using `wasm32-wasi` for tests to ensure the flags only apply to the adapter. * Use `opt-level=s` since speed is not of the utmost concern for this wasm but since it's likely to be included in many places size is likely more important. * Use `strip = 'debuginfo'` for the release build to remove the standard library's debugging information which isn't necessary. * Remove `debug = 0` from the `dev` profile to have debugging information for development. * Add a small `README.md` describing what's here for now.
209b120
to
01ea870
Compare
One unfortunate thing about wasm32-unknown-unknown is that the Rust wasm32-unknown-unknown target is still using How inconvenient would be to use |
I can change yeah, but can you elaborat on "other subtle differences"? I would additionally like to remove the Additionally there's no real reason that |
This commit adds a `command` feature to main crate to avoid importing the `_start` function when the `command` feature is disabled, making this adapter useful for non-command WASI programs as well. For now this still emits the `command` export in the final component but with `use` in `*.wit` files it should be easier to avoid that export.
I've added a new commit with a feature that came up yesterday which is to have one build of the adapter for commands and another that's not for commands. The latter should be useful for "my wasm just happens to import WASI" but has its own form of exported interface. |
Following up on the discussion above, I submitted some PRs to Rust:
Looking more closely, the other difference I see between wasm32-wasi and wasm32-unknown-unknown is that wasm32-unknown-unknown does |
Ok, I've now convinced myself that we can do this. If we ever do hit the ABI differences, we should find out about them via link-time signature mismatches. |
Thanks for opening those! Also, yeah, we don't have to worry about the cabi bits there. That's basically only for interacting with C code and otherwise |
Use the
wasm32-unknown-unknown
target for the adapter and specify flags in.cargo/config.toml
to avoid having to pass the same flags everywhere. This allows usingwasm32-wasi
for tests to ensure the flags only apply to the adapter.Use
opt-level=s
since speed is not of the utmost concern for this wasm but since it's likely to be included in many places size is likely more important.Use
strip = 'debuginfo'
for the release build to remove the standard library's debugging information which isn't necessary.Remove
debug = 0
from thedev
profile to have debugging information for development.Add a small
README.md
describing what's here for now.