Skip to content

Commit

Permalink
Merge pull request #186 from liigo/fix-wasi-cli
Browse files Browse the repository at this point in the history
fix a few `wasi:cli` typos
  • Loading branch information
kate-goldenring authored Dec 11, 2024
2 parents e6de097 + 8beb4d3 commit 449f64e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions component-model/src/language-support/rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ As the import is unfulfilled, the `calculator.wasm` component could not run by i

## Creating a command component with `cargo component`

A _command_ is a component with a specific export that allows it to be executed directly by `wasmtime` (or other `wasm:cli` hosts). In Rust terms, it's the equivalent of an application (`bin`) package with a `main` function, instead of a library crate (`lib`) package.
A _command_ is a component with a specific export that allows it to be executed directly by `wasmtime` (or other `wasi:cli` hosts). In Rust terms, it's the equivalent of an application (`bin`) package with a `main` function, instead of a library crate (`lib`) package.

To create a command with cargo component, run:

Expand All @@ -204,7 +204,7 @@ cargo component new <name>

Unlike library components, this does _not_ have the `--lib` flag. You will see that the created project is different too:

- It doesn't contain a `.wit` file. `cargo component build` will automatically export the `wasm:cli/run` interface for Rust `bin` packages, and hook it up to `main`.
- It doesn't contain a `.wit` file. `cargo component build` will automatically export the `wasi:cli/run` interface for Rust `bin` packages, and hook it up to `main`.
- Because there's no `.wit` file, `Cargo.toml` doesn't contain a `package.metadata.component.target` section.
- The Rust file is called `main.rs` instead of `lib.rs`, and contains a `main` function instead of an interface implementation.

Expand Down
2 changes: 1 addition & 1 deletion component-model/src/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ documentation](creating-and-consuming/authoring.md) to create a component that i
## Create a `command` component

A _command_ is a component with a specific export that allows it to be executed directly by
`wasmtime` (or other `wasm:cli` hosts). The host expects it to export the [`wasi:cli/run`
`wasmtime` (or other `wasi:cli` hosts). The host expects it to export the [`wasi:cli/run`
interface](https://github.com/WebAssembly/wasi-cli/blob/main/wit/run.wit), which is the equivalent
of the `main` function to WASI. `cargo-component` will automatically resolve a Rust `bin` package
with a `main` function to a component with `wasi:cli/run` exported. Scaffold a new Wasm application
Expand Down

0 comments on commit 449f64e

Please sign in to comment.