diff --git a/build.zig b/build.zig index d5fe34f..6910fda 100644 --- a/build.zig +++ b/build.zig @@ -4,7 +4,7 @@ const builtin = @import("builtin"); pub fn build(b: *std.Build) void { comptime { const current_zig = builtin.zig_version; - const min_zig = std.SemanticVersion.parse("0.12.0-dev.2030") catch unreachable; // build system changes: ziglang/zig#18160 + const min_zig = std.SemanticVersion.parse("0.13.0-dev.230+50a141945") catch unreachable; // build system changes: ziglang/zig#19597 if (current_zig.order(min_zig) == .lt) { @compileError(std.fmt.comptimePrint("Your Zig version v{} does not meet the minimum build requirement of v{}", .{ current_zig, min_zig })); } @@ -14,20 +14,20 @@ pub fn build(b: *std.Build) void { const optimize = b.standardOptimizeOption(.{}); const extism_module = b.addModule("extism", .{ - .root_source_file = .{ .path = "src/main.zig" }, + .root_source_file = b.path("src/main.zig"), }); var tests = b.addTest(.{ .name = "Library Tests", - .root_source_file = .{ .path = "test.zig" }, + .root_source_file = b.path("test.zig"), .target = target, .optimize = optimize, }); tests.root_module.addImport("extism", extism_module); tests.linkLibC(); - tests.addIncludePath(.{ .path = "/usr/local/include" }); - tests.addLibraryPath(.{ .path = "/usr/local/lib" }); + tests.addIncludePath(.{ .cwd_relative = "/usr/local/include" }); + tests.addLibraryPath(.{ .cwd_relative = "/usr/local/lib" }); tests.linkSystemLibrary("extism"); const tests_run_step = b.addRunArtifact(tests); @@ -36,15 +36,15 @@ pub fn build(b: *std.Build) void { var example = b.addExecutable(.{ .name = "Example", - .root_source_file = .{ .path = "examples/basic.zig" }, + .root_source_file = b.path("examples/basic.zig"), .target = target, .optimize = optimize, }); example.root_module.addImport("extism", extism_module); example.linkLibC(); - example.addIncludePath(.{ .path = "/usr/local/include" }); - example.addLibraryPath(.{ .path = "/usr/local/lib" }); + example.addIncludePath(.{ .cwd_relative = "/usr/local/include" }); + example.addLibraryPath(.{ .cwd_relative = "/usr/local/lib" }); example.linkSystemLibrary("extism"); const example_run_step = b.addRunArtifact(example); @@ -56,7 +56,7 @@ pub fn addLibrary(to: *std.Build.Step.Compile, b: *std.Build) void { to.root_module.addImport("extism", b.dependency("extism", .{}).module("extism")); to.linkLibC(); // TODO: switch based on platform and use platform-specific paths here - to.addIncludePath(.{ .path = "/usr/local/include" }); - to.addLibraryPath(.{ .path = "/usr/local/lib" }); + to.addIncludePath(.{ .cwd_relative = "/usr/local/include" }); + to.addLibraryPath(.{ .cwd_relative = "/usr/local/lib" }); to.linkSystemLibrary("extism"); } diff --git a/test.zig b/test.zig index 8b30f16..5bdcb2d 100644 --- a/test.zig +++ b/test.zig @@ -128,7 +128,7 @@ test "Plugin Cancellation" { var handle = plugin.cancelHandle(); const S = struct { fn _test(h: *sdk.CancelHandle) void { - std.os.nanosleep(1, 0); + std.time.sleep(1 * std.time.ns_per_s); _ = h.cancel(); } };