Skip to content

Commit 81b4224

Browse files
committed
debug.zig: prevent checking posix.system.msync on Wasi
There is an msync symbol when compiling against Wasi, but its creates dependencies on the C library in that environment that seem to be problematic for std.debug. To be consistent with the old debug.zig, just force have_msync false in the Wasi environment.
1 parent 25d235d commit 81b4224

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/std/debug.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,8 @@ pub const StackIterator = struct {
839839
}
840840
};
841841

842-
const have_msync = @TypeOf(posix.system.msync) != void;
842+
// WASI has an msync, but its not good enough (See PR #20845)
843+
const have_msync = native_os != .wasi and @TypeOf(posix.system.msync) != void;
843844

844845
pub fn writeCurrentStackTrace(
845846
out_stream: anytype,

0 commit comments

Comments
 (0)