Commit a09f2e9
authored
Add WASI P3 tabs to creating-runnable-components/rust.md (#350)
* docs(creating-runnable-components/rust): add WASI P3 tabs
WASI 0.3.0 made `wasi:cli/run` an `async func`, so this page now teaches
the P3 pattern alongside the existing P2 one. Tab the build and run
invocations to cover the `wasm32-wasip3` nightly target and the
`-Sp3 -W component-model-async=y` flags, tab the WIT to pin
`wasi:cli/run@0.3.0`, and tab the Rust code to show the `async fn run()`
signature that `wit-bindgen` with the `async` feature now generates.
Signed-off-by: Eric Gregory <eric@cosmonic.com>
* docs(creating-runnable-components/rust): revise P3 tabs against verified path
Walked the page end-to-end against the current toolchain and reworked the
P3 content to match what actually works on 2026-06-12:
- Drop the P3 tab from "Creating a command component". `rustup target add
wasm32-wasip3` fails (Tier 3, no prebuilt artifacts), and Rust's std
has not yet migrated to use P3 imports, so the `fn main()` pattern has
no honest P3 story today. Replace with a pointer to the library/reactor
pattern below.
- Library/reactor P3 tabs now build against `wasm32-wasip2` with a
nightly toolchain (stable's bundled `wasm-component-ld` cannot decode
the component-type custom section `wit-bindgen` 0.58 emits for P3
worlds).
- Pin the P3 WIT example to `wasi:cli/run@0.3.0-rc-2026-03-15`. The
published `0.3.0` tag fails at run time against current Wasmtime and
`wit-bindgen` (the version-pinning trap we documented as a footnote is
load-bearing today).
- Note that `wkg` 0.15 or later is needed for `wkg wit fetch` on the P3
package.
- Fix a long-standing path bug: cargo converts hyphens to underscores in
library crate names, so the artifact is `runnable_example.wasm`, not
`runnable-example.wasm`, and lives under `target/.../debug/`.
- Update the top-of-page notice and the bottom version-pinning blockquote
to capture the transitional state.
Signed-off-by: Eric Gregory <eric@cosmonic.com>
* docs: rename WASI P2/P3 to WASI 0.2/0.3 in rust runnable-components page
Per WASI maintainer guidance, refer to the WASI specifications as
"WASI 0.2" and "WASI 0.3" in prose. Technical identifiers like
`wasm32-wasip3`, `-Sp3`, and `wasi:cli/run@0.3.0-rc-...` are
unaffected.
Signed-off-by: Eric Gregory <eric@cosmonic.com>
---------
Signed-off-by: Eric Gregory <eric@cosmonic.com>1 parent 856387d commit a09f2e9
1 file changed
Lines changed: 117 additions & 3 deletions
Lines changed: 117 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
3 | 11 | | |
4 | 12 | | |
5 | 13 | | |
| |||
45 | 53 | | |
46 | 54 | | |
47 | 55 | | |
48 | | - | |
| 56 | + | |
49 | 57 | | |
50 | 58 | | |
51 | 59 | | |
| |||
57 | 65 | | |
58 | 66 | | |
59 | 67 | | |
| 68 | + | |
| 69 | + | |
60 | 70 | | |
61 | 71 | | |
62 | 72 | | |
| |||
91 | 101 | | |
92 | 102 | | |
93 | 103 | | |
| 104 | + | |
| 105 | + | |
94 | 106 | | |
95 | 107 | | |
96 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
97 | 118 | | |
98 | 119 | | |
99 | 120 | | |
100 | 121 | | |
101 | 122 | | |
102 | 123 | | |
| 124 | + | |
| 125 | + | |
103 | 126 | | |
104 | 127 | | |
105 | 128 | | |
| |||
112 | 135 | | |
113 | 136 | | |
114 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
115 | 158 | | |
116 | 159 | | |
117 | 160 | | |
| |||
126 | 169 | | |
127 | 170 | | |
128 | 171 | | |
| 172 | + | |
| 173 | + | |
129 | 174 | | |
130 | 175 | | |
131 | 176 | | |
| |||
137 | 182 | | |
138 | 183 | | |
139 | 184 | | |
| 185 | + | |
| 186 | + | |
140 | 187 | | |
141 | 188 | | |
142 | 189 | | |
| |||
164 | 211 | | |
165 | 212 | | |
166 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
167 | 246 | | |
168 | 247 | | |
169 | 248 | | |
| 249 | + | |
| 250 | + | |
170 | 251 | | |
171 | 252 | | |
172 | 253 | | |
| |||
175 | 256 | | |
176 | 257 | | |
177 | 258 | | |
178 | | - | |
| 259 | + | |
179 | 260 | | |
180 | 261 | | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
181 | 279 | | |
182 | 280 | | |
183 | 281 | | |
| 282 | + | |
| 283 | + | |
184 | 284 | | |
185 | 285 | | |
186 | 286 | | |
187 | 287 | | |
188 | | - | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
189 | 299 | | |
190 | 300 | | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
0 commit comments