| author | |
| committer | |
| log | 128fd7dd02ae112cba68d0ad6cc40dc1ce8c34b1 |
| tree | b75a489d5a7ff64062a5a7a9671a8099994bdced |
| parent | 12813d5912c55d6b290690d821a782d6c756f11c |
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: |
| 41 | 41 | uses: actions/checkout@v3 |
| 42 | 42 | - name: Build and Test |
| 43 | 43 | run: sh ci/aarch64-linux-release.sh |
| 44 | x86_64-macos-debug: | |
| 44 | x86_64-macos-release: | |
| 45 | 45 | runs-on: "macos-11" |
| 46 | 46 | env: |
| 47 | 47 | ARCH: "x86_64" |
| ... | ... | @@ -49,17 +49,17 @@ jobs: |
| 49 | 49 | - name: Checkout |
| 50 | 50 | uses: actions/checkout@v3 |
| 51 | 51 | - 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] | |
| 55 | 55 | env: |
| 56 | ARCH: "x86_64" | |
| 56 | ARCH: "aarch64" | |
| 57 | 57 | steps: |
| 58 | 58 | - name: Checkout |
| 59 | 59 | uses: actions/checkout@v3 |
| 60 | 60 | - 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: | |
| 63 | 63 | runs-on: [self-hosted, macOS, aarch64] |
| 64 | 64 | env: |
| 65 | 65 | ARCH: "aarch64" |
| ... | ... | @@ -67,7 +67,7 @@ jobs: |
| 67 | 67 | - name: Checkout |
| 68 | 68 | uses: actions/checkout@v3 |
| 69 | 69 | - name: Build and Test |
| 70 | run: ci/aarch64-macos.sh | |
| 70 | run: ci/aarch64-macos-release.sh | |
| 71 | 71 | x86_64-windows-debug: |
| 72 | 72 | runs-on: windows-latest |
| 73 | 73 | env: |
ci/aarch64-macos-debug.sh created+54| ... | ... | @@ -0,0 +1,54 @@ |
| 1 | #!/bin/sh | |
| 2 | ||
| 3 | set -x | |
| 4 | set -e | |
| 5 | ||
| 6 | # Script assumes the presence of the following: | |
| 7 | # s3cmd | |
| 8 | ||
| 9 | ZIGDIR="$(pwd)" | |
| 10 | TARGET="$ARCH-macos-none" | |
| 11 | MCPU="baseline" | |
| 12 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.2441+eb19f73af" | |
| 13 | PREFIX="$HOME/$CACHE_BASENAME" | |
| 14 | ZIG="$PREFIX/bin/zig" | |
| 15 | ||
| 16 | cd $ZIGDIR | |
| 17 | ||
| 18 | # Make the `zig version` number consistent. | |
| 19 | # This will affect the cmake command below. | |
| 20 | git config core.abbrev 9 | |
| 21 | git fetch --unshallow || true | |
| 22 | git fetch --tags | |
| 23 | ||
| 24 | mkdir build | |
| 25 | cd 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. | |
| 30 | export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache" | |
| 31 | export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache" | |
| 32 | ||
| 33 | PATH="$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 | ||
| 46 | stage3-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. | |
| 54 | stage3-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 | ||
| 3 | set -x | |
| 4 | set -e | |
| 5 | ||
| 6 | # Script assumes the presence of the following: | |
| 7 | # s3cmd | |
| 8 | ||
| 9 | ZIGDIR="$(pwd)" | |
| 10 | TARGET="$ARCH-macos-none" | |
| 11 | MCPU="baseline" | |
| 12 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.2441+eb19f73af" | |
| 13 | PREFIX="$HOME/$CACHE_BASENAME" | |
| 14 | ZIG="$PREFIX/bin/zig" | |
| 15 | ||
| 16 | cd $ZIGDIR | |
| 17 | ||
| 18 | # Make the `zig version` number consistent. | |
| 19 | # This will affect the cmake command below. | |
| 20 | git config core.abbrev 9 | |
| 21 | git fetch --unshallow || true | |
| 22 | git fetch --tags | |
| 23 | ||
| 24 | mkdir build | |
| 25 | cd 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. | |
| 30 | export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache" | |
| 31 | export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache" | |
| 32 | ||
| 33 | PATH="$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 | ||
| 46 | stage3-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. | |
| 54 | stage3-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. | |
| 57 | stage3-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. | |
| 68 | echo "If the following command fails, it means nondeterminism has been" | |
| 69 | echo "introduced, making stage3 and stage4 no longer byte-for-byte identical." | |
| 70 | diff stage3-release/bin/zig stage4-release/bin/zig |
ci/aarch64-macos.sh deleted-70| ... | ... | @@ -1,70 +0,0 @@ |
| 1 | #!/bin/sh | |
| 2 | ||
| 3 | set -x | |
| 4 | set -e | |
| 5 | ||
| 6 | # Script assumes the presence of the following: | |
| 7 | # s3cmd | |
| 8 | ||
| 9 | ZIGDIR="$(pwd)" | |
| 10 | TARGET="$ARCH-macos-none" | |
| 11 | MCPU="baseline" | |
| 12 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.2441+eb19f73af" | |
| 13 | PREFIX="$HOME/$CACHE_BASENAME" | |
| 14 | ZIG="$PREFIX/bin/zig" | |
| 15 | ||
| 16 | cd $ZIGDIR | |
| 17 | ||
| 18 | # Make the `zig version` number consistent. | |
| 19 | # This will affect the cmake command below. | |
| 20 | git config core.abbrev 9 | |
| 21 | git fetch --unshallow || true | |
| 22 | git fetch --tags | |
| 23 | ||
| 24 | mkdir build | |
| 25 | cd 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. | |
| 30 | export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache" | |
| 31 | export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache" | |
| 32 | ||
| 33 | PATH="$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 | ||
| 46 | stage3-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. | |
| 54 | stage3-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. | |
| 57 | stage3-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. | |
| 68 | echo "If the following command fails, it means nondeterminism has been" | |
| 69 | echo "introduced, making stage3 and stage4 no longer byte-for-byte identical." | |
| 70 | diff stage3-release/bin/zig stage4-release/bin/zig |
ci/x86_64-macos-debug.sh deleted-58| ... | ... | @@ -1,58 +0,0 @@ |
| 1 | #!/bin/sh | |
| 2 | ||
| 3 | set -x | |
| 4 | set -e | |
| 5 | ||
| 6 | ZIGDIR="$(pwd)" | |
| 7 | TARGET="$ARCH-macos-none" | |
| 8 | MCPU="baseline" | |
| 9 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.11.0-dev.2441+eb19f73af" | |
| 10 | PREFIX="$HOME/$CACHE_BASENAME" | |
| 11 | JOBS="-j3" | |
| 12 | ||
| 13 | rm -rf $PREFIX | |
| 14 | cd $HOME | |
| 15 | ||
| 16 | curl -L -O "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz" | |
| 17 | tar xf "$CACHE_BASENAME.tar.xz" | |
| 18 | ||
| 19 | ZIG="$PREFIX/bin/zig" | |
| 20 | ||
| 21 | cd $ZIGDIR | |
| 22 | ||
| 23 | # Make the `zig version` number consistent. | |
| 24 | # This will affect the cmake command below. | |
| 25 | git config core.abbrev 9 | |
| 26 | git fetch --unshallow || true | |
| 27 | git fetch --tags | |
| 28 | ||
| 29 | rm -rf build | |
| 30 | mkdir build | |
| 31 | cd 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. | |
| 36 | export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache" | |
| 37 | export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache" | |
| 38 | ||
| 39 | cmake .. \ | |
| 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 | ||
| 48 | make $JOBS install | |
| 49 | ||
| 50 | stage3/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. | |
| 58 | stage3/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib |