Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WASI path_create_directory recusively creates directories #5157

Closed
yagehu opened this issue Oct 18, 2024 · 0 comments · Fixed by #5158
Closed

WASI path_create_directory recusively creates directories #5157

yagehu opened this issue Oct 18, 2024 · 0 comments · Fixed by #5158

Comments

@yagehu
Copy link
Contributor

yagehu commented Oct 18, 2024

Describe the bug

path_create_directory on Wasmer recursively creates directories if a directory component in path does not exist. It should return something like ENOENT.

wasmer -vV; rustc -vV
wasmer 4.4.0 (8b97cfe 2024-10-18)
binary: wasmer-cli
commit-hash: 8b97cfe3992ae3c2f0002f9955fcb23057f666a9
commit-date: 2024-10-18
host: x86_64-unknown-linux-gnu
compiler: singlepass,cranelift
c_api backend: 
rustc 1.81.0 (eeb90cda1 2024-09-04)
binary: rustc
commit-hash: eeb90cda1969383f56a2637cbd3037bdf598841c
commit-date: 2024-09-04
host: x86_64-unknown-linux-gnu
release: 1.81.0
LLVM version: 18.1.7

Steps to reproduce

This code snippet, when compiled with wasi crate v0.11, should pass when run. Other runtimes like Wasmtime, WasmEdge, Wazero, and WAMR do pass. Wasmer however, fails, creating the directory in the virtual filesystem.

fn main() {
    unsafe {
        assert_eq!(
            wasi::path_create_directory(5, "not-exist/dir").unwrap_err(),
            wasi::ERRNO_NOENT
        );
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant