Compare commits

...

2 commits

4 changed files with 22 additions and 17 deletions

View file

@ -34,10 +34,13 @@ pub fn build(b: *std.Build) void {
const asio_dep = b.dependency("asio", mode);
const tracy_dep = if (tracy_enabled) b.dependency("tracy", mode) else undefined;
const lib = b.addStaticLibrary(.{
const lib = b.addLibrary(.{
.name = "thespian",
.target = target,
.optimize = optimize,
.linkage = .static,
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
}),
});
if (tracy_enabled) {
lib.root_module.addCMacro("TRACY_ENABLE", "1");
@ -90,9 +93,11 @@ pub fn build(b: *std.Build) void {
thespian_mod.linkLibrary(lib);
const tests = b.addTest(.{
.root_source_file = b.path("test/tests.zig"),
.target = target,
.optimize = optimize,
.root_module = b.createModule(.{
.root_source_file = b.path("test/tests.zig"),
.target = target,
.optimize = optimize,
}),
});
tests.root_module.addImport("build_options", options_mod);

View file

@ -1 +1 @@
0.15.0-dev.936+fc2c1883b
0.15.0-dev.1034+bd97b6618

View file

@ -5,16 +5,16 @@
.dependencies = .{
.cbor = .{
.url = "https://github.com/neurocyte/cbor/archive/5ea4b7319146f29bb1aa9acf65982feaba9edc3d.tar.gz",
.hash = "cbor-1.0.0-RcQE_GDyAABovyRXoYFX8zD_NVOLGDc9l5g09-W-svMR",
.url = "git+https://github.com/neurocyte/cbor#6eccce0b984296e7d05c20d83933cb31530e4fac",
.hash = "cbor-1.0.0-RcQE_N3yAADXjbyvhsmTQ6lf22l1nYgePq5FT8NaC4ic",
},
.asio = .{
.url = "https://github.com/neurocyte/asio/archive/c017afbe65b4b71b5ba3ecaeb6dbc981df75dc9b.tar.gz",
.hash = "asio-1.30.2-tLhDdweB4QAEkwboXZ-EshXBw4Fxs4KGxYhKdR0hu5O1",
.url = "git+https://github.com/neurocyte/asio#0f1cbf24e5fb6fabe7078a20b76452f42e24a0df",
.hash = "asio-1.30.2-tLhDd0SB4QB1041_DEW_1cvEw8eMfBYLAwjN_G53Fn66",
},
.tracy = .{
.url = "https://github.com/neurocyte/zig-tracy/archive/82f18a661af17089198fb7c489ef253f02b939b5.tar.gz",
.hash = "zig_tracy-0.0.3-5-cp3JZ2AAC6j-gWFhPKXyF6WASJpCzQeNy7Bi712t1a",
.url = "git+https://github.com/neurocyte/zig-tracy#67070c146104d93fd3bed5091738f22e33e13bce",
.hash = "zig_tracy-0.0.3-5-cp3Ht3AAAfHqShKfTK7waFK3Wjd3l2NheiqxvRRAdo",
},
},
.paths = .{

View file

@ -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;