authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-03-03 01:25:45+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-03-03 01:25:45+01:00
logac24e6caf5a79573f16d2ccc273d907ad2199032
treeba98bb22d2c8e3289a9d098add163e5f79c7e7c9
parent421c3c3cc57f05bf53678ee79230c66200a69081
parentd6e9b9eb642542cd0e113a73285680b443a6a9f1

Merge pull request 'enable `aarch64-netbsd` CI' (#31377) from alexrp/zig:aarch64-netbsd-ci into master

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31377

4 files changed, 154 insertions(+), 0 deletions(-)

.forgejo/workflows/ci.yaml+21
......@@ -59,6 +59,27 @@ jobs:
5959 run: sh ci/aarch64-linux-release.sh
6060 timeout-minutes: 120
6161
62 aarch64-netbsd-debug:
63 runs-on: [self-hosted, aarch64-netbsd]
64 steps:
65 - name: Checkout
66 uses: https://codeberg.org/ziglang/checkout@19af6bac491e2534a4687a50ee84fa7f13258d28
67 with:
68 fetch-depth: 0
69 - name: Build and Test
70 run: sh ci/aarch64-netbsd-debug.sh
71 timeout-minutes: 300
72 aarch64-netbsd-release:
73 runs-on: [self-hosted, aarch64-netbsd]
74 steps:
75 - name: Checkout
76 uses: https://codeberg.org/ziglang/checkout@19af6bac491e2534a4687a50ee84fa7f13258d28
77 with:
78 fetch-depth: 0
79 - name: Build and Test
80 run: sh ci/aarch64-netbsd-release.sh
81 timeout-minutes: 240
82
6283 aarch64-macos-debug:
6384 runs-on: [self-hosted, aarch64-macos]
6485 steps:
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
test/error_traces.zig+1
......@@ -436,6 +436,7 @@ pub fn addCases(cases: *@import("tests.zig").ErrorTracesContext) void {
436436 .{ .x86_64, .linux },
437437 .{ .x86, .linux },
438438 .{ .aarch64, .freebsd },
439 .{ .aarch64, .netbsd },
439440 .{ .aarch64, .linux },
440441 .{ .loongarch64, .linux },
441442 .{ .powerpc64le, .linux },