Skip to content

stdlib suggests using selfExePathAlloc instead of selfExePath on wasi even though the former calls the latter #17085

Description

@xdBronch

Zig Version

0.12.0-dev.278+0e8f130ae

Steps to Reproduce and Observed Behavior

attempt to use std.fs.selfExePath with wasi as the target OS
met with error message std.fs.selfExePath not supported for WASI. Use std.fs.selfExePathAlloc instead.

.wasi => @compileError("std.fs.selfExePath not supported for WASI. Use std.fs.selfExePathAlloc instead."),

use selfExePathAlloc as suggested but same error
return allocator.dupe(u8, try selfExePath(&buf));

Expected Behavior

compile error should give a correct message

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 behaviorcontributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.standard libraryThis issue involves writing Zig code for the standard library.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions