std.crypto: make ff.ct_unprotected.limbsCmpLt compile (#19741)
[zig.git] / ci / x86_64-macos-release.sh
blobc67613d3fcfcf6ad6cbe814bde2714058a846080
1 #!/bin/sh
3 set -x
4 set -e
6 ZIGDIR="$PWD"
7 TARGET="$ARCH-macos-none"
8 MCPU="baseline"
9 CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.12.0-dev.467+0345d7866"
10 PREFIX="$HOME/$CACHE_BASENAME"
11 JOBS="-j3"
13 rm -rf $PREFIX
14 cd $HOME
16 curl -L -O "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz"
17 tar xf "$CACHE_BASENAME.tar.xz"
19 ZIG="$PREFIX/bin/zig"
21 cd $ZIGDIR
23 # Make the `zig version` number consistent.
24 # This will affect the cmake command below.
25 git fetch --unshallow || true
26 git fetch --tags
28 # Test building from source without LLVM.
29 git clean -fd
30 rm -rf zig-out
31 cc -o bootstrap bootstrap.c
32 ./bootstrap
33 ./zig2 build -Dno-lib
34 ./zig-out/bin/zig test test/behavior.zig
36 rm -rf build
37 mkdir build
38 cd build
40 # Override the cache directories because they won't actually help other CI runs
41 # which will be testing alternate versions of zig, and ultimately would just
42 # fill up space on the hard drive for no reason.
43 export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
44 export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
46 cmake .. \
47 -DCMAKE_PREFIX_PATH="$PREFIX" \
48 -DCMAKE_BUILD_TYPE=Release \
49 -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \
50 -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \
51 -DZIG_TARGET_TRIPLE="$TARGET" \
52 -DZIG_TARGET_MCPU="$MCPU" \
53 -DZIG_STATIC=ON \
54 -DZIG_NO_LIB=ON
56 make $JOBS install
58 stage3/bin/zig build test docs \
59 --zig-lib-dir "$PWD/../lib" \
60 -Denable-macos-sdk \
61 -Dstatic-llvm \
62 -Dskip-non-native \
63 --search-prefix "$PREFIX"
65 # Ensure that stage3 and stage4 are byte-for-byte identical.
66 stage3/bin/zig build \
67 --prefix stage4 \
68 -Denable-llvm \
69 -Dno-lib \
70 -Doptimize=ReleaseFast \
71 -Dstrip \
72 -Dtarget=$TARGET \
73 -Duse-zig-libcxx \
74 -Dversion-string="$(stage3/bin/zig version)"
76 # diff returns an error code if the files differ.
77 echo "If the following command fails, it means nondeterminism has been"
78 echo "introduced, making stage3 and stage4 no longer byte-for-byte identical."
79 diff stage3/bin/zig stage4/bin/zig