diff --git a/build.zig b/build.zig index a43a8929f2..fb90c49ac8 100644 --- a/build.zig +++ b/build.zig @@ -319,7 +319,21 @@ pub fn build(b: *Build) !void { .{ .os = .linux, .arch = .aarch64 }, .{ .os = .linux, .arch = .x86_64, .musl = true }, .{ .os = .linux, .arch = .aarch64, .musl = true }, - }); + }, &.{ .Debug, .ReleaseFast }); + } + + // zig build check-all-debug + { + const step = b.step("check-all-debug", "Check for semantic analysis errors on all supported platforms in debug mode"); + addMultiCheck(b, step, build_options, &.{ + .{ .os = .windows, .arch = .x86_64 }, + .{ .os = .mac, .arch = .x86_64 }, + .{ .os = .mac, .arch = .aarch64 }, + .{ .os = .linux, .arch = .x86_64 }, + .{ .os = .linux, .arch = .aarch64 }, + .{ .os = .linux, .arch = .x86_64, .musl = true }, + .{ .os = .linux, .arch = .aarch64, .musl = true }, + }, &.{.Debug}); } // zig build check-windows @@ -327,21 +341,21 @@ pub fn build(b: *Build) !void { const step = b.step("check-windows", "Check for semantic analysis errors on Windows"); addMultiCheck(b, step, build_options, &.{ .{ .os = .windows, .arch = .x86_64 }, - }); + }, &.{ .Debug, .ReleaseFast }); } { const step = b.step("check-macos", "Check for semantic analysis errors on Windows"); addMultiCheck(b, step, build_options, &.{ .{ .os = .mac, .arch = .x86_64 }, .{ .os = .mac, .arch = .aarch64 }, - }); + }, &.{ .Debug, .ReleaseFast }); } { const step = b.step("check-linux", "Check for semantic analysis errors on Windows"); addMultiCheck(b, step, build_options, &.{ .{ .os = .linux, .arch = .x86_64 }, .{ .os = .linux, .arch = .aarch64 }, - }); + }, &.{ .Debug, .ReleaseFast }); } // zig build translate-c-headers @@ -369,9 +383,10 @@ pub fn addMultiCheck( parent_step: *Step, root_build_options: BunBuildOptions, to_check: []const struct { os: OperatingSystem, arch: Arch, musl: bool = false }, + optimize: []const std.builtin.OptimizeMode, ) void { for (to_check) |check| { - for ([_]std.builtin.Mode{ .Debug, .ReleaseFast }) |mode| { + for (optimize) |mode| { const check_target = b.resolveTargetQuery(.{ .os_tag = OperatingSystem.stdOSTag(check.os), .cpu_arch = check.arch, diff --git a/src/btjs.zig b/src/btjs.zig index cd4e1dd73a..85e61c9bc4 100644 --- a/src/btjs.zig +++ b/src/btjs.zig @@ -29,7 +29,7 @@ pub export fn dumpBtjsTrace() [*:0]const u8 { var context: std.debug.ThreadContext = undefined; const has_context = std.debug.getContext(&context); - var it: std.debug.StackIterator = (if (has_context) blk: { + var it: std.debug.StackIterator = (if (has_context and !bun.Environment.isWindows) blk: { break :blk std.debug.StackIterator.initWithContext(null, debug_info, &context) catch null; } else null) orelse std.debug.StackIterator.init(null, null); defer it.deinit();