-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"hello world" example with the wasi
crate doesn't work
#236
Comments
To prevent If you add So [package.metadata.component.target.dependencies]
"wasi:http" = { path = "wit/deps/http" }
"wasi:random" = { path = "wit/deps/random" }
"wasi:cli" = { path = "wit/deps/cli" }
"wasi:io" = { path = "wit/deps/io" }
"wasi:clocks" = { path = "wit/deps/clocks" }
"wasi:filesystem" = { path = "wit/deps/filesystem" }
"wasi:sockets" = { path = "wit/deps/sockets" } However, there appears to be breaking changes in the latest With the above in place, you should now see the following for
This, finally, is a bug in It's possible to workaround that with: [package.metadata.component]
adapter = "wasi_snapshot_preview1.command.wasm" But it should work out of the box. |
In this case with no WIT internally as it's all coming from the
Oh dear, do you mean breakage from 0.18-to-0.19 or something that needs a yank/republish on crates.io? (also I'm happy to cc you on more changes to wit-bindgen if you'd like for possible breakage with cargo-component) |
I agree that componetizing a module based on the presence of the component-type custom section rather than the presence of Right now, if there are no settings under I'm not entirely sure I would want to change that behavior, as most of the time the presence of the
A breakage from 0.18 to 0.19; it's just An example breakage from
Ideally it would be nice if we had a mode where we could generate the runtime types (and |
Ah I see good point! One suggestion would be to update One fix for that is to then do what you mention, generate I think the best solution might be to define "perma stable" APIs, like how the runtime links So how about this:
|
Your plan sounds great to me! |
This commit includes the following improvements to `cargo-component`: * `cargo-component` now componentizes based off the presence of component type information custom sections rather than always requiring a `[package.metadata.component]` section be present in `Cargo.toml`. * Bindings generation will now occur if a `wit` directory is present and `[package.metadata.component]` is not present in `Cargo.toml`. * Fix a panic in `cargo component add` if it encounters expected items that are not tables. * Fix not setting implicit tables for intermediate tables for the `cargo component add` command. * Fix not displaying anything when `--help` is present for commands passed directly to `cargo`. * `cargo-component` now uses the command adapter for binary examples and test/bench artifacts. * `cargo-component` now displays the same "Running" message that `cargo` does when using the `run`, `test`, and `bench` commands. * Some paths displayed in status messages have been prefix-stripped based on the CWD. This commit also contains a bit of refactoring to `run_cargo_command`, as it was getting long and unwieldy. Fixes bytecodealliance#236.
This commit includes the following improvements to `cargo-component`: * `cargo-component` now componentizes based off the presence of component type information custom sections rather than always requiring a `[package.metadata.component]` section be present in `Cargo.toml`. * Bindings generation will now occur if a `wit` directory is present and `[package.metadata.component]` is not present in `Cargo.toml`. * Fix a panic in `cargo component add` if it encounters expected items that are not tables in `Cargo.toml`. * Fix not setting implicit tables for intermediate tables for the `cargo component add` command. * Fix not displaying anything when `--help` is present for commands passed directly to `cargo`. * `cargo-component` now uses the command adapter for binary examples and test/bench artifacts. * `cargo-component` now displays the same "Running" message that `cargo` does when using the `run`, `test`, and `bench` commands. * Some paths displayed in status messages have been prefix-stripped based on the CWD. This commit also contains a bit of refactoring to `run_cargo_command`, as it was getting long and unwieldy. Fixes bytecodealliance#236.
* Various improvements to `cargo-component`. This commit includes the following improvements to `cargo-component`: * `cargo-component` now componentizes based off the presence of component type information custom sections rather than always requiring a `[package.metadata.component]` section be present in `Cargo.toml`. * Bindings generation will now occur if a `wit` directory is present and `[package.metadata.component]` is not present in `Cargo.toml`. * Fix a panic in `cargo component add` if it encounters expected items that are not tables in `Cargo.toml`. * Fix not setting implicit tables for intermediate tables for the `cargo component add` command. * Fix not displaying anything when `--help` is present for commands passed directly to `cargo`. * `cargo-component` now uses the command adapter for binary examples and test/bench artifacts. * `cargo-component` now displays the same "Running" message that `cargo` does when using the `run`, `test`, and `bench` commands. * Some paths displayed in status messages have been prefix-stripped based on the CWD. This commit also contains a bit of refactoring to `run_cargo_command`, as it was getting long and unwieldy. Fixes #236. * Remove `Option` from component section in metadata. This makes using the section more ergonomic.
Repro
If we run the following commands to build the wasi crate:
cargo install cargo-component git clone https://github.com/bytecodealliance/wasi cd wasi cargo component build --example hello-world
This results in the following output:
Manual build instructions
The
wasi
crate suggests the following instructions to get it to build correctly:This results in the following output:
Expected behavior
From the outset I was expecting this to just work? Is it that
cargo run --example
isn't implemented yet? It does seem to build thewasm32-wasi
example correctly. Or is something else perhaps not working when it should?The text was updated successfully, but these errors were encountered: