Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danbugs/wasi-wit-download
A CLI tool to download and extract specific WIT dependencies from Wasmtime releases
https://github.com/danbugs/wasi-wit-download
Last synced: about 2 months ago
JSON representation
A CLI tool to download and extract specific WIT dependencies from Wasmtime releases
- Host: GitHub
- URL: https://github.com/danbugs/wasi-wit-download
- Owner: danbugs
- License: agpl-3.0
- Created: 2024-08-01T20:19:50.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-01T20:21:33.000Z (5 months ago)
- Last Synced: 2024-11-11T06:42:04.566Z (about 2 months ago)
- Language: Rust
- Homepage:
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# `wasi-wit-download`
Currently, there's lots of Wasm projects that require manual setup from the user. Part of that manual setup commonly involves downloading WIT files from a specific Wasmtime release. This project aims to automate that process by providing a CLI tool that can download WIT files for a specific Wasmtime release.
## How to install?
```bash
cargo install wasi-wit-download
```## How to use?
```bash
wasi-wit-download ...
```## Example
```bash
wasi-wit-download 18 cli clocks
```Output:
```text
Downloading from Wasmtime version: 18
WIT dependencies to download: ["cli", "clocks"]
Downloaded: "cli"
Downloaded: "clocks"
```This will download the WIT files for the `cli` and `clocks` dependencies from the Wasmtime release `18` to the current directory.
If you request a WIT dependency that doesn't exist, the tool will print an error message and exit.
```bash
$ wasi-wit-download 18 cli foo clocks
Downloading from Wasmtime version: 18
WIT dependencies to download: ["cli", "foo", "clocks"]
Downloaded: "cli"
Downloaded: "clocks"
Error: The following folders were not found in the archive: ["foo"]
error: process didn't exit successfully: `wasi-wit-download.exe 18 cli clocks foo` (exit code: 1)
```> Note: The WIT dependencies `cli` and `clocks` will still be downloaded.
## Limitations
- This only works for Wasmtime versions 10 and above because we hardcode WIT deps search from `wasmtime-{version}.0.0/crates/wasi/wit/deps` which only exists in versions 10 onwards.
- There's no CI for testing. Only manual testing.
- We only allow downloading WIT files from major Wasmtime releases (e.g., 10, 11, 12, etc.). We don't support downloading WIT files from minor releases (e.g., 10.1, 10.2, 10.3, etc.).