std.crypto: make ff.ct_unprotected.limbsCmpLt compile (#19741)
[zig.git] / ci / x86_64-linux-debug.sh
blobf818073b3669e2fa06025249dc4539d36489e701
1 #!/bin/sh
3 # Requires cmake ninja-build
5 set -x
6 set -e
8 ARCH="$(uname -m)"
9 TARGET="$ARCH-linux-musl"
10 MCPU="baseline"
11 CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.12.0-dev.203+d3bc1cfc4"
12 PREFIX="$HOME/deps/$CACHE_BASENAME"
13 ZIG="$PREFIX/bin/zig"
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
20 git fetch --tags
22 # Test building from source without LLVM.
23 git clean -fd
24 rm -rf zig-out
25 cc -o bootstrap bootstrap.c
26 ./bootstrap
27 ./zig2 build -Dno-lib
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"
33 rm -rf build-debug
34 mkdir build-debug
35 cd build-debug
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"
43 cmake .. \
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" \
49 -DZIG_STATIC=ON \
50 -DZIG_NO_LIB=ON \
51 -GNinja
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.
55 unset CC
56 unset CXX
58 ninja install
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 \
69 -Dno-lib
71 stage3-debug/bin/zig build test docs \
72 --maxrss 21000000000 \
73 -fqemu \
74 -fwasmtime \
75 -Dstatic-llvm \
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
87 rm -rf ../build-new
88 mkdir ../build-new
89 cd ../build-new
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"
96 cmake .. \
97 -DCMAKE_PREFIX_PATH="$PREFIX" \
98 -DCMAKE_BUILD_TYPE=Debug \
99 -DZIG_TARGET_TRIPLE="$TARGET" \
100 -DZIG_TARGET_MCPU="$MCPU" \
101 -DZIG_STATIC=ON \
102 -DZIG_NO_LIB=ON \
103 -GNinja
105 unset CC
106 unset CXX
108 ninja install
110 stage3/bin/zig test ../test/behavior.zig
111 stage3/bin/zig build -p stage4 \
112 -Dstatic-llvm \
113 -Dtarget=native-native-musl \
114 -Dno-lib \
115 --search-prefix "$PREFIX" \
116 --zig-lib-dir "$PWD/../lib"
117 stage4/bin/zig test ../test/behavior.zig