-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
I was walking through how to pull down the WITs to reproduce this sample from scratch and I thought i would share by steps using wkg in case it is helpful to add to CI:
- Create a wkg config that points to the WebAssembly OCI registry for WASI packages
cat > ~/.config/wasm-pkg/config.toml <<EOL
#wkg.toml
default_registry = "ghcr.io"
[namespace_registries]
wasi = { registry = "wasi", metadata = { preferredProtocol = "oci", "oci" = {registry = "ghcr.io", namespacePrefix = "webassembly/" } } }
[package_registry_overrides]
[registry]
EOL
- Use wkg to get the dependency packages
mkdir -p wit/deps/http wit/deps/cli wit/deps/clocks/ wit/deps/filesystem/ wit/deps/io/ wit/deps/random/ wit/deps/sockets/
wkg get --format wit wasi:[email protected] -o wit/deps/http/
wkg get --format wit wasi:[email protected] -o wit/deps/cli/
wkg get --format wit wasi:[email protected] -o wit/deps/clocks/
wkg get --format wit wasi:[email protected] -o wit/deps/filesystem/
wkg get --format wit wasi:[email protected] -o wit/deps/io/
wkg get --format wit wasi:[email protected] -o wit/deps/random/
wkg get --format wit wasi:[email protected] -o wit/deps/sockets/
- Add the world for the component
cat > wit/world.wit <<EOL
package sunfishcode:hello-wasi-http;
world target-world {
include wasi:http/[email protected];
}
EOL
Metadata
Metadata
Assignees
Labels
No labels