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 {
1414 addTest(b, target, mode, disable_llvm, mod, 3);
1515
1616 const test_step = b.step("test", "Run all library tests");
17 test_step.dependOn(b.default_step);
17 test_step.dependOn(b.getInstallStep());
1818}
1919
2020fn addTest(b: *std.Build, target: std.Build.ResolvedTarget, mode: std.builtin.Mode, disable_llvm: bool, mod: *std.Build.Module, comptime backend: u8) void {
2121 _ = mod;
2222 const options = b.addOptions();
23 options.addOption(usize, "src_file_trimlen", std.fs.path.dirname(std.fs.path.dirname(@src().file).?).?.len);
2423 options.addOption(u8, "backend", backend);
2524
2625 const exe = b.addExecutable(.{
src/chrome.zig+4-5
......@@ -3,7 +3,6 @@ const tracer = @import("./mod.zig");
33const alloc = std.heap.c_allocator;
44const log = std.log.scoped(.tracer);
55const root = @import("root");
6const trim_count = root.build_options.src_file_trimlen;
76
87var pid: std.os.linux.pid_t = undefined;
98threadlocal var tid: std.os.linux.pid_t = undefined;
......@@ -40,12 +39,12 @@ pub fn deinit_thread() void {
4039pub inline fn trace_begin(ctx: tracer.Ctx, comptime ifmt: []const u8, iargs: anytype) void {
4140 buffered_writer.writer().print(
4241 \\{{"cat":"function", "name":"{s}:{d}:{d} ({s})
43 ++ ifmt ++
44 \\", "ph": "B", "pid": {d}, "tid": {d}, "ts": {d}}},
45 \\
42 ++ ifmt ++
43 \\", "ph": "B", "pid": {d}, "tid": {d}, "ts": {d}}},
44 \\
4645 ,
4746 .{
48 if (ctx.src.file[0] == '/') ctx.src.file[trim_count..] else ctx.src.file,
47 ctx.src.file,
4948 ctx.src.line,
5049 ctx.src.column,
5150 ctx.src.fn_name,
src/spall.zig+1-7
......@@ -3,7 +3,6 @@ const tracer = @import("./mod.zig");
33const alloc = std.heap.c_allocator;
44const log = std.log.scoped(.tracer);
55const root = @import("root");
6const trim_count = root.build_options.src_file_trimlen;
76
87var pid: std.os.linux.pid_t = undefined;
98threadlocal var tid: std.os.linux.pid_t = undefined;
......@@ -38,12 +37,7 @@ pub fn deinit_thread() void {
3837
3938pub inline fn trace_begin(ctx: tracer.Ctx, comptime ifmt: []const u8, iargs: anytype) void {
4039 const fmt = "{s}:{d}:{d} ({s})" ++ ifmt;
41 const args = .{
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 };
40 const args = .{ ctx.src.file, ctx.src.line, ctx.src.column, ctx.src.fn_name };
4741 buffered_writer.writer().writeStruct(BeginEvent{
4842 .pid = @intCast(pid),
4943 .tid = @intCast(tid),