Skip to content

Since Wasmtime 20, preopens of non-existent directories fail eagerly rather than on first access #8552

@whitequark

Description

@whitequark

Test Case

The simplest way to reproduce this is to create a Python virtual environment on a Windows machine and install yowasp-yosys in it. This application uses WASI preopens in the following way to make all of the files on the host available:

            for letter in "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ":
                wasi_cfg.preopen_dir(letter + ":\\", letter + ":")

Steps to Reproduce

  • Create a preopen with a non-existent drive letter as a target.

Expected Results

  • As in Wasmtime 19, using the preopen fails when it's actually accessed.

Actual Results

  • In Wasmtime 20, configuring WASI fails.

Versions and Environment

Wasmtime version or commit: 20.0.0

Operating system: Windows

Architecture: x64

Additional information

I can work around this easily enough (though the workaround is kind of cursed) but I'm filing this to make sure the change was intentional. I looked through release notes and PRs that seemed relevant but I'm not sure what has actually caused this change to happen. Is the behavior intentional?

Metadata

Metadata

Assignees

Labels

bugIncorrect behavior in the current implementation that needs fixing

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions