authorgravatar for paul.verigo@gmail.comPavel Verigo <paul.verigo@gmail.com> 2026-08-16 19:01:56+02:00
committergravatar for paul.verigo@gmail.comPavel Verigo <paul.verigo@gmail.com> 2026-08-16 19:01:56+02:00
log23541774d6b01b1b614cc5aa3514295ce88917a5
tree0b7d80e49c600ad593e04baf2728ce339c4db7a8
parent99e540dc39ba45365eaa82db0459a0d7acc251eb

wasm: enable incremental tests for selfhosted

Closes #31810

3 files changed, 14 insertions(+), 7 deletions(-)

build.zig+1-1
...@@ -772,7 +772,7 @@ pub fn build(b: *std.Build) !void {...@@ -772,7 +772,7 @@ pub fn build(b: *std.Build) !void {
772 }772 }
773773
774 const test_incremental_step = b.step("test-incremental", "Run the incremental compilation test cases");774 const test_incremental_step = b.step("test-incremental", "Run the incremental compilation test cases");
775 try tests.addIncrementalTests(b, test_incremental_step, test_filters);775 try tests.addIncrementalTests(b, test_incremental_step, test_filters, test_target_filters);
776 if (!skip_test_incremental) test_step.dependOn(test_incremental_step);776 if (!skip_test_incremental) test_step.dependOn(test_incremental_step);
777777
778 if (tests.addLibcTestNszTests(b, .{778 if (tests.addLibcTestNszTests(b, .{
src/link/Wasm.zig-3
...@@ -3754,9 +3754,6 @@ pub fn updateExports(...@@ -3754,9 +3754,6 @@ pub fn updateExports(
3754 const ip = &zcu.intern_pool;3754 const ip = &zcu.intern_pool;
3755 const is_obj = wasm.base.comp.config.output_mode == .Obj;3755 const is_obj = wasm.base.comp.config.output_mode == .Obj;
37563756
3757 wasm.nav_exports.clearRetainingCapacity();
3758 wasm.uav_exports.clearRetainingCapacity();
3759
3760 for (export_indices) |export_idx| {3757 for (export_indices) |export_idx| {
3761 const exp = export_idx.ptr(zcu);3758 const exp = export_idx.ptr(zcu);
3762 const name_slice = exp.opts.name.toSlice(ip);3759 const name_slice = exp.opts.name.toSlice(ip);
test/tests.zig+13-3
...@@ -2237,8 +2237,7 @@ const incremental_targets: []const []const u8 = &.{...@@ -2237,8 +2237,7 @@ const incremental_targets: []const []const u8 = &.{
2237 "x86_64-linux-selfhosted",2237 "x86_64-linux-selfhosted",
2238 // https://codeberg.org/ziglang/zig/issues/317732238 // https://codeberg.org/ziglang/zig/issues/31773
2239 //"x86_64-windows-selfhosted",2239 //"x86_64-windows-selfhosted",
2240 // https://codeberg.org/ziglang/zig/issues/318102240 "wasm32-wasi-selfhosted",
2241 //"wasm32-wasi-selfhosted",
2242};2241};
22432242
2244fn compatible32bitArch(host: *const std.Target) ?std.Target.Cpu.Arch {2243fn compatible32bitArch(host: *const std.Target) ?std.Target.Cpu.Arch {
...@@ -3248,7 +3247,12 @@ pub fn addDebuggerTests(b: *std.Build, options: DebuggerContext.Options) ?*Step...@@ -3248,7 +3247,12 @@ pub fn addDebuggerTests(b: *std.Build, options: DebuggerContext.Options) ?*Step
3248 return step;3247 return step;
3249}3248}
32503249
3251pub fn addIncrementalTests(b: *std.Build, test_step: *Step, test_filters: []const []const u8) !void {3250pub fn addIncrementalTests(
3251 b: *std.Build,
3252 test_step: *Step,
3253 test_filters: []const []const u8,
3254 test_target_filters: []const []const u8,
3255) !void {
3252 const io = b.graph.io;3256 const io = b.graph.io;
32533257
3254 const incr_check = b.addExecutable(.{3258 const incr_check = b.addExecutable(.{
...@@ -3283,6 +3287,12 @@ pub fn addIncrementalTests(b: *std.Build, test_step: *Step, test_filters: []cons...@@ -3283,6 +3287,12 @@ pub fn addIncrementalTests(b: *std.Build, test_step: *Step, test_filters: []cons
3283 b.dependOnFileContents(b.path(b.pathJoin(&.{ "test", "incremental", entry.path })));3287 b.dependOnFileContents(b.path(b.pathJoin(&.{ "test", "incremental", entry.path })));
32843288
3285 for (incremental_targets) |target_str| {3289 for (incremental_targets) |target_str| {
3290 if (test_target_filters.len > 0) {
3291 for (test_target_filters) |filter| {
3292 if (std.mem.find(u8, target_str, filter) != null) break;
3293 } else continue;
3294 }
3295
3286 const run = b.addRunArtifact(incr_check);3296 const run = b.addRunArtifact(incr_check);
3287 run.setName(b.fmt("incr-check {s} '{s}'", .{ target_str, entry.basename }));3297 run.setName(b.fmt("incr-check {s} '{s}'", .{ target_str, entry.basename }));
32883298