Skip to content

Commit 7c58cf0

Browse files
authored
Add a note on WebAssembly to README.md
1 parent efd571d commit 7c58cf0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,22 @@ A Rust equivalent of Unix command "which". Locate installed executable in cross
99
* Linux
1010
* Windows
1111
* macOS
12+
* wasm32-wasi*
13+
14+
### A note on WebAssembly
15+
16+
This project aims to support WebAssembly with the [wasi](https://wasi.dev/) extension. This extension is a requirement. `which` is a library for exploring a filesystem, and
17+
WebAssembly without wasi does not have a filesystem. `which` cannot do anything useful without this extension. Issues and PRs relating to
18+
`wasm32-unknown-unknown` and `wasm64-unknown-unknown` will not be resolved or merged. All `wasm32-wasi*` targets are officially supported.
19+
20+
If you need to add a conditional dependency on `which` for this reason please refer to [the relevant cargo documentation for platform specific dependencies.](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#platform-specific-dependencies)
21+
22+
Here's an example of how to conditionally add `which`. You should tweak this to your needs.
23+
24+
```toml
25+
[target.'cfg(not(all(target_family = "wasm", target_os = "unknown")))'.dependencies]
26+
which = "6.0.3"
27+
```
1228

1329
## Examples
1430

0 commit comments

Comments
 (0)