Skip to content

std.fs.test file operations on directories fails with Wasmtime 23.0.1 #20747

Description

@alexrp

Zig Version

1fc42ed

Steps to Reproduce and Observed Behavior

  1. Install Wasmtime 23.0.1 (maybe earlier?).
  2. Run the standard library tests with -fwasmtime (but see std.Build.Step.Run: Fix invocation syntax for Wasmtime 14+. #20745).
error: 'fs.test.test.file operations on directories' failed: expected error.IsDir, found fs.File{ .handle = 4 }
Unable to dump stack trace: not implemented for Wasm

Fails here:

zig/lib/std/fs/test.zig

Lines 767 to 769 in eac7fd4

// Note: The `.mode = .read_write` is necessary to ensure the error occurs on all platforms.
// TODO: Add a read-only test as well, see https://github.com/ziglang/zig/issues/5732
try testing.expectError(error.IsDir, ctx.dir.openFile(test_dir_name, .{ .mode = .read_write }));

Expected Behavior

No failure.

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

    Labels

    bugObserved behavior contradicts documented or intended behaviordownstreamAn issue with a third party project that uses Zig.os-wasiWebAssembly System Interface

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions