authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-09-05 07:09:10+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-09-05 07:09:10+02:00
log91b941f54773aef1bf587b09889fd46ffc4255d9
treefcc816dc17f4b977f9da2726eadd09d3d5403f2c
parentab30a0b9a0c05c62450639de8653d6695a7ac006
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

ci: add aarch64-openbsd scripts


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

ci/aarch64-openbsd-debug.sh created+61
......@@ -0,0 +1,61 @@
1#!/bin/sh
2
3# Requires cmake ninja
4
5set -x
6set -e
7
8TARGET="aarch64-openbsd-none"
9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"
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
36# Now cmake will use zig as the C/C++ compiler. We reset the environment variables
37# so that installation and testing do not get affected by them.
38unset CC
39unset CXX
40
41ninja install
42
43# Must be done after zig cc is finished.
44export ZIG_LIB_DIR="$PWD/../lib"
45
46stage3-debug/bin/zig build test docs \
47 --maxrss ${ZSF_MAX_RSS:-0} \
48 -Dstatic-llvm \
49 -Dskip-non-native \
50 --search-prefix "$PREFIX" \
51 --test-timeout 2m
52
53stage3-debug/bin/zig build \
54 --prefix stage4-debug \
55 -Denable-llvm \
56 -Dno-lib \
57 -Dtarget=$TARGET \
58 -Duse-zig-libcxx \
59 -Dversion-string="$(stage3-debug/bin/zig version)"
60
61stage4-debug/bin/zig test ../test/behavior.zig
ci/aarch64-openbsd-release.sh created+71
......@@ -0,0 +1,71 @@
1#!/bin/sh
2
3# Requires cmake ninja
4
5set -x
6set -e
7
8TARGET="aarch64-openbsd-none"
9MCPU="baseline"
10CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.17.0-dev.203+073889523"
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
36# Now cmake will use zig as the C/C++ compiler. We reset the environment variables
37# so that installation and testing do not get affected by them.
38unset CC
39unset CXX
40
41ninja install
42
43# Must be done after zig cc is finished.
44export ZIG_LIB_DIR="$PWD/../lib"
45
46stage3-release/bin/zig build test docs \
47 --maxrss ${ZSF_MAX_RSS:-0} \
48 -Dstatic-llvm \
49 -Dskip-non-native \
50 --search-prefix "$PREFIX" \
51 --test-timeout 2m
52
53# Ensure that the fuzzer at least compiles.
54# https://codeberg.org/ziglang/zig/issues/30728
55#stage3-release/bin/zig build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=ReleaseSafe
56#stage3-release/bin/zig build test-std --fuzz=1K -Dno-lib -Dfuzz-only -Doptimize=Debug
57
58# Ensure that stage3 and stage4 are byte-for-byte identical.
59stage3-release/bin/zig build \
60 --prefix stage4-release \
61 -Denable-llvm \
62 -Dno-lib \
63 -Doptimize=ReleaseFast \
64 -Dstrip \
65 -Dtarget=$TARGET \
66 -Duse-zig-libcxx \
67 -Dversion-string="$(stage3-release/bin/zig version)"
68
69echo "If the following command fails, it means nondeterminism has been"
70echo "introduced, making stage3 and stage4 no longer byte-for-byte identical."
71diff stage3-release/bin/zig stage4-release/bin/zig