Stream: git-wasmtime

Topic: wasmtime / issue #8828 Cannot remove directories when the...


view this post on Zulip Wasmtime GitHub notifications bot (Jun 17 2024 at 21:47):

alexcrichton opened issue #8828:

Currently this program on Linux:

fn main() {
    std::fs::remove_dir_all("temp-dir").unwrap();

    std::fs::create_dir("temp-dir").unwrap();
    std::fs::remove_dir("temp-dir").unwrap(); // this line passes
    std::fs::create_dir("temp-dir").unwrap();
    std::fs::remove_dir("temp-dir/").unwrap(); // this line fails
}

will fail to execute in Wasmtime:

wasmtime run --dir . ./foo.wasm
thread 'main' panicked at foo.rs:7:38:
called `Result::unwrap()` on an `Err` value: Os { code: 28, kind: InvalidInput, message: "Invalid argument" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Error: failed to run main module `./foo.wasm`

This causes this test to fail in the wasi-testsuite.

cc @sunfishcode I think this has something to do with this function being used here, although this code looks more subtle than my current understanding. Do you know if this has come up before with cap-std and/or if this is appropriate to fix there?


Last updated: Dec 23 2024 at 13:07 UTC