| author | |
| committer | |
| log | d1be8b138e17ff72f5d3341e7718c72059886c4a |
| tree | f44fada7aa37fa2f4946b87f43909d327994ab0c |
| parent | ac917993329076170d7a25ae5d7a9e822fb388ad |
| parent | 046386295f5a58bf7a4b2be12b82c5ee9421a243 |
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/307337 files changed, 157 insertions(+), 0 deletions(-)
.forgejo/workflows/ci.yaml+21| ... | @@ -195,6 +195,27 @@ jobs: | ... | @@ -195,6 +195,27 @@ jobs: |
| 195 | run: sh ci/x86_64-linux-release.sh | 195 | run: sh ci/x86_64-linux-release.sh |
| 196 | timeout-minutes: 360 | 196 | timeout-minutes: 360 |
| 197 | 197 | ||
| 198 | x86_64-openbsd-debug: | ||
| 199 | runs-on: [self-hosted, x86_64-openbsd] | ||
| 200 | steps: | ||
| 201 | - name: Checkout | ||
| 202 | uses: https://codeberg.org/ziglang/checkout@19af6bac491e2534a4687a50ee84fa7f13258d28 | ||
| 203 | with: | ||
| 204 | fetch-depth: 0 | ||
| 205 | - name: Build and Test | ||
| 206 | run: sh ci/x86_64-openbsd-debug.sh | ||
| 207 | timeout-minutes: 120 | ||
| 208 | x86_64-openbsd-release: | ||
| 209 | runs-on: [self-hosted, x86_64-openbsd] | ||
| 210 | steps: | ||
| 211 | - name: Checkout | ||
| 212 | uses: https://codeberg.org/ziglang/checkout@19af6bac491e2534a4687a50ee84fa7f13258d28 | ||
| 213 | with: | ||
| 214 | fetch-depth: 0 | ||
| 215 | - name: Build and Test | ||
| 216 | run: sh ci/x86_64-openbsd-release.sh | ||
| 217 | timeout-minutes: 120 | ||
| 218 | |||
| 198 | x86_64-windows-debug: | 219 | x86_64-windows-debug: |
| 199 | runs-on: [self-hosted, x86_64-windows] | 220 | runs-on: [self-hosted, x86_64-windows] |
| 200 | steps: | 221 | steps: |
ci/x86_64-openbsd-debug.sh created+62| ... | @@ -0,0 +1,62 @@ | ||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | # Requires cmake ninja-build | ||
| 4 | |||
| 5 | set -x | ||
| 6 | set -e | ||
| 7 | |||
| 8 | TARGET="x86_64-openbsd-none" | ||
| 9 | MCPU="baseline" | ||
| 10 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.16.0-dev.2051+28b83e3b0" | ||
| 11 | PREFIX="$HOME/deps/$CACHE_BASENAME" | ||
| 12 | ZIG="$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. | ||
| 17 | export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" | ||
| 18 | export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" | ||
| 19 | |||
| 20 | mkdir build-debug | ||
| 21 | cd build-debug | ||
| 22 | |||
| 23 | export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" | ||
| 24 | export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" | ||
| 25 | |||
| 26 | cmake .. \ | ||
| 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. | ||
| 41 | unset CC | ||
| 42 | unset CXX | ||
| 43 | |||
| 44 | ninja install | ||
| 45 | |||
| 46 | stage3-debug/bin/zig build test docs \ | ||
| 47 | --maxrss ${ZSF_MAX_RSS:-0} \ | ||
| 48 | -Dstatic-llvm \ | ||
| 49 | -Dskip-non-native \ | ||
| 50 | --search-prefix "$PREFIX" \ | ||
| 51 | --zig-lib-dir "$PWD/../lib" \ | ||
| 52 | --test-timeout 2m | ||
| 53 | |||
| 54 | stage3-debug/bin/zig build \ | ||
| 55 | --prefix stage4-debug \ | ||
| 56 | -Denable-llvm \ | ||
| 57 | -Dno-lib \ | ||
| 58 | -Dtarget=$TARGET \ | ||
| 59 | -Duse-zig-libcxx \ | ||
| 60 | -Dversion-string="$(stage3-debug/bin/zig version)" | ||
| 61 | |||
| 62 | stage4-debug/bin/zig test ../test/behavior.zig | ||
ci/x86_64-openbsd-release.sh created+68| ... | @@ -0,0 +1,68 @@ | ||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | # Requires cmake ninja-build | ||
| 4 | |||
| 5 | set -x | ||
| 6 | set -e | ||
| 7 | |||
| 8 | TARGET="x86_64-openbsd-none" | ||
| 9 | MCPU="baseline" | ||
| 10 | CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.16.0-dev.2051+28b83e3b0" | ||
| 11 | PREFIX="$HOME/deps/$CACHE_BASENAME" | ||
| 12 | ZIG="$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. | ||
| 17 | export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache" | ||
| 18 | export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache" | ||
| 19 | |||
| 20 | mkdir build-release | ||
| 21 | cd build-release | ||
| 22 | |||
| 23 | export CC="$ZIG cc -target $TARGET -mcpu=$MCPU" | ||
| 24 | export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU" | ||
| 25 | |||
| 26 | cmake .. \ | ||
| 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. | ||
| 41 | unset CC | ||
| 42 | unset CXX | ||
| 43 | |||
| 44 | ninja install | ||
| 45 | |||
| 46 | stage3-release/bin/zig build test docs \ | ||
| 47 | --maxrss ${ZSF_MAX_RSS:-0} \ | ||
| 48 | -Dstatic-llvm \ | ||
| 49 | -Dskip-non-native \ | ||
| 50 | --search-prefix "$PREFIX" \ | ||
| 51 | --zig-lib-dir "$PWD/../lib" \ | ||
| 52 | --test-timeout 2m | ||
| 53 | |||
| 54 | # Ensure that stage3 and stage4 are byte-for-byte identical. | ||
| 55 | stage3-release/bin/zig build \ | ||
| 56 | --prefix stage4-release \ | ||
| 57 | -Denable-llvm \ | ||
| 58 | -Dno-lib \ | ||
| 59 | -Doptimize=ReleaseFast \ | ||
| 60 | -Dstrip \ | ||
| 61 | -Dtarget=$TARGET \ | ||
| 62 | -Duse-zig-libcxx \ | ||
| 63 | -Dversion-string="$(stage3-release/bin/zig version)" | ||
| 64 | |||
| 65 | # diff returns an error code if the files differ. | ||
| 66 | echo "If the following command fails, it means nondeterminism has been" | ||
| 67 | echo "introduced, making stage3 and stage4 no longer byte-for-byte identical." | ||
| 68 | diff stage3-release/bin/zig stage4-release/bin/zig | ||
lib/std/fs/test.zig+2| ... | @@ -1130,6 +1130,7 @@ test "renameAbsolute" { | ... | @@ -1130,6 +1130,7 @@ test "renameAbsolute" { |
| 1130 | 1130 | ||
| 1131 | test "openExecutable" { | 1131 | test "openExecutable" { |
| 1132 | if (native_os == .wasi) return error.SkipZigTest; | 1132 | if (native_os == .wasi) return error.SkipZigTest; |
| 1133 | if (native_os == .openbsd) return error.SkipZigTest; | ||
| 1133 | 1134 | ||
| 1134 | const io = testing.io; | 1135 | const io = testing.io; |
| 1135 | 1136 | ||
| ... | @@ -1139,6 +1140,7 @@ test "openExecutable" { | ... | @@ -1139,6 +1140,7 @@ test "openExecutable" { |
| 1139 | 1140 | ||
| 1140 | test "executablePath" { | 1141 | test "executablePath" { |
| 1141 | if (native_os == .wasi) return error.SkipZigTest; | 1142 | if (native_os == .wasi) return error.SkipZigTest; |
| 1143 | if (native_os == .openbsd) return error.SkipZigTest; | ||
| 1142 | 1144 | ||
| 1143 | const io = testing.io; | 1145 | const io = testing.io; |
| 1144 | var buf: [Dir.max_path_bytes]u8 = undefined; | 1146 | var buf: [Dir.max_path_bytes]u8 = undefined; |
test/error_traces.zig+1| ... | @@ -439,6 +439,7 @@ pub fn addCases(cases: *@import("tests.zig").ErrorTracesContext) void { | ... | @@ -439,6 +439,7 @@ pub fn addCases(cases: *@import("tests.zig").ErrorTracesContext) void { |
| 439 | .{ .powerpc64le, .linux }, | 439 | .{ .powerpc64le, .linux }, |
| 440 | .{ .riscv64, .linux }, | 440 | .{ .riscv64, .linux }, |
| 441 | .{ .s390x, .linux }, | 441 | .{ .s390x, .linux }, |
| 442 | .{ .x86_64, .openbsd }, | ||
| 442 | .{ .x86_64, .windows }, | 443 | .{ .x86_64, .windows }, |
| 443 | .{ .x86, .windows }, | 444 | .{ .x86, .windows }, |
| 444 | .{ .x86_64, .macos }, | 445 | .{ .x86_64, .macos }, |
test/standalone/libfuzzer/build.zig+1| ... | @@ -6,6 +6,7 @@ pub fn build(b: *std.Build) void { | ... | @@ -6,6 +6,7 @@ pub fn build(b: *std.Build) void { |
| 6 | const optimize = b.standardOptimizeOption(.{}); | 6 | const optimize = b.standardOptimizeOption(.{}); |
| 7 | 7 | ||
| 8 | if (builtin.os.tag == .windows) return; // TODO: libfuzzer support for windows | 8 | if (builtin.os.tag == .windows) return; // TODO: libfuzzer support for windows |
| 9 | if (builtin.os.tag == .openbsd) return; // https://codeberg.org/ziglang/zig/issues/30728 | ||
| 9 | 10 | ||
| 10 | const run_step = b.step("run", "Run executables"); | 11 | const run_step = b.step("run", "Run executables"); |
| 11 | const exe = b.addExecutable(.{ | 12 | const exe = b.addExecutable(.{ |
test/standalone/self_exe_symlink/build.zig+2| ... | @@ -9,6 +9,8 @@ pub fn build(b: *std.Build) void { | ... | @@ -9,6 +9,8 @@ pub fn build(b: *std.Build) void { |
| 9 | const optimize: std.builtin.OptimizeMode = .Debug; | 9 | const optimize: std.builtin.OptimizeMode = .Debug; |
| 10 | const target = b.graph.host; | 10 | const target = b.graph.host; |
| 11 | 11 | ||
| 12 | if (target.result.os.tag == .openbsd) return; // realpath not supported | ||
| 13 | |||
| 12 | const main = b.addExecutable(.{ | 14 | const main = b.addExecutable(.{ |
| 13 | .name = "main", | 15 | .name = "main", |
| 14 | .root_module = b.createModule(.{ | 16 | .root_module = b.createModule(.{ |