6 # Script assumes the presence of the following:
10 TARGET
="$ARCH-macos-none"
12 CACHE_BASENAME
="zig+llvm+lld+clang-$TARGET-0.12.0-dev.467+0345d7866"
13 PREFIX
="$HOME/$CACHE_BASENAME"
18 # Make the `zig version` number consistent.
19 # This will affect the cmake command below.
20 git fetch
--unshallow || true
26 # Override the cache directories because they won't actually help other CI runs
27 # which will be testing alternate versions of zig, and ultimately would just
28 # fill up space on the hard drive for no reason.
29 export ZIG_GLOBAL_CACHE_DIR
="$PWD/zig-global-cache"
30 export ZIG_LOCAL_CACHE_DIR
="$PWD/zig-local-cache"
32 PATH
="$HOME/local/bin:$PATH" cmake .. \
33 -DCMAKE_INSTALL_PREFIX="stage3-release" \
34 -DCMAKE_PREFIX_PATH="$PREFIX" \
35 -DCMAKE_BUILD_TYPE=Release \
36 -DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \
37 -DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \
38 -DZIG_TARGET_TRIPLE="$TARGET" \
39 -DZIG_TARGET_MCPU="$MCPU" \
44 $HOME/local
/bin
/ninja
install
46 stage3-release
/bin
/zig build
test docs \
47 --zig-lib-dir "$PWD/../lib" \
51 --search-prefix "$PREFIX"
53 # Ensure that stage3 and stage4 are byte-for-byte identical.
54 stage3-release
/bin
/zig build \
55 --prefix stage4-release \
58 -Doptimize=ReleaseFast \
62 -Dversion-string="$(stage3-release/bin/zig version)"
64 # diff returns an error code if the files differ.
65 echo "If the following command fails, it means nondeterminism has been"
66 echo "introduced, making stage3 and stage4 no longer byte-for-byte identical."
67 diff stage3-release
/bin
/zig stage4-release
/bin
/zig