From 0e4263893c1c6fce4b08d4de07bfe5f558f3e9cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Tue, 13 Aug 2024 08:35:03 +0200 Subject: [PATCH 01/12] std.zig.system: Support qemu-sparc32plus for sparc32 with v9 in getExternalExecutor(). --- lib/std/zig/system.zig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/std/zig/system.zig b/lib/std/zig/system.zig index fe3394b615..9db8a0353b 100644 --- a/lib/std/zig/system.zig +++ b/lib/std/zig/system.zig @@ -98,7 +98,12 @@ pub fn getExternalExecutor( .riscv32 => Executor{ .qemu = "qemu-riscv32" }, .riscv64 => Executor{ .qemu = "qemu-riscv64" }, .s390x => Executor{ .qemu = "qemu-s390x" }, - .sparc => Executor{ .qemu = "qemu-sparc" }, + .sparc => Executor{ + .qemu = if (std.Target.sparc.featureSetHas(candidate.cpu.features, .v9)) + "qemu-sparc32plus" + else + "qemu-sparc", + }, .sparc64 => Executor{ .qemu = "qemu-sparc64" }, .x86_64 => Executor{ .qemu = "qemu-x86_64" }, else => return bad_result, From 8e75ade2531e8bf4f175b6866de528825f32f003 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Tue, 13 Aug 2024 08:37:09 +0200 Subject: [PATCH 02/12] std.zig.system: Support qemu-mipsn32(el) for mips with n32 ABI in getExternalExecutor(). --- lib/std/zig/system.zig | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/std/zig/system.zig b/lib/std/zig/system.zig index 9db8a0353b..da25613fb4 100644 --- a/lib/std/zig/system.zig +++ b/lib/std/zig/system.zig @@ -90,8 +90,18 @@ pub fn getExternalExecutor( .m68k => Executor{ .qemu = "qemu-m68k" }, .mips => Executor{ .qemu = "qemu-mips" }, .mipsel => Executor{ .qemu = "qemu-mipsel" }, - .mips64 => Executor{ .qemu = "qemu-mips64" }, - .mips64el => Executor{ .qemu = "qemu-mips64el" }, + .mips64 => Executor{ + .qemu = if (candidate.abi == .gnuabin32) + "qemu-mipsn32" + else + "qemu-mips64", + }, + .mips64el => Executor{ + .qemu = if (candidate.abi == .gnuabin32) + "qemu-mipsn32el" + else + "qemu-mips64el", + }, .powerpc => Executor{ .qemu = "qemu-ppc" }, .powerpc64 => Executor{ .qemu = "qemu-ppc64" }, .powerpc64le => Executor{ .qemu = "qemu-ppc64le" }, From f1af9eb83619273cf299f4abc301c7ae6ae07907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Tue, 13 Aug 2024 08:38:20 +0200 Subject: [PATCH 03/12] std.zig.system: Support qemu-xtensa in getExternalExecutor(). --- lib/std/zig/system.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/std/zig/system.zig b/lib/std/zig/system.zig index da25613fb4..92058fbf3b 100644 --- a/lib/std/zig/system.zig +++ b/lib/std/zig/system.zig @@ -86,7 +86,6 @@ pub fn getExternalExecutor( .arm => Executor{ .qemu = "qemu-arm" }, .armeb => Executor{ .qemu = "qemu-armeb" }, .hexagon => Executor{ .qemu = "qemu-hexagon" }, - .x86 => Executor{ .qemu = "qemu-i386" }, .m68k => Executor{ .qemu = "qemu-m68k" }, .mips => Executor{ .qemu = "qemu-mips" }, .mipsel => Executor{ .qemu = "qemu-mipsel" }, @@ -115,7 +114,9 @@ pub fn getExternalExecutor( "qemu-sparc", }, .sparc64 => Executor{ .qemu = "qemu-sparc64" }, + .x86 => Executor{ .qemu = "qemu-i386" }, .x86_64 => Executor{ .qemu = "qemu-x86_64" }, + .xtensa => Executor{ .qemu = "qemu-xtensa" }, else => return bad_result, }; } From 18e94c355e78837e6fda6de9dfcd59a945a0ab80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Tue, 13 Aug 2024 07:54:37 +0200 Subject: [PATCH 04/12] llvm: Also disable f16/f128 on aarch64_be with soft float. --- src/codegen/llvm.zig | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index 6453ea04a3..3ac0658df8 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -11760,7 +11760,9 @@ fn backendSupportsF16(target: std.Target) bool { .mips64el, .s390x, => false, - .aarch64 => std.Target.aarch64.featureSetHas(target.cpu.features, .fp_armv8), + .aarch64, + .aarch64_be, + => std.Target.aarch64.featureSetHas(target.cpu.features, .fp_armv8), else => true, }; } @@ -11773,7 +11775,9 @@ fn backendSupportsF128(target: std.Target) bool { .amdgcn, .sparc, => false, - .aarch64 => std.Target.aarch64.featureSetHas(target.cpu.features, .fp_armv8), + .aarch64, + .aarch64_be, + => std.Target.aarch64.featureSetHas(target.cpu.features, .fp_armv8), else => true, }; } From 2f101e2b6e3252af10cae0519688d094c4add2a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Tue, 13 Aug 2024 07:55:27 +0200 Subject: [PATCH 05/12] llvm: Disable f128 on mips64(el). https://github.com/llvm/llvm-project/issues/96432 --- src/codegen/llvm.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index 3ac0658df8..5a6eb83467 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -11773,6 +11773,8 @@ fn backendSupportsF16(target: std.Target) bool { fn backendSupportsF128(target: std.Target) bool { return switch (target.cpu.arch) { .amdgcn, + .mips64, + .mips64el, .sparc, => false, .aarch64, From 819fe51a7e0df712564c2632a1fa00ee8acf2275 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Tue, 13 Aug 2024 07:55:52 +0200 Subject: [PATCH 06/12] llvm: Disable f128 on powerpc*-aix. https://github.com/llvm/llvm-project/issues/101545 --- src/codegen/llvm.zig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index 5a6eb83467..0d91d4a702 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -11777,6 +11777,11 @@ fn backendSupportsF128(target: std.Target) bool { .mips64el, .sparc, => false, + .powerpc, + .powerpcle, + .powerpc64, + .powerpc64le, + => target.os.tag != .aix, .aarch64, .aarch64_be, => std.Target.aarch64.featureSetHas(target.cpu.features, .fp_armv8), From 019c0fc1845bb97298a23372f1fa8b4315dc114c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Tue, 13 Aug 2024 21:51:56 +0200 Subject: [PATCH 07/12] test: Re-enable mips(el)-linux-gnueabihf tests. Closes #4927. --- test/tests.zig | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/test/tests.zig b/test/tests.zig index 1b3ef6ad74..75ea4abb9e 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -311,7 +311,6 @@ const test_targets = blk: { .abi = .none, }, }, - .{ .target = .{ .cpu_arch = .mips, @@ -320,16 +319,14 @@ const test_targets = blk: { }, .link_libc = true, }, - - // https://github.com/ziglang/zig/issues/4927 - //.{ - // .target = .{ - // .cpu_arch = .mips, - // .os_tag = .linux, - // .abi = .gnueabihf, - // }, - // .link_libc = true, - //}, + .{ + .target = .{ + .cpu_arch = .mips, + .os_tag = .linux, + .abi = .gnueabihf, + }, + .link_libc = true, + }, .{ .target = .{ @@ -338,7 +335,6 @@ const test_targets = blk: { .abi = .none, }, }, - .{ .target = .{ .cpu_arch = .mipsel, @@ -347,16 +343,14 @@ const test_targets = blk: { }, .link_libc = true, }, - - // https://github.com/ziglang/zig/issues/4927 - //.{ - // .target = .{ - // .cpu_arch = .mipsel, - // .os_tag = .linux, - // .abi = .gnueabihf, - // }, - // .link_libc = true, - //}, + .{ + .target = .{ + .cpu_arch = .mipsel, + .os_tag = .linux, + .abi = .gnueabihf, + }, + .link_libc = true, + }, .{ .target = .{ From 4a2b23c2beb043c1e5368d3737893494d61d4060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Tue, 13 Aug 2024 23:38:02 +0200 Subject: [PATCH 08/12] build: Use the new b.addFail() for the update-mingw step. This is precisely the kind of use case it was added for. --- build.zig | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/build.zig b/build.zig index 085201e954..e67ba0a9d1 100644 --- a/build.zig +++ b/build.zig @@ -537,21 +537,20 @@ pub fn build(b: *std.Build) !void { const update_mingw_step = b.step("update-mingw", "Update zig's bundled mingw"); const opt_mingw_src_path = b.option([]const u8, "mingw-src", "path to mingw-w64 source directory"); - const update_mingw_exe = b.addExecutable(.{ - .name = "update_mingw", - .target = b.graph.host, - .root_source_file = b.path("tools/update_mingw.zig"), - }); - const update_mingw_run = b.addRunArtifact(update_mingw_exe); - update_mingw_run.addDirectoryArg(b.path("lib")); if (opt_mingw_src_path) |mingw_src_path| { + const update_mingw_exe = b.addExecutable(.{ + .name = "update_mingw", + .target = b.graph.host, + .root_source_file = b.path("tools/update_mingw.zig"), + }); + const update_mingw_run = b.addRunArtifact(update_mingw_exe); + update_mingw_run.addDirectoryArg(b.path("lib")); update_mingw_run.addDirectoryArg(.{ .cwd_relative = mingw_src_path }); - } else { - // Intentionally cause an error if this build step is requested. - update_mingw_run.addArg("--missing-mingw-source-directory"); - } - update_mingw_step.dependOn(&update_mingw_run.step); + update_mingw_step.dependOn(&update_mingw_run.step); + } else { + update_mingw_step.dependOn(&b.addFail("The -Dmingw-src=... option is required for this step").step); + } } fn addWasiUpdateStep(b: *std.Build, version: [:0]const u8) !void { From 3b51b43dc890dd8df17cb647ff7e1d3a53c438e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Tue, 13 Aug 2024 23:59:50 +0200 Subject: [PATCH 09/12] build/test: Add -Dtest-target-filter for filtering module tests by target triple. This is useful during porting work where you're not interested in running all targets all the time while iterating on changes. --- build.zig | 6 ++++++ test/tests.zig | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/build.zig b/build.zig index e67ba0a9d1..3dd2f1f735 100644 --- a/build.zig +++ b/build.zig @@ -379,6 +379,7 @@ pub fn build(b: *std.Build) !void { } const test_filters = b.option([]const []const u8, "test-filter", "Skip tests that do not match any filter") orelse &[0][]const u8{}; + const test_target_filters = b.option([]const []const u8, "test-target-filter", "Skip tests whose target triple do not match any filter") orelse &[0][]const u8{}; const test_cases_options = b.addOptions(); @@ -457,6 +458,7 @@ pub fn build(b: *std.Build) !void { test_step.dependOn(tests.addModuleTests(b, .{ .test_filters = test_filters, + .test_target_filters = test_target_filters, .root_src = "test/behavior.zig", .name = "behavior", .desc = "Run the behavior tests", @@ -470,6 +472,7 @@ pub fn build(b: *std.Build) !void { test_step.dependOn(tests.addModuleTests(b, .{ .test_filters = test_filters, + .test_target_filters = test_target_filters, .root_src = "test/c_import.zig", .name = "c-import", .desc = "Run the @cImport tests", @@ -482,6 +485,7 @@ pub fn build(b: *std.Build) !void { test_step.dependOn(tests.addModuleTests(b, .{ .test_filters = test_filters, + .test_target_filters = test_target_filters, .root_src = "lib/compiler_rt.zig", .name = "compiler-rt", .desc = "Run the compiler_rt tests", @@ -495,6 +499,7 @@ pub fn build(b: *std.Build) !void { test_step.dependOn(tests.addModuleTests(b, .{ .test_filters = test_filters, + .test_target_filters = test_target_filters, .root_src = "lib/c.zig", .name = "universal-libc", .desc = "Run the universal libc tests", @@ -521,6 +526,7 @@ pub fn build(b: *std.Build) !void { test_step.dependOn(tests.addAssembleAndLinkTests(b, test_filters, optimization_modes)); test_step.dependOn(tests.addModuleTests(b, .{ .test_filters = test_filters, + .test_target_filters = test_target_filters, .root_src = "lib/std/std.zig", .name = "std", .desc = "Run the standard library tests", diff --git a/test/tests.zig b/test/tests.zig index 75ea4abb9e..1bdbc1914b 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -965,6 +965,7 @@ pub fn addRunTranslatedCTests( const ModuleTestOptions = struct { test_filters: []const []const u8, + test_target_filters: []const []const u8, root_src: []const u8, name: []const u8, desc: []const u8, @@ -986,6 +987,13 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step { const resolved_target = b.resolveTargetQuery(test_target.target); const target = resolved_target.result; + const triple_txt = target.zigTriple(b.allocator) catch @panic("OOM"); + + if (options.test_target_filters.len > 0) { + for (options.test_target_filters) |filter| { + if (std.mem.indexOf(u8, triple_txt, filter) != null) break; + } else continue; + } if (options.skip_libc and test_target.link_libc == true) continue; @@ -1034,7 +1042,6 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step { if (!want_this_mode) continue; const libc_suffix = if (test_target.link_libc == true) "-libc" else ""; - const triple_txt = target.zigTriple(b.allocator) catch @panic("OOM"); const model_txt = target.cpu.model.name; // wasm32-wasi builds need more RAM, idk why From b6009a7416c7661e09a23661887698ba520f0db6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Wed, 14 Aug 2024 00:14:02 +0200 Subject: [PATCH 10/12] build/test: Add -Dtest-slow-targets and move mips module tests behind it. The idea is that these tests are just too slow to include by default on a contributor's local machine. If they want to run these, they need to opt in. --- build.zig | 6 ++++++ test/tests.zig | 21 +++++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/build.zig b/build.zig index 3dd2f1f735..704c71926e 100644 --- a/build.zig +++ b/build.zig @@ -380,6 +380,7 @@ pub fn build(b: *std.Build) !void { const test_filters = b.option([]const []const u8, "test-filter", "Skip tests that do not match any filter") orelse &[0][]const u8{}; const test_target_filters = b.option([]const []const u8, "test-target-filter", "Skip tests whose target triple do not match any filter") orelse &[0][]const u8{}; + const test_slow_targets = b.option(bool, "test-slow-targets", "Enable running module tests for targets that have a slow compiler backend") orelse false; const test_cases_options = b.addOptions(); @@ -459,6 +460,7 @@ pub fn build(b: *std.Build) !void { test_step.dependOn(tests.addModuleTests(b, .{ .test_filters = test_filters, .test_target_filters = test_target_filters, + .test_slow_targets = test_slow_targets, .root_src = "test/behavior.zig", .name = "behavior", .desc = "Run the behavior tests", @@ -473,6 +475,7 @@ pub fn build(b: *std.Build) !void { test_step.dependOn(tests.addModuleTests(b, .{ .test_filters = test_filters, .test_target_filters = test_target_filters, + .test_slow_targets = test_slow_targets, .root_src = "test/c_import.zig", .name = "c-import", .desc = "Run the @cImport tests", @@ -486,6 +489,7 @@ pub fn build(b: *std.Build) !void { test_step.dependOn(tests.addModuleTests(b, .{ .test_filters = test_filters, .test_target_filters = test_target_filters, + .test_slow_targets = test_slow_targets, .root_src = "lib/compiler_rt.zig", .name = "compiler-rt", .desc = "Run the compiler_rt tests", @@ -500,6 +504,7 @@ pub fn build(b: *std.Build) !void { test_step.dependOn(tests.addModuleTests(b, .{ .test_filters = test_filters, .test_target_filters = test_target_filters, + .test_slow_targets = test_slow_targets, .root_src = "lib/c.zig", .name = "universal-libc", .desc = "Run the universal libc tests", @@ -527,6 +532,7 @@ pub fn build(b: *std.Build) !void { test_step.dependOn(tests.addModuleTests(b, .{ .test_filters = test_filters, .test_target_filters = test_target_filters, + .test_slow_targets = test_slow_targets, .root_src = "lib/std/std.zig", .name = "std", .desc = "Run the standard library tests", diff --git a/test/tests.zig b/test/tests.zig index 1bdbc1914b..e472fd4524 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -27,6 +27,12 @@ const TestTarget = struct { use_lld: ?bool = null, pic: ?bool = null, strip: ?bool = null, + + // This is intended for targets that are known to be slow to compile. These are acceptable to + // run in CI, but should not be run on developer machines by default. As an example, at the time + // of writing, this includes LLVM's MIPS backend which takes upwards of 20 minutes longer to + // compile tests than other backends. + slow_backend: bool = false, }; const test_targets = blk: { @@ -310,6 +316,7 @@ const test_targets = blk: { .os_tag = .linux, .abi = .none, }, + .slow_backend = true, }, .{ .target = .{ @@ -318,6 +325,7 @@ const test_targets = blk: { .abi = .musl, }, .link_libc = true, + .slow_backend = true, }, .{ .target = .{ @@ -326,6 +334,7 @@ const test_targets = blk: { .abi = .gnueabihf, }, .link_libc = true, + .slow_backend = true, }, .{ @@ -334,6 +343,7 @@ const test_targets = blk: { .os_tag = .linux, .abi = .none, }, + .slow_backend = true, }, .{ .target = .{ @@ -342,6 +352,7 @@ const test_targets = blk: { .abi = .musl, }, .link_libc = true, + .slow_backend = true, }, .{ .target = .{ @@ -350,6 +361,7 @@ const test_targets = blk: { .abi = .gnueabihf, }, .link_libc = true, + .slow_backend = true, }, .{ @@ -401,7 +413,8 @@ const test_targets = blk: { .link_libc = true, }, - // Disabled until LLVM fixes their O(N^2) codegen. + // Disabled until LLVM fixes their O(N^2) codegen. Note that this is so bad that we don't + // even want to include this in CI with `slow_backend`. // https://github.com/ziglang/zig/issues/18872 //.{ // .target = .{ @@ -412,7 +425,8 @@ const test_targets = blk: { // .use_llvm = true, //}, - // Disabled until LLVM fixes their O(N^2) codegen. + // Disabled until LLVM fixes their O(N^2) codegen. Note that this is so bad that we don't + // even want to include this in CI with `slow_backend`. // https://github.com/ziglang/zig/issues/18872 //.{ // .target = .{ @@ -966,6 +980,7 @@ pub fn addRunTranslatedCTests( const ModuleTestOptions = struct { test_filters: []const []const u8, test_target_filters: []const []const u8, + test_slow_targets: bool, root_src: []const u8, name: []const u8, desc: []const u8, @@ -982,6 +997,8 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step { const step = b.step(b.fmt("test-{s}", .{options.name}), options.desc); for (test_targets) |test_target| { + if (!options.test_slow_targets and test_target.slow_backend) continue; + if (options.skip_non_native and !test_target.target.isNative()) continue; From 927bc5562988e7467bcf6e94cf1e2db9c46aa128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Wed, 14 Aug 2024 00:22:58 +0200 Subject: [PATCH 11/12] build/test: Add a test-modules step for running all the per-target tests. This is useful during porting work where you're mainly concerned with tests that e.g. run under QEMU. Combine with the new -Dtest-target-filter for an even more streamlined workflow. --- build.zig | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/build.zig b/build.zig index 704c71926e..5cce32b0b5 100644 --- a/build.zig +++ b/build.zig @@ -457,7 +457,9 @@ pub fn build(b: *std.Build) !void { }); test_step.dependOn(test_cases_step); - test_step.dependOn(tests.addModuleTests(b, .{ + const test_modules_step = b.step("test-modules", "Run the per-target module tests"); + + test_modules_step.dependOn(tests.addModuleTests(b, .{ .test_filters = test_filters, .test_target_filters = test_target_filters, .test_slow_targets = test_slow_targets, @@ -472,7 +474,7 @@ pub fn build(b: *std.Build) !void { .max_rss = 1 * 1024 * 1024 * 1024, })); - test_step.dependOn(tests.addModuleTests(b, .{ + test_modules_step.dependOn(tests.addModuleTests(b, .{ .test_filters = test_filters, .test_target_filters = test_target_filters, .test_slow_targets = test_slow_targets, @@ -486,7 +488,7 @@ pub fn build(b: *std.Build) !void { .skip_libc = skip_libc, })); - test_step.dependOn(tests.addModuleTests(b, .{ + test_modules_step.dependOn(tests.addModuleTests(b, .{ .test_filters = test_filters, .test_target_filters = test_target_filters, .test_slow_targets = test_slow_targets, @@ -501,7 +503,7 @@ pub fn build(b: *std.Build) !void { .no_builtin = true, })); - test_step.dependOn(tests.addModuleTests(b, .{ + test_modules_step.dependOn(tests.addModuleTests(b, .{ .test_filters = test_filters, .test_target_filters = test_target_filters, .test_slow_targets = test_slow_targets, @@ -516,20 +518,7 @@ pub fn build(b: *std.Build) !void { .no_builtin = true, })); - test_step.dependOn(tests.addCompareOutputTests(b, test_filters, optimization_modes)); - test_step.dependOn(tests.addStandaloneTests( - b, - optimization_modes, - enable_macos_sdk, - enable_ios_sdk, - enable_symlinks_windows, - )); - test_step.dependOn(tests.addCAbiTests(b, skip_non_native, skip_release)); - test_step.dependOn(tests.addLinkTests(b, enable_macos_sdk, enable_ios_sdk, enable_symlinks_windows)); - test_step.dependOn(tests.addStackTraceTests(b, test_filters, optimization_modes)); - test_step.dependOn(tests.addCliTests(b)); - test_step.dependOn(tests.addAssembleAndLinkTests(b, test_filters, optimization_modes)); - test_step.dependOn(tests.addModuleTests(b, .{ + test_modules_step.dependOn(tests.addModuleTests(b, .{ .test_filters = test_filters, .test_target_filters = test_target_filters, .test_slow_targets = test_slow_targets, @@ -545,6 +534,22 @@ pub fn build(b: *std.Build) !void { .max_rss = 5029889638, })); + test_step.dependOn(test_modules_step); + + test_step.dependOn(tests.addCompareOutputTests(b, test_filters, optimization_modes)); + test_step.dependOn(tests.addStandaloneTests( + b, + optimization_modes, + enable_macos_sdk, + enable_ios_sdk, + enable_symlinks_windows, + )); + test_step.dependOn(tests.addCAbiTests(b, skip_non_native, skip_release)); + test_step.dependOn(tests.addLinkTests(b, enable_macos_sdk, enable_ios_sdk, enable_symlinks_windows)); + test_step.dependOn(tests.addStackTraceTests(b, test_filters, optimization_modes)); + test_step.dependOn(tests.addCliTests(b)); + test_step.dependOn(tests.addAssembleAndLinkTests(b, test_filters, optimization_modes)); + try addWasiUpdateStep(b, version); const update_mingw_step = b.step("update-mingw", "Update zig's bundled mingw"); From 55cc9dda66a24ed2a86a358533ecf5840d47b3d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Wed, 14 Aug 2024 00:17:25 +0200 Subject: [PATCH 12/12] ci: Enable -Dtest-slow-targets. --- ci/aarch64-linux-debug.sh | 3 ++- ci/aarch64-linux-release.sh | 3 ++- ci/aarch64-macos-debug.sh | 3 ++- ci/aarch64-macos-release.sh | 3 ++- ci/aarch64-windows.ps1 | 3 ++- ci/x86_64-linux-debug.sh | 3 ++- ci/x86_64-linux-release.sh | 3 ++- ci/x86_64-macos-release.sh | 3 ++- ci/x86_64-windows-debug.ps1 | 3 ++- ci/x86_64-windows-release.ps1 | 3 ++- 10 files changed, 20 insertions(+), 10 deletions(-) diff --git a/ci/aarch64-linux-debug.sh b/ci/aarch64-linux-debug.sh index 27effea36a..5fc0a1b6a1 100644 --- a/ci/aarch64-linux-debug.sh +++ b/ci/aarch64-linux-debug.sh @@ -62,7 +62,8 @@ stage3-debug/bin/zig build test docs \ -Dtarget=native-native-musl \ --search-prefix "$PREFIX" \ --zig-lib-dir "$PWD/../lib" \ - -Denable-tidy + -Denable-tidy \ + -Dtest-slow-targets # Ensure that updating the wasm binary from this commit will result in a viable build. stage3-debug/bin/zig build update-zig1 diff --git a/ci/aarch64-linux-release.sh b/ci/aarch64-linux-release.sh index 947694ce39..3c307a11c7 100644 --- a/ci/aarch64-linux-release.sh +++ b/ci/aarch64-linux-release.sh @@ -62,7 +62,8 @@ stage3-release/bin/zig build test docs \ -Dtarget=native-native-musl \ --search-prefix "$PREFIX" \ --zig-lib-dir "$PWD/../lib" \ - -Denable-tidy + -Denable-tidy \ + -Dtest-slow-targets # Ensure that stage3 and stage4 are byte-for-byte identical. stage3-release/bin/zig build \ diff --git a/ci/aarch64-macos-debug.sh b/ci/aarch64-macos-debug.sh index 9283321c1f..e233b00d6d 100755 --- a/ci/aarch64-macos-debug.sh +++ b/ci/aarch64-macos-debug.sh @@ -55,4 +55,5 @@ stage3-debug/bin/zig build test docs \ -Denable-macos-sdk \ -Dstatic-llvm \ -Dskip-non-native \ - --search-prefix "$PREFIX" + --search-prefix "$PREFIX" \ + -Dtest-slow-targets diff --git a/ci/aarch64-macos-release.sh b/ci/aarch64-macos-release.sh index 396aa1d464..ec3a23db18 100755 --- a/ci/aarch64-macos-release.sh +++ b/ci/aarch64-macos-release.sh @@ -55,7 +55,8 @@ stage3-release/bin/zig build test docs \ -Denable-macos-sdk \ -Dstatic-llvm \ -Dskip-non-native \ - --search-prefix "$PREFIX" + --search-prefix "$PREFIX" \ + -Dtest-slow-targets # Ensure that stage3 and stage4 are byte-for-byte identical. stage3-release/bin/zig build \ diff --git a/ci/aarch64-windows.ps1 b/ci/aarch64-windows.ps1 index bf68a6443c..a761b33604 100644 --- a/ci/aarch64-windows.ps1 +++ b/ci/aarch64-windows.ps1 @@ -67,7 +67,8 @@ Write-Output "Main test suite..." --search-prefix "$PREFIX_PATH" ` -Dstatic-llvm ` -Dskip-non-native ` - -Denable-symlinks-windows + -Denable-symlinks-windows ` + -Dtest-slow-targets CheckLastExitCode # Ensure that stage3 and stage4 are byte-for-byte identical. diff --git a/ci/x86_64-linux-debug.sh b/ci/x86_64-linux-debug.sh index 7d4a0119af..7bff35782f 100755 --- a/ci/x86_64-linux-debug.sh +++ b/ci/x86_64-linux-debug.sh @@ -70,7 +70,8 @@ stage3-debug/bin/zig build test docs \ -Dtarget=native-native-musl \ --search-prefix "$PREFIX" \ --zig-lib-dir "$PWD/../lib" \ - -Denable-tidy + -Denable-tidy \ + -Dtest-slow-targets # Ensure that updating the wasm binary from this commit will result in a viable build. stage3-debug/bin/zig build update-zig1 diff --git a/ci/x86_64-linux-release.sh b/ci/x86_64-linux-release.sh index 1ed5bca99c..85697422e5 100755 --- a/ci/x86_64-linux-release.sh +++ b/ci/x86_64-linux-release.sh @@ -70,7 +70,8 @@ stage3-release/bin/zig build test docs \ -Dtarget=native-native-musl \ --search-prefix "$PREFIX" \ --zig-lib-dir "$PWD/../lib" \ - -Denable-tidy + -Denable-tidy \ + -Dtest-slow-targets # Ensure that stage3 and stage4 are byte-for-byte identical. stage3-release/bin/zig build \ diff --git a/ci/x86_64-macos-release.sh b/ci/x86_64-macos-release.sh index acf2b91d9a..b6a0c00b22 100755 --- a/ci/x86_64-macos-release.sh +++ b/ci/x86_64-macos-release.sh @@ -59,7 +59,8 @@ stage3/bin/zig build test docs \ -Denable-macos-sdk \ -Dstatic-llvm \ -Dskip-non-native \ - --search-prefix "$PREFIX" + --search-prefix "$PREFIX" \ + -Dtest-slow-targets # Ensure that stage3 and stage4 are byte-for-byte identical. stage3/bin/zig build \ diff --git a/ci/x86_64-windows-debug.ps1 b/ci/x86_64-windows-debug.ps1 index db8be82d89..1d9c5b709b 100644 --- a/ci/x86_64-windows-debug.ps1 +++ b/ci/x86_64-windows-debug.ps1 @@ -68,7 +68,8 @@ Write-Output "Main test suite..." -Dstatic-llvm ` -Dskip-non-native ` -Dskip-release ` - -Denable-symlinks-windows + -Denable-symlinks-windows ` + -Dtest-slow-targets CheckLastExitCode Write-Output "Build x86_64-windows-msvc behavior tests using the C backend..." diff --git a/ci/x86_64-windows-release.ps1 b/ci/x86_64-windows-release.ps1 index 3d8938ce19..a2dcd06d73 100644 --- a/ci/x86_64-windows-release.ps1 +++ b/ci/x86_64-windows-release.ps1 @@ -67,7 +67,8 @@ Write-Output "Main test suite..." --search-prefix "$PREFIX_PATH" ` -Dstatic-llvm ` -Dskip-non-native ` - -Denable-symlinks-windows + -Denable-symlinks-windows ` + -Dtest-slow-targets CheckLastExitCode # Ensure that stage3 and stage4 are byte-for-byte identical.