| author | |
| committer | |
| log | d395127552ab6f04b7b044b2a309e0d1e8977775 |
| tree | a4ceb1d7b27cae61fb196f14d58e3c473ce69fdf |
| parent | 05c7f7abf1730a54568cd9dc7c8fa22102cd0f28 |
| parent | 4592ee77c0770c60ec573e561a474e2ab9cf9b84 |
| signature |
CI: additionally test x86_64-macos with a debug build of the zig compiler5 files changed, 151 insertions(+), 81 deletions(-)
.github/workflows/ci.yaml+11-2| ... | ... | @@ -38,7 +38,7 @@ jobs: |
| 38 | 38 | uses: actions/checkout@v3 |
| 39 | 39 | - name: Build and Test |
| 40 | 40 | run: sh ci/aarch64-linux-release.sh |
| 41 | x86_64-macos: | |
| 41 | x86_64-macos-debug: | |
| 42 | 42 | runs-on: "macos-11" |
| 43 | 43 | env: |
| 44 | 44 | ARCH: "x86_64" |
| ... | ... | @@ -46,7 +46,16 @@ jobs: |
| 46 | 46 | - name: Checkout |
| 47 | 47 | uses: actions/checkout@v3 |
| 48 | 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 | 59 | aarch64-macos: |
| 51 | 60 | runs-on: [self-hosted, macOS, aarch64] |
| 52 | 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.1416+8484df5bd" | |
| 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.1416+8484df5bd" | |
| 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 |
src/Compilation.zig+8-1| ... | ... | @@ -4319,11 +4319,18 @@ pub fn addCCArgs( |
| 4319 | 4319 | } |
| 4320 | 4320 | }, |
| 4321 | 4321 | .macos => { |
| 4322 | try argv.ensureUnusedCapacity(2); | |
| 4322 | 4323 | // Pass the proper -m<os>-version-min argument for darwin. |
| 4323 | 4324 | const ver = target.os.version_range.semver.min; |
| 4324 | try argv.append(try std.fmt.allocPrint(arena, "-mmacos-version-min={d}.{d}.{d}", .{ | |
| 4325 | argv.appendAssumeCapacity(try std.fmt.allocPrint(arena, "-mmacos-version-min={d}.{d}.{d}", .{ | |
| 4325 | 4326 | ver.major, ver.minor, ver.patch, |
| 4326 | 4327 | })); |
| 4328 | // This avoids a warning that sometimes occurs when | |
| 4329 | // providing both a -target argument that contains a | |
| 4330 | // version as well as the -mmacosx-version-min argument. | |
| 4331 | // Zig provides the correct value in both places, so it | |
| 4332 | // doesn't matter which one gets overridden. | |
| 4333 | argv.appendAssumeCapacity("-Wno-overriding-t-option"); | |
| 4327 | 4334 | }, |
| 4328 | 4335 | .ios, .tvos, .watchos => switch (target.cpu.arch) { |
| 4329 | 4336 | // Pass the proper -m<os>-version-min argument for darwin. |