From 6f0d1255260410441c377a52dd73c308517276cd Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Mon, 1 Jun 2026 16:07:58 -0700 Subject: [PATCH] update to zig 0.15.2 --- build.zig | 21 +++++++++++++-------- licenses.txt | 1 + test.zig | 3 ++- zig.mod | 2 ++ 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/build.zig b/build.zig index 04137abd158ae770234d2b020783c95051e53578..0a103b97a2110d742e3b8163d3dff918934b9f0e 100644 --- a/build.zig +++ b/build.zig @@ -4,13 +4,15 @@ const deps = @import("./deps.zig"); pub fn build(b: *std.Build) void { const target = b.standardTargetOptions(.{}); - const mode = b.option(std.builtin.Mode, "mode", "") orelse .Debug; + const mode = b.option(std.builtin.OptimizeMode, "mode", "") orelse .Debug; const disable_llvm = b.option(bool, "disable_llvm", "use the non-llvm zig codegen") orelse false; const test_exe = b.addTest(.{ - .root_source_file = b.path("test.zig"), - .target = target, - .optimize = mode, + .root_module = b.createModule(.{ + .root_source_file = b.path("test.zig"), + .target = target, + .optimize = mode, + }), }); deps.addAllTo(test_exe); test_exe.use_llvm = !disable_llvm; @@ -45,11 +47,14 @@ pub fn build(b: *std.Build) void { } fn addFuzzer(b: *std.Build, target: std.Build.ResolvedTarget, comptime name: []const u8, afl_clang_args: []const []const u8) *std.Build.Step.InstallFile { - const fuzz_lib = b.addStaticLibrary(.{ + const fuzz_lib = b.addLibrary(.{ + .linkage = .static, .name = "fuzz-" ++ name ++ "-lib", - .root_source_file = b.path("fuzz/main.zig"), - .target = target, - .optimize = .Debug, + .root_module = b.createModule(.{ + .root_source_file = b.path("fuzz/main.zig"), + .target = target, + .optimize = .Debug, + }), }); fuzz_lib.want_lto = true; fuzz_lib.bundle_compiler_rt = true; diff --git a/licenses.txt b/licenses.txt index f05e2acb4a4855271b5b3861d6d5dfd2f51453af..017a3a24194e8e55c01c95ca1019f5b343fa7405 100644 --- a/licenses.txt +++ b/licenses.txt @@ -1,6 +1,7 @@ MIT: = https://spdx.org/licenses/MIT - This +- git https://github.com/nektro/zig-expect - git https://github.com/nektro/zig-extras - git https://github.com/nektro/zig-sys-darwin - git https://github.com/nektro/zig-sys-linux diff --git a/test.zig b/test.zig index 8cc0b3bd20ef31db3f5d884d9efbacf1d56af819..d2c76b54acc755ef8c4beb069c731abd36374fbd 100644 --- a/test.zig +++ b/test.zig @@ -3,6 +3,7 @@ const json = @import("json"); const build_options = @import("build_options"); const nfs = @import("nfs"); const nio = @import("nio"); +const expect = @import("expect").expect; const JSONTestSuite_root = build_options.JSONTestSuite_root; @@ -579,7 +580,7 @@ fn expectCanonical(buffer: []const u8) !void { defer doc.deinit(alloc); doc.acquire(); defer doc.release(); - try std.testing.expectFmt(buffer, "{}", .{doc}); + try expect(buffer).toEqualNFmt("{}", .{doc}); var buf: [4096]u8 = undefined; var out: nio.FixedBufferStream([]u8) = .init(&buf); diff --git a/zig.mod b/zig.mod index a5d8b52c51b189fcb237c2f92ec4cd2480394518..c85a412314ef5f34f09b83a229af38217f0cbd5e 100644 --- a/zig.mod +++ b/zig.mod @@ -12,6 +12,8 @@ dependencies: root_dependencies: - src: git https://github.com/nektro/zig-nio - src: git https://github.com/nektro/zig-nfs + - src: git https://github.com/nektro/zig-expect + - src: git https://github.com/nst/JSONTestSuite commit-984defc2deaa653cb73cd29f4144a720ec9efe7c id: bebdygynna6kk8zbbprkva6yd28x9wmf57vtzxjn license: MIT -- 2.54.0