Skip to content

Commit

Permalink
debug.zig: prevent checking posix.system.msync on Wasi
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rootbeer committed Jul 29, 2024
1 parent 25d235d commit 81b4224
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/std/debug.zig
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,8 @@ pub const StackIterator = struct {
}
};

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

pub fn writeCurrentStackTrace(
out_stream: anytype,
Expand Down

0 comments on commit 81b4224

Please sign in to comment.