From 4d317d7bf02eef26da56eddd2d49e46984b50572 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Tue, 15 Jul 2025 17:35:19 +0200 Subject: [PATCH] build: update to new writer API in zig-0.15.0-dev.1034+bd97b6618 --- src/thespian.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/thespian.zig b/src/thespian.zig index 9d2b9f4..4fda66a 100644 --- a/src/thespian.zig +++ b/src/thespian.zig @@ -230,15 +230,15 @@ pub fn exit_message(e: anytype, stack_trace: ?*std.builtin.StackTrace) message { var debug_info_arena_allocator: std.heap.ArenaAllocator = std.heap.ArenaAllocator.init(std.heap.page_allocator); defer debug_info_arena_allocator.deinit(); const a = debug_info_arena_allocator.allocator(); - var out = std.ArrayList(u8).init(a); - store_stack_trace(stack_trace_.*, out.writer()); - return message.fmtbuf(&error_message_buffer, .{ "exit", e, out.items }) catch unreachable; + var out: std.Io.Writer.Allocating = .init(a); + store_stack_trace(stack_trace_.*, &out.writer); + return message.fmtbuf(&error_message_buffer, .{ "exit", e, out.getWritten() }) catch unreachable; } else { return message.fmtbuf(&error_message_buffer, .{ "exit", e }) catch unreachable; } } -fn store_stack_trace(stack_trace: std.builtin.StackTrace, writer: anytype) void { +fn store_stack_trace(stack_trace: std.builtin.StackTrace, writer: *std.Io.Writer) void { nosuspend { if (builtin.strip_debug_info) { writer.print("Unable to store stack trace: debug info stripped\n", .{}) catch return;