3 # Requires cmake ninja-build
9 TARGET
="$ARCH-linux-musl"
11 CACHE_BASENAME
="zig+llvm+lld+clang-$TARGET-0.12.0-dev.203+d3bc1cfc4"
12 PREFIX
="$HOME/deps/$CACHE_BASENAME"
15 export PATH
="$HOME/deps/wasmtime-v10.0.2-$ARCH-linux:$HOME/deps/qemu-linux-x86_64-8.2.1/bin:$PATH"
17 # Make the `zig version` number consistent.
18 # This will affect the cmake command below.
19 git fetch
--unshallow || true
22 # Test building from source without LLVM.
25 cc
-o bootstrap bootstrap.c
28 .
/zig-out
/bin
/zig
test test
/behavior.zig
30 export CC
="$ZIG cc -target $TARGET -mcpu=$MCPU"
31 export CXX
="$ZIG c++ -target $TARGET -mcpu=$MCPU"
37 # Override the cache directories because they won't actually help other CI runs
38 # which will be testing alternate versions of zig, and ultimately would just
39 # fill up space on the hard drive for no reason.
40 export ZIG_GLOBAL_CACHE_DIR
="$PWD/zig-global-cache"
41 export ZIG_LOCAL_CACHE_DIR
="$PWD/zig-local-cache"
44 -DCMAKE_INSTALL_PREFIX="stage3-debug" \
45 -DCMAKE_PREFIX_PATH="$PREFIX" \
46 -DCMAKE_BUILD_TYPE=Debug \
47 -DZIG_TARGET_TRIPLE="$TARGET" \
48 -DZIG_TARGET_MCPU="$MCPU" \
53 # Now cmake will use zig as the C/C++ compiler. We reset the environment variables
54 # so that installation and testing do not get affected by them.
60 # TODO: move this to a build.zig step (check-fmt)
61 echo "Looking for non-conforming code formatting..."
62 stage3-debug
/bin
/zig
fmt --check .. \
63 --exclude ..
/test
/cases
/ \
64 --exclude ..
/build-debug
66 # simultaneously test building self-hosted without LLVM and with 32-bit arm
67 stage3-debug
/bin
/zig build \
68 -Dtarget=arm-linux-musleabihf \
71 stage3-debug
/bin
/zig build
test docs \
72 --maxrss 21000000000 \
76 -Dtarget=native-native-musl \
77 --search-prefix "$PREFIX" \
78 --zig-lib-dir "$PWD/../lib"
80 # Look for HTML errors.
81 # TODO: move this to a build.zig flag (-Denable-tidy)
82 tidy
--drop-empty-elements no
-qe "../zig-out/doc/langref.html"
84 # Ensure that updating the wasm binary from this commit will result in a viable build.
85 stage3-debug
/bin
/zig build update-zig1
91 export ZIG_GLOBAL_CACHE_DIR
="$PWD/zig-global-cache"
92 export ZIG_LOCAL_CACHE_DIR
="$PWD/zig-local-cache"
93 export CC
="$ZIG cc -target $TARGET -mcpu=$MCPU"
94 export CXX
="$ZIG c++ -target $TARGET -mcpu=$MCPU"
97 -DCMAKE_PREFIX_PATH="$PREFIX" \
98 -DCMAKE_BUILD_TYPE=Debug \
99 -DZIG_TARGET_TRIPLE="$TARGET" \
100 -DZIG_TARGET_MCPU="$MCPU" \
110 stage
3/bin
/zig
test ..
/test
/behavior.zig
111 stage
3/bin
/zig build
-p stage4 \
113 -Dtarget=native-native-musl \
115 --search-prefix "$PREFIX" \
116 --zig-lib-dir "$PWD/../lib"
117 stage
4/bin
/zig
test ..
/test
/behavior.zig