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:$PATH"
17 # Make the `zig version` number consistent.
18 # This will affect the cmake command below.
19 git fetch
--unshallow || true
22 export CC
="$ZIG cc -target $TARGET -mcpu=$MCPU"
23 export CXX
="$ZIG c++ -target $TARGET -mcpu=$MCPU"
29 # Override the cache directories because they won't actually help other CI runs
30 # which will be testing alternate versions of zig, and ultimately would just
31 # fill up space on the hard drive for no reason.
32 export ZIG_GLOBAL_CACHE_DIR
="$PWD/zig-global-cache"
33 export ZIG_LOCAL_CACHE_DIR
="$PWD/zig-local-cache"
36 -DCMAKE_INSTALL_PREFIX="stage3-release" \
37 -DCMAKE_PREFIX_PATH="$PREFIX" \
38 -DCMAKE_BUILD_TYPE=Release \
39 -DZIG_TARGET_TRIPLE="$TARGET" \
40 -DZIG_TARGET_MCPU="$MCPU" \
45 # Now cmake will use zig as the C/C++ compiler. We reset the environment variables
46 # so that installation and testing do not get affected by them.
52 # TODO: move this to a build.zig step (check-fmt)
53 echo "Looking for non-conforming code formatting..."
54 stage3-release
/bin
/zig
fmt --check .. \
55 --exclude ..
/test
/cases
/ \
56 --exclude ..
/build-release
58 # simultaneously test building self-hosted without LLVM and with 32-bit arm
59 stage3-release
/bin
/zig build \
60 -Dtarget=arm-linux-musleabihf \
63 # TODO: add -fqemu back to this line
64 stage3-release
/bin
/zig build
test docs \
65 --maxrss 24696061952 \
68 -Dtarget=native-native-musl \
69 --search-prefix "$PREFIX" \
70 --zig-lib-dir "$PWD/../lib"
72 # Look for HTML errors.
73 # TODO: move this to a build.zig flag (-Denable-tidy)
74 tidy
--drop-empty-elements no
-qe "../zig-out/doc/langref.html"
76 # Ensure that updating the wasm binary from this commit will result in a viable build.
77 stage3-release
/bin
/zig build update-zig1
83 export ZIG_GLOBAL_CACHE_DIR
="$PWD/zig-global-cache"
84 export ZIG_LOCAL_CACHE_DIR
="$PWD/zig-local-cache"
85 export CC
="$ZIG cc -target $TARGET -mcpu=$MCPU"
86 export CXX
="$ZIG c++ -target $TARGET -mcpu=$MCPU"
89 -DCMAKE_PREFIX_PATH="$PREFIX" \
90 -DCMAKE_BUILD_TYPE=Release \
91 -DZIG_TARGET_TRIPLE="$TARGET" \
92 -DZIG_TARGET_MCPU="$MCPU" \
102 stage
3/bin
/zig
test ..
/test
/behavior.zig
103 stage
3/bin
/zig build
-p stage4 \
105 -Dtarget=native-native-musl \
107 --search-prefix "$PREFIX" \
108 --zig-lib-dir "$PWD/../lib"
109 stage
4/bin
/zig
test ..
/test
/behavior.zig