7 TARGET
="$ARCH-macos-none"
9 CACHE_BASENAME
="zig+llvm+lld+clang-$TARGET-0.12.0-dev.467+0345d7866"
10 PREFIX
="$HOME/$CACHE_BASENAME"
16 curl
-L -O "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz"
17 tar xf
"$CACHE_BASENAME.tar.xz"
23 # Make the `zig version` number consistent.
24 # This will affect the cmake command below.
25 git fetch
--unshallow || true
28 # Test building from source without LLVM.
31 cc
-o bootstrap bootstrap.c
34 .
/zig-out
/bin
/zig
test test
/behavior.zig
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"
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" \
58 stage
3/bin
/zig build
test docs \
59 --zig-lib-dir "$PWD/../lib" \
63 --search-prefix "$PREFIX"
65 # Ensure that stage3 and stage4 are byte-for-byte identical.
66 stage
3/bin
/zig build \
70 -Doptimize=ReleaseFast \
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 stage
3/bin
/zig stage
4/bin
/zig