From c641af3cba8f0e8e6bba0ba26dce18bd225a832e Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 19 Feb 2023 16:23:59 -0700 Subject: [PATCH] CI: use -j1 like a coward Zig's build script has several race conditions preventing proper concurrent builds from working. By using -j1 for now, finishing this branch (concurrent zig builds) is untangled from the separate problem of correcting concurrency issues with zig's own build script. In other words, let's solve one problem at a time. --- ci/aarch64-linux-debug.sh | 1 + ci/aarch64-linux-release.sh | 1 + ci/aarch64-macos.sh | 1 + ci/x86_64-linux-debug.sh | 1 + ci/x86_64-linux-release.sh | 1 + ci/x86_64-macos-debug.sh | 1 + ci/x86_64-macos-release.sh | 1 + test/tests.zig | 4 ++++ 8 files changed, 11 insertions(+) diff --git a/ci/aarch64-linux-debug.sh b/ci/aarch64-linux-debug.sh index 94f40c557b..90ed8bbc35 100644 --- a/ci/aarch64-linux-debug.sh +++ b/ci/aarch64-linux-debug.sh @@ -60,6 +60,7 @@ stage3-debug/bin/zig build -Dtarget=arm-linux-musleabihf # TODO: add -fqemu back to this line stage3-debug/bin/zig build test docs \ + -j1 \ -fwasmtime \ -Dstatic-llvm \ -Dtarget=native-native-musl \ diff --git a/ci/aarch64-linux-release.sh b/ci/aarch64-linux-release.sh index 65d6063f25..e99e3e1c08 100644 --- a/ci/aarch64-linux-release.sh +++ b/ci/aarch64-linux-release.sh @@ -60,6 +60,7 @@ stage3-release/bin/zig build -Dtarget=arm-linux-musleabihf # TODO: add -fqemu back to this line stage3-release/bin/zig build test docs \ + -j1 \ -fwasmtime \ -Dstatic-llvm \ -Dtarget=native-native-musl \ diff --git a/ci/aarch64-macos.sh b/ci/aarch64-macos.sh index b4533e149f..634a60b600 100755 --- a/ci/aarch64-macos.sh +++ b/ci/aarch64-macos.sh @@ -44,6 +44,7 @@ PATH="$HOME/local/bin:$PATH" cmake .. \ $HOME/local/bin/ninja install stage3-release/bin/zig build test docs \ + -j1 \ --zig-lib-dir "$(pwd)/../lib" \ -Denable-macos-sdk \ -Dstatic-llvm \ diff --git a/ci/x86_64-linux-debug.sh b/ci/x86_64-linux-debug.sh index 7f2382f04a..1267a2d753 100755 --- a/ci/x86_64-linux-debug.sh +++ b/ci/x86_64-linux-debug.sh @@ -58,6 +58,7 @@ stage3-debug/bin/zig fmt --check .. \ stage3-debug/bin/zig build -Dtarget=arm-linux-musleabihf stage3-debug/bin/zig build test docs \ + -j1 \ -fqemu \ -fwasmtime \ -Dstatic-llvm \ diff --git a/ci/x86_64-linux-release.sh b/ci/x86_64-linux-release.sh index cdb24e4a6f..3305f5e951 100755 --- a/ci/x86_64-linux-release.sh +++ b/ci/x86_64-linux-release.sh @@ -59,6 +59,7 @@ stage3-release/bin/zig fmt --check .. \ stage3-release/bin/zig build -Dtarget=arm-linux-musleabihf stage3-release/bin/zig build test docs \ + -j1 \ -fqemu \ -fwasmtime \ -Dstatic-llvm \ diff --git a/ci/x86_64-macos-debug.sh b/ci/x86_64-macos-debug.sh index c24ff5d295..edd35970b8 100755 --- a/ci/x86_64-macos-debug.sh +++ b/ci/x86_64-macos-debug.sh @@ -48,6 +48,7 @@ cmake .. \ make $JOBS install stage3/bin/zig build test docs \ + -j1 \ --zig-lib-dir "$(pwd)/../lib" \ -Denable-macos-sdk \ -Dstatic-llvm \ diff --git a/ci/x86_64-macos-release.sh b/ci/x86_64-macos-release.sh index a4dedb4446..65dea3afcb 100755 --- a/ci/x86_64-macos-release.sh +++ b/ci/x86_64-macos-release.sh @@ -48,6 +48,7 @@ cmake .. \ make $JOBS install stage3/bin/zig build test docs \ + -j1 \ --zig-lib-dir "$(pwd)/../lib" \ -Denable-macos-sdk \ -Dstatic-llvm \ diff --git a/test/tests.zig b/test/tests.zig index e470a4f251..fe2efbc06e 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -1067,6 +1067,10 @@ pub const StandaloneContext = struct { zig_args.append(rel_zig_exe) catch unreachable; zig_args.append("build") catch unreachable; + // TODO: fix the various non-concurrency-safe issues in zig's standalone tests, + // and then remove this! + zig_args.append("-j1") catch @panic("OOM"); + zig_args.append("--build-file") catch unreachable; zig_args.append(b.pathFromRoot(build_file)) catch unreachable;