feat: support wasm build
We are using notify as watcher and build it to wasm32-wasip2 and run it at https://stackblitz.com/.
But when using notify-debouncer-full to instead of notify, it can't build because the get_file_id is not implement at wasm. The std::os::wasi::fs::MetadataExt is implement at nightly rust, the stable version hasn't it. So here using NoCache for wasm to avoid the issue.
I try to add a build wasm32-wasip2 ci, but the rust toolchain version is 1.77.2, it hasn't support the wasm32-wasip2 target.It need to bump rust toolchain at first. If you approved it, please ping me i will upgrade it at first.
Thank your excellent work!
I try to add a build wasm32-wasip2 ci, but the rust toolchain version is 1.77.2, it hasn't support the wasm32-wasip2 target.It need to bump rust toolchain at first. If you approved it, please ping me i will upgrade it at first.
The CI setup for notify is totally broken at the moment. But ideally, it would run for multiple toolchains, regardless of the contents of the rust-toolchain.toml file. We want to run the pipelines for the nightly toolchain as well. If you want, you can add a wasm job.
I have never worked with wasi and I have no idea how notify should handle a wasi environment. How FS event notification even works there. Would it be possible to implement get_file_id for wasi?
How FS event notification even works there
The wasi implemented the basic std::fs relate API, it worked fine at https://stackblitz.com/.
- ref https://github.com/rust-lang/rust/pull/59619
- ref https://doc.rust-lang.org/std/os/wasi/fs/index.html.
Would it be possible to implement get_file_id for wasi?
Yeah. The std::os::wasi::fs::MetadataExt is implement at nightly rust, the stable version hasn't it. If it move into stable version we could implement it.