authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-05-21 13:32:23 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-05-21 13:32:23 -07:00
log4fb61d4447b4e90d385c961a45c54aed8352381e
treec958b3ae4b9632d87518adcae2a00e9fa3c81f74
parentf87511611a32cbb063bd77e6cc9130965333a30d

update to Zig 0.14


3 files changed, 6 insertions(+), 14 deletions(-)

build.zig+1-2
...@@ -14,13 +14,12 @@ pub fn build(b: *std.Build) void {...@@ -14,13 +14,12 @@ pub fn build(b: *std.Build) void {
14 addTest(b, target, mode, disable_llvm, mod, 3);14 addTest(b, target, mode, disable_llvm, mod, 3);
1515
16 const test_step = b.step("test", "Run all library tests");16 const test_step = b.step("test", "Run all library tests");
17 test_step.dependOn(b.default_step);17 test_step.dependOn(b.getInstallStep());
18}18}
1919
20fn addTest(b: *std.Build, target: std.Build.ResolvedTarget, mode: std.builtin.Mode, disable_llvm: bool, mod: *std.Build.Module, comptime backend: u8) void {20fn addTest(b: *std.Build, target: std.Build.ResolvedTarget, mode: std.builtin.Mode, disable_llvm: bool, mod: *std.Build.Module, comptime backend: u8) void {
21 _ = mod;21 _ = mod;
22 const options = b.addOptions();22 const options = b.addOptions();
23 options.addOption(usize, "src_file_trimlen", std.fs.path.dirname(std.fs.path.dirname(@src().file).?).?.len);
24 options.addOption(u8, "backend", backend);23 options.addOption(u8, "backend", backend);
2524
26 const exe = b.addExecutable(.{25 const exe = b.addExecutable(.{
src/chrome.zig+4-5
...@@ -3,7 +3,6 @@ const tracer = @import("./mod.zig");...@@ -3,7 +3,6 @@ const tracer = @import("./mod.zig");
3const alloc = std.heap.c_allocator;3const alloc = std.heap.c_allocator;
4const log = std.log.scoped(.tracer);4const log = std.log.scoped(.tracer);
5const root = @import("root");5const root = @import("root");
6const trim_count = root.build_options.src_file_trimlen;
76
8var pid: std.os.linux.pid_t = undefined;7var pid: std.os.linux.pid_t = undefined;
9threadlocal var tid: std.os.linux.pid_t = undefined;8threadlocal var tid: std.os.linux.pid_t = undefined;
...@@ -40,12 +39,12 @@ pub fn deinit_thread() void {...@@ -40,12 +39,12 @@ pub fn deinit_thread() void {
40pub inline fn trace_begin(ctx: tracer.Ctx, comptime ifmt: []const u8, iargs: anytype) void {39pub inline fn trace_begin(ctx: tracer.Ctx, comptime ifmt: []const u8, iargs: anytype) void {
41 buffered_writer.writer().print(40 buffered_writer.writer().print(
42 \\{{"cat":"function", "name":"{s}:{d}:{d} ({s})41 \\{{"cat":"function", "name":"{s}:{d}:{d} ({s})
43 ++ ifmt ++42 ++ ifmt ++
44 \\", "ph": "B", "pid": {d}, "tid": {d}, "ts": {d}}},43 \\", "ph": "B", "pid": {d}, "tid": {d}, "ts": {d}}},
45 \\44 \\
46 ,45 ,
47 .{46 .{
48 if (ctx.src.file[0] == '/') ctx.src.file[trim_count..] else ctx.src.file,47 ctx.src.file,
49 ctx.src.line,48 ctx.src.line,
50 ctx.src.column,49 ctx.src.column,
51 ctx.src.fn_name,50 ctx.src.fn_name,
src/spall.zig+1-7
...@@ -3,7 +3,6 @@ const tracer = @import("./mod.zig");...@@ -3,7 +3,6 @@ const tracer = @import("./mod.zig");
3const alloc = std.heap.c_allocator;3const alloc = std.heap.c_allocator;
4const log = std.log.scoped(.tracer);4const log = std.log.scoped(.tracer);
5const root = @import("root");5const root = @import("root");
6const trim_count = root.build_options.src_file_trimlen;
76
8var pid: std.os.linux.pid_t = undefined;7var pid: std.os.linux.pid_t = undefined;
9threadlocal var tid: std.os.linux.pid_t = undefined;8threadlocal var tid: std.os.linux.pid_t = undefined;
...@@ -38,12 +37,7 @@ pub fn deinit_thread() void {...@@ -38,12 +37,7 @@ pub fn deinit_thread() void {
3837
39pub inline fn trace_begin(ctx: tracer.Ctx, comptime ifmt: []const u8, iargs: anytype) void {38pub inline fn trace_begin(ctx: tracer.Ctx, comptime ifmt: []const u8, iargs: anytype) void {
40 const fmt = "{s}:{d}:{d} ({s})" ++ ifmt;39 const fmt = "{s}:{d}:{d} ({s})" ++ ifmt;
41 const args = .{40 const args = .{ ctx.src.file, ctx.src.line, ctx.src.column, ctx.src.fn_name };
42 if (ctx.src.file[0] == '/') ctx.src.file[trim_count..] else ctx.src.file,
43 ctx.src.line,
44 ctx.src.column,
45 ctx.src.fn_name,
46 };
47 buffered_writer.writer().writeStruct(BeginEvent{41 buffered_writer.writer().writeStruct(BeginEvent{
48 .pid = @intCast(pid),42 .pid = @intCast(pid),
49 .tid = @intCast(tid),43 .tid = @intCast(tid),