Skip to content

pathchk: empty path operand is accepted under WASI (wasmtime) #14970

Description

@eduardomourar

Summary

Under the WASI runner (wasmtime, wasip1), pathchk "" with a preopened succeeds instead of failing with "No such file or directory". This diverges from the behavior on other platforms and from GNU.

Details

pathchk decides whether to reject an empty operand by asking the platform via fs::symlink_metadata. On Unix hosts symlink_metadata("") returns ENOENT, so the empty path is rejected. Under WASI with a preopen, it returns Ok, so the operand is accepted and no error is produced.

Reproduction

wasmtime --dir=.::/ pathchk.wasm ""

Expected: pathchk: '': No such file or directory and a non-zero exit. Actual (WASI): succeeds with no output.

Impact

The empty-path assertions in test_default_mode cannot run under the WASI runner and are gated out there. The rest of the test still runs.

System details

Rust version: 1.98.1
Target: wasm32-wasip1
wasmtime: 47.0.3

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions