| author | |
| committer | |
| log | 3df4707ea79d292f07e0d78ae7dd76266eeb1a16 |
| tree | 0fc883047a5d5fed67d8f4029a96bddc999bc4f3 |
| parent | c0284e242f7d78955204dc8a627fecd45aa5e521 |
4 files changed, 143 insertions(+), 80 deletions(-)
.github/workflows/ci.yaml+11-2| ... | @@ -38,7 +38,7 @@ jobs: | ... | @@ -38,7 +38,7 @@ jobs: |
| 38 | uses: actions/checkout@v3 | 38 | uses: actions/checkout@v3 |
| 39 | - name: Build and Test | 39 | - name: Build and Test |
| 40 | run: sh ci/aarch64-linux-release.sh | 40 | run: sh ci/aarch64-linux-release.sh |
| 41 | x86_64-macos: | 41 | x86_64-macos-debug: |
| 42 | runs-on: "macos-11" | 42 | runs-on: "macos-11" |
| 43 | env: | 43 | env: |
| 44 | ARCH: "x86_64" | 44 | ARCH: "x86_64" |
| ... | @@ -46,7 +46,16 @@ jobs: | ... | @@ -46,7 +46,16 @@ jobs: |
| 46 | - name: Checkout | 46 | - name: Checkout |
| 47 | uses: actions/checkout@v3 | 47 | uses: actions/checkout@v3 |
| 48 | - name: Build and Test | 48 | - name: Build and Test |
| 49 | run: ci/x86_64-macos.sh | 49 | run: ci/x86_64-macos-debug.sh |
| 50 | x86_64-macos-release: | ||
| 51 | runs-on: "macos-11" | ||
| 52 | env: | ||
| 53 | ARCH: "x86_64" | ||
| 54 | steps: | ||
| 55 | - name: Checkout | ||
| 56 | uses: actions/checkout@v3 | ||
| 57 | - name: Build and Test | ||
| 58 | run: ci/x86_64-macos-release.sh | ||
| 50 | aarch64-macos: | 59 | aarch64-macos: |
| 51 | runs-on: [self-hosted, macOS, aarch64] | 60 | runs-on: [self-hosted, macOS, aarch64] |
| 52 | env: | 61 | env: |
ci/x86_64-macos-debug.sh created+58| ... | @@ -0,0 +1,58 @@ | ||
| 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.534+b0b1cc356" | ||
| 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 | ||
ci/x86_64-macos-release.sh created+74| ... | @@ -0,0 +1,74 @@ | ||
| 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.534+b0b1cc356" | ||
| 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=Release \ | ||
| 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 | ||
| 59 | |||
| 60 | # Ensure that stage3 and stage4 are byte-for-byte identical. | ||
| 61 | stage3/bin/zig build \ | ||
| 62 | --prefix stage4 \ | ||
| 63 | -Denable-llvm \ | ||
| 64 | -Dno-lib \ | ||
| 65 | -Drelease \ | ||
| 66 | -Dstrip \ | ||
| 67 | -Dtarget=$TARGET \ | ||
| 68 | -Duse-zig-libcxx \ | ||
| 69 | -Dversion-string="$(stage3/bin/zig version)" | ||
| 70 | |||
| 71 | # diff returns an error code if the files differ. | ||
| 72 | echo "If the following command fails, it means nondeterminism has been" | ||
| 73 | echo "introduced, making stage3 and stage4 no longer byte-for-byte identical." | ||
| 74 | diff stage3/bin/zig stage4/bin/zig | ||
ci/x86_64-macos.sh deleted-78| ... | @@ -1,78 +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.534+b0b1cc356" | ||
| 13 | PREFIX="$HOME/$CACHE_BASENAME" | ||
| 14 | JOBS="-j3" | ||
| 15 | |||
| 16 | rm -rf $PREFIX | ||
| 17 | cd $HOME | ||
| 18 | |||
| 19 | curl -L -O "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz" | ||
| 20 | tar xf "$CACHE_BASENAME.tar.xz" | ||
| 21 | |||
| 22 | ZIG="$PREFIX/bin/zig" | ||
| 23 | |||
| 24 | cd $ZIGDIR | ||
| 25 | |||
| 26 | # Make the `zig version` number consistent. | ||
| 27 | # This will affect the cmake command below. | ||
| 28 | git config core.abbrev 9 | ||
| 29 | git fetch --unshallow || true | ||
| 30 | git fetch --tags | ||
| 31 | |||
| 32 | rm -rf build | ||
| 33 | mkdir build | ||
| 34 | cd build | ||
| 35 | |||
| 36 | # Override the cache directories because they won't actually help other CI runs | ||
| 37 | # which will be testing alternate versions of zig, and ultimately would just | ||
| 38 | # fill up space on the hard drive for no reason. | ||
| 39 | export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache" | ||
| 40 | export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache" | ||
| 41 | |||
| 42 | cmake .. \ | ||
| 43 | -DCMAKE_INSTALL_PREFIX="stage3-release" \ | ||
| 44 | -DCMAKE_PREFIX_PATH="$PREFIX" \ | ||
| 45 | -DCMAKE_BUILD_TYPE=Release \ | ||
| 46 | -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \ | ||
| 47 | -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \ | ||
| 48 | -DZIG_TARGET_TRIPLE="$TARGET" \ | ||
| 49 | -DZIG_TARGET_MCPU="$MCPU" \ | ||
| 50 | -DZIG_STATIC=ON | ||
| 51 | |||
| 52 | make $JOBS install | ||
| 53 | |||
| 54 | stage3-release/bin/zig build test docs \ | ||
| 55 | --zig-lib-dir "$(pwd)/../lib" \ | ||
| 56 | -Denable-macos-sdk \ | ||
| 57 | -Dstatic-llvm \ | ||
| 58 | -Dskip-non-native \ | ||
| 59 | --search-prefix "$PREFIX" | ||
| 60 | |||
| 61 | # Produce the experimental std lib documentation. | ||
| 62 | stage3-release/bin/zig test ../lib/std/std.zig -femit-docs -fno-emit-bin --zig-lib-dir ../lib | ||
| 63 | |||
| 64 | # Ensure that stage3 and stage4 are byte-for-byte identical. | ||
| 65 | stage3-release/bin/zig build \ | ||
| 66 | --prefix stage4-release \ | ||
| 67 | -Denable-llvm \ | ||
| 68 | -Dno-lib \ | ||
| 69 | -Drelease \ | ||
| 70 | -Dstrip \ | ||
| 71 | -Dtarget=$TARGET \ | ||
| 72 | -Duse-zig-libcxx \ | ||
| 73 | -Dversion-string="$(stage3-release/bin/zig version)" | ||
| 74 | |||
| 75 | # diff returns an error code if the files differ. | ||
| 76 | echo "If the following command fails, it means nondeterminism has been" | ||
| 77 | echo "introduced, making stage3 and stage4 no longer byte-for-byte identical." | ||
| 78 | diff stage3-release/bin/zig stage4-release/bin/zig | ||