Stream: git-wasmtime

Topic: wasmtime / issue #11667 wasip3 filesystem: Opening dir wi...


view this post on Zulip Wasmtime GitHub notifications bot (Sep 10 2025 at 15:10):

wingo opened issue #11667:

async fn test_flags_and_type(dir: &Descriptor) {
    let open = |path: &str, oflags: OpenFlags, fdflags: DescriptorFlags| -> _ {
        dir.open_at(PathFlags::empty(), path.to_string(), oflags, fdflags)
    };
    let d = open(".", OpenFlags::empty(), DescriptorFlags::MUTATE_DIRECTORY).await.unwrap();
    assert_eq!(d.get_flags().await,
               Ok(DescriptorFlags::READ | DescriptorFlags::MUTATE_DIRECTORY));
}

I would expect that the directory is opened with MUTATE_DIRECTORY. However it seems it is not:

openat2(3, ".", {flags=O_RDONLY|O_LARGEFILE|O_NOFOLLOW|O_CLOEXEC, resolve=RESOLVE_NO_MAGICLINKS|RESOLVE_BENEATH}, 24) = 12
statx(12, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFDIR|0755, stx_size=4096, ...}) = 0
fcntl(12, F_GETFL)                      = 0x28000 (flags O_RDONLY|O_LARGEFILE|O_NOFOLLOW)

It seems we only have READ:

thread '<unnamed>' (1) panicked at src/bin/filesystem.rs:620:5:
assertion `left == right` failed
  left: Ok(DescriptorFlags(READ))
 right: Ok(DescriptorFlags(READ | MUTATE_DIRECTORY))

view this post on Zulip Wasmtime GitHub notifications bot (Sep 10 2025 at 15:10):

wingo added the bug label to Issue #11667.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 10 2025 at 15:17):

wingo commented on issue #11667:

It's weirder than that; MUTATE_DIRECTORY doesn't seem to be propagated at all:

    let d = open(".", OpenFlags::DIRECTORY,
                 DescriptorFlags::READ | DescriptorFlags::MUTATE_DIRECTORY).await.unwrap();
    assert_eq!(d.get_flags().await,
               Ok(DescriptorFlags::READ | DescriptorFlags::MUTATE_DIRECTORY));

Here the assertion fails; the flags that I get are just READ.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 10 2025 at 19:04):

alexcrichton added the wasi:impl label to Issue #11667.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 10 2025 at 19:04):

alexcrichton added the wasi label to Issue #11667.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 10 2025 at 19:05):

alexcrichton commented on issue #11667:

I think MUTATE_DIRECTORY is entirely unimplemented in Wasmtime. I'm not seeing any references to it at all. Wasmtime does implement READ and WRITE and I suspect in the transition to p2 this was changed in the WITs but never updated in Wasmtime, so variuos bits and pieces which check for WRITE probably need to check for this instead.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 11 2025 at 09:28):

wingo commented on issue #11667:

Preopened directories do have MUTATE_DIRECTORY in wasmtime, fwiw.


Last updated: Dec 06 2025 at 06:05 UTC