wingo opened issue #12173:
On https://github.com/WebAssembly/wasi-testsuite/pull/139, there is a test that
ln_s("".to_string(), "whatever".to_string())fails. However it succeeds on MacOS for some reason.Wasmtime should filter out
""as a symlink target, if the OS is unwilling to do so.(Does
touch ""work on (any filesystem from) MacOS? I would hope not; if so, perhaps that means we have to allow forln_stargetting"".)
wingo added the bug label to Issue #12173.
bjorn3 commented on issue #12173:
touch ""doesn't work on macOS, but you are allowed to make a symlink with an empty filename as target.
wingo edited issue #12173:
On https://github.com/WebAssembly/wasi-testsuite/pull/139, there is a test that
ln_s("".to_string(), "whatever".to_string())fails. However it succeeds on MacOS for some reason.Should wasmtime filter out
""as a symlink target, if the OS is unwilling to do so?(Does
touch ""work on (any filesystem from) MacOS? I would hope not; if so, perhaps that means we have to allow forln_stargetting"".)
fitzgen added the wasi:impl label to Issue #12173.
fitzgen added the wasi:tests label to Issue #12173.
fitzgen added the wasi label to Issue #12173.
alexcrichton commented on issue #12173:
Similar to https://github.com/bytecodealliance/wasmtime/issues/12178#issuecomment-3671670651 I personally think this is something that's not clear whether we should filter out or handle. This is easier than others, but it's not clear to me.
@wingo these issues might be best for the WASI repository as spec questions perhaps? Here as an implementation we currently forward to whatever the closest platform equivalent for a function is which is more-or-less what I'd expect all other implementations to do. Divergence from that and codifying it one way or another to me is more of a spec question than an implementation question.
wingo commented on issue #12173:
Well... besides wasmtime being the only wasip3 implementation that I know of at the moment (I still haven't gotten jco to pass any of the wasi-testsuite), if it were just up to the spec then one would specify a single behavior -- except that's not how it works, we need to implement something that is feasible to implement on Windows and Mac, and to that extent "what Wasmtime is willing to do" is a key part of the spec-defining process :) Also there is not really anyone "there" on the WASI side at the moment AFAICT.
In this specific instance... gosh I would just prevent the user from making new symlinks to
"". Reduce the state space. WDYT? Happy to do either but the buck stops here; I think we get to decide what the right thing is :) Will document it either way.
alexcrichton commented on issue #12173:
I won't claim to be a filesystem expert by any means but outright rejecting empty names seems reasonable to me. If someone has a use case for that we can handle it later at that point?
Last updated: Jan 09 2026 at 13:15 UTC