authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-03-01 19:26:58+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-03-02 15:08:37+01:00
logd182feacf7b9af7fef4f815a90c8b0bdcd3f2dc7
tree6c682d6b61f82c14e5f11ff72587c519b02ad5a1
parentf75e4027bdb92f6aba265bc1c8d39bea25624016
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

ci: add aarch64-netbsd scripts


2 files changed, 132 insertions(+), 0 deletions(-)

ci/aarch64-netbsd-debug.sh created+63
...@@ -0,0 +1,63 @@
1#!/bin/sh
2
3# Requires cmake ninja-build
4
5set -x
6set -e
7
8TARGET="aarch64-netbsd-none"
9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.16.0-dev.2287+eb3f16db5"
11PREFIX="$HOME/deps/$CACHE_BASENAME"
12ZIG="$PREFIX/bin/zig"
13
14# Override the cache directories because they won't actually help other CI runs
15# which will be testing alternate versions of zig, and ultimately would just
16# fill up space on the hard drive for no reason.
17export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
18export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
19
20mkdir build-debug
21cd build-debug
22
23export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
24export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
25
26cmake .. \
27 -DCMAKE_INSTALL_PREFIX="stage3-debug" \
28 -DCMAKE_PREFIX_PATH="$PREFIX" \
29 -DCMAKE_BUILD_TYPE=Debug \
30 -DZIG_TARGET_TRIPLE="$TARGET" \
31 -DZIG_TARGET_MCPU="$MCPU" \
32 -DZIG_STATIC=ON \
33 -DZIG_NO_LIB=ON \
34 -GNinja \
35 -DCMAKE_C_LINKER_DEPFILE_SUPPORTED=FALSE \
36 -DCMAKE_CXX_LINKER_DEPFILE_SUPPORTED=FALSE
37# https://github.com/ziglang/zig/issues/22213
38
39# Now cmake will use zig as the C/C++ compiler. We reset the environment variables
40# so that installation and testing do not get affected by them.
41unset CC
42unset CXX
43
44ninja install
45
46stage3-debug/bin/zig build test docs \
47 --maxrss ${ZSF_MAX_RSS:-0} \
48 -Dstatic-llvm \
49 -Dskip-non-native \
50 -Dskip-test-incremental \
51 --search-prefix "$PREFIX" \
52 --zig-lib-dir "$PWD/../lib" \
53 --test-timeout 4m
54
55stage3-debug/bin/zig build \
56 --prefix stage4-debug \
57 -Denable-llvm \
58 -Dno-lib \
59 -Dtarget=$TARGET \
60 -Duse-zig-libcxx \
61 -Dversion-string="$(stage3-debug/bin/zig version)"
62
63stage4-debug/bin/zig test ../test/behavior.zig
ci/aarch64-netbsd-release.sh created+69
...@@ -0,0 +1,69 @@
1#!/bin/sh
2
3# Requires cmake ninja-build
4
5set -x
6set -e
7
8TARGET="aarch64-netbsd-none"
9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.16.0-dev.2287+eb3f16db5"
11PREFIX="$HOME/deps/$CACHE_BASENAME"
12ZIG="$PREFIX/bin/zig"
13
14# Override the cache directories because they won't actually help other CI runs
15# which will be testing alternate versions of zig, and ultimately would just
16# fill up space on the hard drive for no reason.
17export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
18export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
19
20mkdir build-release
21cd build-release
22
23export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
24export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
25
26cmake .. \
27 -DCMAKE_INSTALL_PREFIX="stage3-release" \
28 -DCMAKE_PREFIX_PATH="$PREFIX" \
29 -DCMAKE_BUILD_TYPE=Release \
30 -DZIG_TARGET_TRIPLE="$TARGET" \
31 -DZIG_TARGET_MCPU="$MCPU" \
32 -DZIG_STATIC=ON \
33 -DZIG_NO_LIB=ON \
34 -GNinja \
35 -DCMAKE_C_LINKER_DEPFILE_SUPPORTED=FALSE \
36 -DCMAKE_CXX_LINKER_DEPFILE_SUPPORTED=FALSE
37# https://github.com/ziglang/zig/issues/22213
38
39# Now cmake will use zig as the C/C++ compiler. We reset the environment variables
40# so that installation and testing do not get affected by them.
41unset CC
42unset CXX
43
44ninja install
45
46stage3-release/bin/zig build test docs \
47 --maxrss ${ZSF_MAX_RSS:-0} \
48 -Dstatic-llvm \
49 -Dskip-non-native \
50 -Dskip-test-incremental \
51 --search-prefix "$PREFIX" \
52 --zig-lib-dir "$PWD/../lib" \
53 --test-timeout 4m
54
55# Ensure that stage3 and stage4 are byte-for-byte identical.
56stage3-release/bin/zig build \
57 --prefix stage4-release \
58 -Denable-llvm \
59 -Dno-lib \
60 -Doptimize=ReleaseFast \
61 -Dstrip \
62 -Dtarget=$TARGET \
63 -Duse-zig-libcxx \
64 -Dversion-string="$(stage3-release/bin/zig version)"
65
66# diff returns an error code if the files differ.
67echo "If the following command fails, it means nondeterminism has been"
68echo "introduced, making stage3 and stage4 no longer byte-for-byte identical."
69diff stage3-release/bin/zig stage4-release/bin/zig