-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Revamp wasi example and related docs #9788
base: main
Are you sure you want to change the base?
Conversation
But now there comes another issue: this hello-world example is just too specific to wasi:cli, since we used a specific BTW, I still don't know why I could not get a |
Personally I think it's reasonable to start with hello-world like this and then graduate up to other examples. For example this page could link to the
You needed another invocation of |
OK, I think this draft PR seems good to me now, so I turned it into a formal PR. |
OK, got that. I also added related code in the example to demonstrate how to do that. BTW, do you know why |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This is bit counter-intuitive when I want to write something like func.typed::<(), Result<(), ()>>(&store),
This is currently intentional in the sense that it's in theory preferred to use the output of bindgen!
where you don't have to deal with this. In that sense the raw component APIs weren't designed to be the most ergonomic and easy-to-use since that's where bindgen!
comes in to close the gap.
IIRC there were coherence with that trait impl, but I could be misremembering as well.
Oops. CI complains about file not found Furthermore, I digged into For example, wasmtime/crates/c-api/src/linker.rs Line 111 in db4bd21
I think removing wasmtime/crates/c-api/Cargo.toml Line 36 in db4bd21
I'd rather like to skip this error first and open another tracking issue. |
Can you take a look at the CI error Test C-API macos-latest? I think I made a right correction on CMakeList.txt but I don't know what else needs to be fixed. |
Have you tried running the example locally? |
For the C example, inside |
Ah I better understand what was going on now. Instead of replacing the current example which I think is still useful for wasm32-wasip1 targets, could this perhaps rename the prior wasi example to wasip1 and add this new example under wasip2? There then wouldn't be a C example of wasip2 because that's not supported yet. |
OK, I've brought back wasip1 examples. |
This test failure is weird to me. I have cleaned all caches and run the commands in this test manually on my Mac but I saw no failures. |
Closes #9777
For now, this is a draft PR because there's a runtime issue in the revamp example. Please see the FIXME inexamples/wasi/main.rs
. There I want to invoke the exportedwasi:cli/[email protected]
function, which is the main function inexamples/wasi/wasm/wasi.rs
. Probably @alexcrichton or @fitzgen can help a bit? Thanks!When the runtime issue is fixed, I will try to revamp more sections in the related doc in following commitsUpdated:
This PR revamps the examples
wasi
andwasi-async
with latest updates fromwasmtime
andwasmtime-wasi
and uses WASIp2 APIs by default. Related documentation is also updated.