authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-06-20 13:02:37-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-06-21 00:37:58-07:00
log128fd7dd02ae112cba68d0ad6cc40dc1ce8c34b1
treeb75a489d5a7ff64062a5a7a9671a8099994bdced
parent12813d5912c55d6b290690d821a782d6c756f11c

CI: -x86_64-macos-debug, +aarch64-macos-debug

It's easier to get M1 hardware for testing than x86_64-macos. This addresses the current bottleneck in our CI pipeline.

5 files changed, 132 insertions(+), 136 deletions(-)

.github/workflows/ci.yaml+8-8
......@@ -41,7 +41,7 @@ jobs:
4141 uses: actions/checkout@v3
4242 - name: Build and Test
4343 run: sh ci/aarch64-linux-release.sh
44 x86_64-macos-debug:
44 x86_64-macos-release:
4545 runs-on: "macos-11"
4646 env:
4747 ARCH: "x86_64"
......@@ -49,17 +49,17 @@ jobs:
4949 - name: Checkout
5050 uses: actions/checkout@v3
5151 - name: Build and Test
52 run: ci/x86_64-macos-debug.sh
53 x86_64-macos-release:
54 runs-on: "macos-11"
52 run: ci/x86_64-macos-release.sh
53 aarch64-macos-debug:
54 runs-on: [self-hosted, macOS, aarch64]
5555 env:
56 ARCH: "x86_64"
56 ARCH: "aarch64"
5757 steps:
5858 - name: Checkout
5959 uses: actions/checkout@v3
6060 - name: Build and Test
61 run: ci/x86_64-macos-release.sh
62 aarch64-macos:
61 run: ci/aarch64-macos-debug.sh
62 aarch64-macos-release:
6363 runs-on: [self-hosted, macOS, aarch64]
6464 env:
6565 ARCH: "aarch64"
......@@ -67,7 +67,7 @@ jobs:
6767 - name: Checkout
6868 uses: actions/checkout@v3
6969 - name: Build and Test
70 run: ci/aarch64-macos.sh
70 run: ci/aarch64-macos-release.sh
7171 x86_64-windows-debug:
7272 runs-on: windows-latest
7373 env:
ci/aarch64-macos-debug.sh created+54
......@@ -0,0 +1,54 @@
1#!/bin/sh
2
3set -x
4set -e
5
6# Script assumes the presence of the following:
7# s3cmd
8
9ZIGDIR="$(pwd)"
10TARGET="$ARCH-macos-none"
11MCPU="baseline"
12CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.2441+eb19f73af"
13PREFIX="$HOME/$CACHE_BASENAME"
14ZIG="$PREFIX/bin/zig"
15
16cd $ZIGDIR
17
18# Make the `zig version` number consistent.
19# This will affect the cmake command below.
20git config core.abbrev 9
21git fetch --unshallow || true
22git fetch --tags
23
24mkdir build
25cd build
26
27# Override the cache directories because they won't actually help other CI runs
28# which will be testing alternate versions of zig, and ultimately would just
29# fill up space on the hard drive for no reason.
30export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache"
31export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache"
32
33PATH="$HOME/local/bin:$PATH" cmake .. \
34 -DCMAKE_INSTALL_PREFIX="stage3-debug" \
35 -DCMAKE_PREFIX_PATH="$PREFIX" \
36 -DCMAKE_BUILD_TYPE=Debug \
37 -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \
38 -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \
39 -DZIG_TARGET_TRIPLE="$TARGET" \
40 -DZIG_TARGET_MCPU="$MCPU" \
41 -DZIG_STATIC=ON \
42 -GNinja
43
44$HOME/local/bin/ninja install
45
46stage3-debug/bin/zig build test docs \
47 --zig-lib-dir "$(pwd)/../lib" \
48 -Denable-macos-sdk \
49 -Dstatic-llvm \
50 -Dskip-non-native \
51 --search-prefix "$PREFIX"
52
53# Produce the experimental std lib documentation.
54stage3-debug/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib
ci/aarch64-macos-release.sh created+70
......@@ -0,0 +1,70 @@
1#!/bin/sh
2
3set -x
4set -e
5
6# Script assumes the presence of the following:
7# s3cmd
8
9ZIGDIR="$(pwd)"
10TARGET="$ARCH-macos-none"
11MCPU="baseline"
12CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.2441+eb19f73af"
13PREFIX="$HOME/$CACHE_BASENAME"
14ZIG="$PREFIX/bin/zig"
15
16cd $ZIGDIR
17
18# Make the `zig version` number consistent.
19# This will affect the cmake command below.
20git config core.abbrev 9
21git fetch --unshallow || true
22git fetch --tags
23
24mkdir build
25cd build
26
27# Override the cache directories because they won't actually help other CI runs
28# which will be testing alternate versions of zig, and ultimately would just
29# fill up space on the hard drive for no reason.
30export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache"
31export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache"
32
33PATH="$HOME/local/bin:$PATH" cmake .. \
34 -DCMAKE_INSTALL_PREFIX="stage3-release" \
35 -DCMAKE_PREFIX_PATH="$PREFIX" \
36 -DCMAKE_BUILD_TYPE=Release \
37 -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \
38 -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \
39 -DZIG_TARGET_TRIPLE="$TARGET" \
40 -DZIG_TARGET_MCPU="$MCPU" \
41 -DZIG_STATIC=ON \
42 -GNinja
43
44$HOME/local/bin/ninja install
45
46stage3-release/bin/zig build test docs \
47 --zig-lib-dir "$(pwd)/../lib" \
48 -Denable-macos-sdk \
49 -Dstatic-llvm \
50 -Dskip-non-native \
51 --search-prefix "$PREFIX"
52
53# Produce the experimental std lib documentation.
54stage3-release/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib
55
56# Ensure that stage3 and stage4 are byte-for-byte identical.
57stage3-release/bin/zig build \
58 --prefix stage4-release \
59 -Denable-llvm \
60 -Dno-lib \
61 -Doptimize=ReleaseFast \
62 -Dstrip \
63 -Dtarget=$TARGET \
64 -Duse-zig-libcxx \
65 -Dversion-string="$(stage3-release/bin/zig version)"
66
67# diff returns an error code if the files differ.
68echo "If the following command fails, it means nondeterminism has been"
69echo "introduced, making stage3 and stage4 no longer byte-for-byte identical."
70diff stage3-release/bin/zig stage4-release/bin/zig
ci/aarch64-macos.sh deleted-70
......@@ -1,70 +0,0 @@
1#!/bin/sh
2
3set -x
4set -e
5
6# Script assumes the presence of the following:
7# s3cmd
8
9ZIGDIR="$(pwd)"
10TARGET="$ARCH-macos-none"
11MCPU="baseline"
12CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.2441+eb19f73af"
13PREFIX="$HOME/$CACHE_BASENAME"
14ZIG="$PREFIX/bin/zig"
15
16cd $ZIGDIR
17
18# Make the `zig version` number consistent.
19# This will affect the cmake command below.
20git config core.abbrev 9
21git fetch --unshallow || true
22git fetch --tags
23
24mkdir build
25cd build
26
27# Override the cache directories because they won't actually help other CI runs
28# which will be testing alternate versions of zig, and ultimately would just
29# fill up space on the hard drive for no reason.
30export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache"
31export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache"
32
33PATH="$HOME/local/bin:$PATH" cmake .. \
34 -DCMAKE_INSTALL_PREFIX="stage3-release" \
35 -DCMAKE_PREFIX_PATH="$PREFIX" \
36 -DCMAKE_BUILD_TYPE=Release \
37 -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \
38 -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \
39 -DZIG_TARGET_TRIPLE="$TARGET" \
40 -DZIG_TARGET_MCPU="$MCPU" \
41 -DZIG_STATIC=ON \
42 -GNinja
43
44$HOME/local/bin/ninja install
45
46stage3-release/bin/zig build test docs \
47 --zig-lib-dir "$(pwd)/../lib" \
48 -Denable-macos-sdk \
49 -Dstatic-llvm \
50 -Dskip-non-native \
51 --search-prefix "$PREFIX"
52
53# Produce the experimental std lib documentation.
54stage3-release/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib
55
56# Ensure that stage3 and stage4 are byte-for-byte identical.
57stage3-release/bin/zig build \
58 --prefix stage4-release \
59 -Denable-llvm \
60 -Dno-lib \
61 -Doptimize=ReleaseFast \
62 -Dstrip \
63 -Dtarget=$TARGET \
64 -Duse-zig-libcxx \
65 -Dversion-string="$(stage3-release/bin/zig version)"
66
67# diff returns an error code if the files differ.
68echo "If the following command fails, it means nondeterminism has been"
69echo "introduced, making stage3 and stage4 no longer byte-for-byte identical."
70diff stage3-release/bin/zig stage4-release/bin/zig
ci/x86_64-macos-debug.sh deleted-58
......@@ -1,58 +0,0 @@
1#!/bin/sh
2
3set -x
4set -e
5
6ZIGDIR="$(pwd)"
7TARGET="$ARCH-macos-none"
8MCPU="baseline"
9CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.2441+eb19f73af"
10PREFIX="$HOME/$CACHE_BASENAME"
11JOBS="-j3"
12
13rm -rf $PREFIX
14cd $HOME
15
16curl -L -O "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz"
17tar xf "$CACHE_BASENAME.tar.xz"
18
19ZIG="$PREFIX/bin/zig"
20
21cd $ZIGDIR
22
23# Make the `zig version` number consistent.
24# This will affect the cmake command below.
25git config core.abbrev 9
26git fetch --unshallow || true
27git fetch --tags
28
29rm -rf build
30mkdir build
31cd build
32
33# Override the cache directories because they won't actually help other CI runs
34# which will be testing alternate versions of zig, and ultimately would just
35# fill up space on the hard drive for no reason.
36export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache"
37export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache"
38
39cmake .. \
40 -DCMAKE_PREFIX_PATH="$PREFIX" \
41 -DCMAKE_BUILD_TYPE=Debug \
42 -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \
43 -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \
44 -DZIG_TARGET_TRIPLE="$TARGET" \
45 -DZIG_TARGET_MCPU="$MCPU" \
46 -DZIG_STATIC=ON
47
48make $JOBS install
49
50stage3/bin/zig build test docs \
51 --zig-lib-dir "$(pwd)/../lib" \
52 -Denable-macos-sdk \
53 -Dstatic-llvm \
54 -Dskip-non-native \
55 --search-prefix "$PREFIX"
56
57# Produce the experimental std lib documentation.
58stage3/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib