authorgravatar for 124872+jedisct1@users.noreply.github.comFrank Denis <124872+jedisct1@users.noreply.github.com> 2021-04-30 23:41:28+02:00
committergravatar for 124872+jedisct1@users.noreply.github.comFrank Denis <124872+jedisct1@users.noreply.github.com> 2021-04-30 23:41:28+02:00
logb49d99b246bc18d94b6eed0c225464078b05f12a
treebe0f1e562889b21c49d7a1aed2229a90843bdffb
parentd3f55782b0a48a4472d7d535ac1215c8f5d43e31

Azure CI: Test std.* and the rest separately

On CI, we have been running into OOM issues when running the test suite on Windows for quite some time. Unfortunately, we are very close to having the same issues on Linux as well. Some additional comptime work immediately makes these builds fail as well. Add a new `test-toolchain` step, that tests everything except `std.*` and documentation. On CI, call `test-toolchain`, `test-std` and `docs` separately instead of the `test` big hammer that emcompasses all of them. Change the special case we made for Windows to the same code as other platforms. This is a stopgap measure that stage2 will eventually make useless. Until then, it gives us some headroom. Change `linux_script` by the way to only output the log of failing steps. This shrinks the Linux CI log from a bazilion lines down to something more humanely manageable.

4 files changed, 49 insertions(+), 37 deletions(-)

build.zig+25-21
......@@ -36,7 +36,7 @@ pub fn build(b: *Builder) !void {
3636 const docs_step = b.step("docs", "Build documentation");
3737 docs_step.dependOn(&docgen_cmd.step);
3838
39 const test_step = b.step("test", "Run all the tests");
39 const toolchain_step = b.step("test-toolchain", "Run the tests for the toolchain");
4040
4141 var test_stage2 = b.addTest("src/test.zig");
4242 test_stage2.setBuildMode(mode);
......@@ -90,7 +90,7 @@ pub fn build(b: *Builder) !void {
9090 exe.install();
9191 exe.setBuildMode(mode);
9292 exe.setTarget(target);
93 test_step.dependOn(&exe.step);
93 toolchain_step.dependOn(&exe.step);
9494 b.default_step.dependOn(&exe.step);
9595
9696 exe.addBuildOption(bool, "skip_non_native", skip_non_native);
......@@ -233,7 +233,7 @@ pub fn build(b: *Builder) !void {
233233 const test_stage2_step = b.step("test-stage2", "Run the stage2 compiler tests");
234234 test_stage2_step.dependOn(&test_stage2.step);
235235 if (!skip_stage2_tests) {
236 test_step.dependOn(test_stage2_step);
236 toolchain_step.dependOn(test_stage2_step);
237237 }
238238
239239 var chosen_modes: [4]builtin.Mode = undefined;
......@@ -257,33 +257,37 @@ pub fn build(b: *Builder) !void {
257257 const modes = chosen_modes[0..chosen_mode_index];
258258
259259 // run stage1 `zig fmt` on this build.zig file just to make sure it works
260 test_step.dependOn(&fmt_build_zig.step);
260 toolchain_step.dependOn(&fmt_build_zig.step);
261261 const fmt_step = b.step("test-fmt", "Run zig fmt against build.zig to make sure it works");
262262 fmt_step.dependOn(&fmt_build_zig.step);
263263
264264 // TODO for the moment, skip wasm32-wasi until bugs are sorted out.
265 test_step.dependOn(tests.addPkgTests(b, test_filter, "test/stage1/behavior.zig", "behavior", "Run the behavior tests", modes, false, skip_non_native, skip_libc, is_wine_enabled, is_qemu_enabled, is_wasmtime_enabled, glibc_multi_dir));
266
267 test_step.dependOn(tests.addPkgTests(b, test_filter, "lib/std/std.zig", "std", "Run the standard library tests", modes, false, skip_non_native, skip_libc, is_wine_enabled, is_qemu_enabled, is_wasmtime_enabled, glibc_multi_dir));
268
269 test_step.dependOn(tests.addPkgTests(b, test_filter, "lib/std/special/compiler_rt.zig", "compiler-rt", "Run the compiler_rt tests", modes, true, skip_non_native, true, is_wine_enabled, is_qemu_enabled, is_wasmtime_enabled, glibc_multi_dir));
270 test_step.dependOn(tests.addPkgTests(b, test_filter, "lib/std/special/c.zig", "minilibc", "Run the mini libc tests", modes, true, skip_non_native, true, is_wine_enabled, is_qemu_enabled, is_wasmtime_enabled, glibc_multi_dir));
271
272 test_step.dependOn(tests.addCompareOutputTests(b, test_filter, modes));
273 test_step.dependOn(tests.addStandaloneTests(b, test_filter, modes));
274 test_step.dependOn(tests.addStackTraceTests(b, test_filter, modes));
275 test_step.dependOn(tests.addCliTests(b, test_filter, modes));
276 test_step.dependOn(tests.addAssembleAndLinkTests(b, test_filter, modes));
277 test_step.dependOn(tests.addRuntimeSafetyTests(b, test_filter, modes));
278 test_step.dependOn(tests.addTranslateCTests(b, test_filter));
265 toolchain_step.dependOn(tests.addPkgTests(b, test_filter, "test/stage1/behavior.zig", "behavior", "Run the behavior tests", modes, false, skip_non_native, skip_libc, is_wine_enabled, is_qemu_enabled, is_wasmtime_enabled, glibc_multi_dir));
266
267 toolchain_step.dependOn(tests.addPkgTests(b, test_filter, "lib/std/special/compiler_rt.zig", "compiler-rt", "Run the compiler_rt tests", modes, true, skip_non_native, true, is_wine_enabled, is_qemu_enabled, is_wasmtime_enabled, glibc_multi_dir));
268 toolchain_step.dependOn(tests.addPkgTests(b, test_filter, "lib/std/special/c.zig", "minilibc", "Run the mini libc tests", modes, true, skip_non_native, true, is_wine_enabled, is_qemu_enabled, is_wasmtime_enabled, glibc_multi_dir));
269
270 toolchain_step.dependOn(tests.addCompareOutputTests(b, test_filter, modes));
271 toolchain_step.dependOn(tests.addStandaloneTests(b, test_filter, modes));
272 toolchain_step.dependOn(tests.addStackTraceTests(b, test_filter, modes));
273 toolchain_step.dependOn(tests.addCliTests(b, test_filter, modes));
274 toolchain_step.dependOn(tests.addAssembleAndLinkTests(b, test_filter, modes));
275 toolchain_step.dependOn(tests.addRuntimeSafetyTests(b, test_filter, modes));
276 toolchain_step.dependOn(tests.addTranslateCTests(b, test_filter));
279277 if (!skip_run_translated_c) {
280 test_step.dependOn(tests.addRunTranslatedCTests(b, test_filter, target));
278 toolchain_step.dependOn(tests.addRunTranslatedCTests(b, test_filter, target));
281279 }
282280 // tests for this feature are disabled until we have the self-hosted compiler available
283 // test_step.dependOn(tests.addGenHTests(b, test_filter));
281 // toolchain_step.dependOn(tests.addGenHTests(b, test_filter));
284282 if (!skip_compile_errors) {
285 test_step.dependOn(tests.addCompileErrorTests(b, test_filter, modes));
283 toolchain_step.dependOn(tests.addCompileErrorTests(b, test_filter, modes));
286284 }
285
286 const std_step = tests.addPkgTests(b, test_filter, "lib/std/std.zig", "std", "Run the standard library tests", modes, false, skip_non_native, skip_libc, is_wine_enabled, is_qemu_enabled, is_wasmtime_enabled, glibc_multi_dir);
287
288 const test_step = b.step("test", "Run all the tests");
289 test_step.dependOn(toolchain_step);
290 test_step.dependOn(std_step);
287291 test_step.dependOn(docs_step);
288292}
289293
ci/azure/linux_script+11-1
......@@ -65,7 +65,17 @@ make $JOBS install
6565cmake .. -DZIG_EXECUTABLE="$(pwd)/release/bin/zig"
6666make $JOBS install
6767
68release/bin/zig build test -Denable-qemu -Denable-wasmtime
68set +x
69LOG=$(mktemp)
70for step in test-toolchain test-std docs; do
71 echo "* Running step: [$step]"
72 if ! release/bin/zig build $step -Denable-qemu -Denable-wasmtime 2>"$LOG" >&2; then
73 cat "$LOG" >&2
74 exit 1
75 fi
76 echo " Done."
77done
78set -x
6979
7080# Look for HTML errors.
7181tidy -qe ../zig-cache/langref.html
ci/azure/macos_script+12-2
......@@ -18,7 +18,7 @@ tar xf "$CACHE_BASENAME.tar.xz"
1818
1919ZIG="$PREFIX/bin/zig"
2020NATIVE_LIBC_TXT="$HOME/native_libc.txt"
21$ZIG libc > "$NATIVE_LIBC_TXT"
21$ZIG libc >"$NATIVE_LIBC_TXT"
2222export ZIG_LIBC="$NATIVE_LIBC_TXT"
2323export CC="$ZIG cc"
2424export CXX="$ZIG c++"
......@@ -55,7 +55,17 @@ make $JOBS install
5555cmake .. -DZIG_EXECUTABLE="$(pwd)/release/bin/zig" -DZIG_TARGET_MCPU="x86_64_v2"
5656make $JOBS install
5757
58release/bin/zig build test
58set +x
59LOG=$(mktemp)
60for step in test-toolchain test-std docs; do
61 echo "* Running step: [$step]"
62 if ! release/bin/zig build $step -Denable-qemu -Denable-wasmtime 2>"$LOG" >&2; then
63 cat "$LOG" >&2
64 exit 1
65 fi
66 echo " Done."
67done
68set -x
5969
6070if [ "${BUILD_REASON}" != "PullRequest" ]; then
6171 mv ../LICENSE release/
ci/azure/windows_msvc_script.bat+1-13
......@@ -26,20 +26,8 @@ cd %ZIGBUILDDIR%
2626cmake.exe .. -Thost=x64 -G"Visual Studio 16 2019" -A x64 "-DCMAKE_INSTALL_PREFIX=%ZIGINSTALLDIR%" "-DCMAKE_PREFIX_PATH=%ZIGPREFIXPATH%" -DCMAKE_BUILD_TYPE=Release -DZIG_OMIT_STAGE2=ON || exit /b
2727msbuild /maxcpucount /p:Configuration=Release INSTALL.vcxproj || exit /b
2828
29"%ZIGINSTALLDIR%\bin\zig.exe" build test-behavior -Dskip-non-native || exit /b
30REM Disabled to prevent OOM
31REM "%ZIGINSTALLDIR%\bin\zig.exe" build test-stage2 -Dskip-non-native || exit /b
32"%ZIGINSTALLDIR%\bin\zig.exe" build test-fmt -Dskip-non-native || exit /b
29"%ZIGINSTALLDIR%\bin\zig.exe" build test-toolchain -Dskip-non-native -Dskip-stage2-tests || exit /b
3330"%ZIGINSTALLDIR%\bin\zig.exe" build test-std -Dskip-non-native || exit /b
34"%ZIGINSTALLDIR%\bin\zig.exe" build test-compiler-rt -Dskip-non-native || exit /b
35"%ZIGINSTALLDIR%\bin\zig.exe" build test-compare-output -Dskip-non-native || exit /b
36"%ZIGINSTALLDIR%\bin\zig.exe" build test-standalone -Dskip-non-native || exit /b
37"%ZIGINSTALLDIR%\bin\zig.exe" build test-stack-traces -Dskip-non-native || exit /b
38"%ZIGINSTALLDIR%\bin\zig.exe" build test-cli -Dskip-non-native || exit /b
39"%ZIGINSTALLDIR%\bin\zig.exe" build test-asm-link -Dskip-non-native || exit /b
40"%ZIGINSTALLDIR%\bin\zig.exe" build test-runtime-safety -Dskip-non-native || exit /b
41"%ZIGINSTALLDIR%\bin\zig.exe" build test-translate-c -Dskip-non-native || exit /b
42"%ZIGINSTALLDIR%\bin\zig.exe" build test-run-translated-c -Dskip-non-native || exit /b
4331"%ZIGINSTALLDIR%\bin\zig.exe" build docs || exit /b
4432
4533set "PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem"