build: update to zig-0.16.0-dev.3133+5ec8e45f3

This commit is contained in:
CJ van den Berg 2026-04-09 19:47:17 +02:00
parent 8d359a75a1
commit d545b10ce8
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
4 changed files with 27 additions and 30 deletions

1
.gitignore vendored
View file

@ -1,4 +1,5 @@
/.cache/
/zig-out/
/zig-pkg/
/.zig-cache/
/compile_commands.json

View file

@ -32,7 +32,7 @@ pub fn build(b: *std.Build) void {
const mode = .{ .target = target, .optimize = optimize };
const asio_dep = b.dependency("asio", mode);
const tracy_dep = if (tracy_enabled) b.dependency("tracy", mode) else undefined;
const tracy_dep = if (tracy_enabled) b.dependency("zig_tracy", mode) else undefined;
const lib = b.addLibrary(.{
.name = "thespian",
@ -46,9 +46,9 @@ pub fn build(b: *std.Build) void {
lib.root_module.addCMacro("TRACY_ENABLE", "1");
lib.root_module.addCMacro("TRACY_CALLSTACK", "1");
}
lib.addIncludePath(b.path("src"));
lib.addIncludePath(b.path("include"));
lib.addCSourceFiles(.{ .files = &[_][]const u8{
lib.root_module.addIncludePath(b.path("src"));
lib.root_module.addIncludePath(b.path("include"));
lib.root_module.addCSourceFiles(.{ .files = &[_][]const u8{
"src/backtrace.cpp",
"src/c/context.cpp",
"src/c/env.cpp",
@ -70,14 +70,14 @@ pub fn build(b: *std.Build) void {
"src/trace.cpp",
}, .flags = &cppflags });
if (tracy_enabled) {
lib.linkLibrary(tracy_dep.artifact("tracy"));
lib.root_module.linkLibrary(tracy_dep.artifact("tracy"));
}
lib.linkLibrary(asio_dep.artifact("asio"));
lib.root_module.linkLibrary(asio_dep.artifact("asio"));
if (lib.rootModuleTarget().os.tag == .windows) {
lib.linkSystemLibrary("mswsock");
lib.linkSystemLibrary("ws2_32");
lib.root_module.linkSystemLibrary("mswsock", .{});
lib.root_module.linkSystemLibrary("ws2_32", .{});
}
lib.linkLibCpp();
lib.root_module.link_libcpp = true;
b.installArtifact(lib);
const cbor_dep = b.dependency("cbor", .{
@ -106,10 +106,10 @@ pub fn build(b: *std.Build) void {
tests.root_module.addImport("build_options", options_mod);
tests.root_module.addImport("cbor", cbor_mod);
tests.root_module.addImport("thespian", thespian_mod);
tests.addIncludePath(b.path("test"));
tests.addIncludePath(b.path("src"));
tests.addIncludePath(b.path("include"));
tests.addCSourceFiles(.{ .files = &[_][]const u8{
tests.root_module.addIncludePath(b.path("test"));
tests.root_module.addIncludePath(b.path("src"));
tests.root_module.addIncludePath(b.path("include"));
tests.root_module.addCSourceFiles(.{ .files = &[_][]const u8{
"test/cbor_match.cpp",
"test/debug.cpp",
"test/endpoint_unx.cpp",
@ -127,9 +127,9 @@ pub fn build(b: *std.Build) void {
"test/tests.cpp",
"test/timeout_test.cpp",
}, .flags = &cppflags });
tests.linkLibrary(lib);
tests.linkLibrary(asio_dep.artifact("asio"));
tests.linkLibCpp();
tests.root_module.linkLibrary(lib);
tests.root_module.linkLibrary(asio_dep.artifact("asio"));
tests.root_module.link_libcpp = true;
b.installArtifact(tests);
const test_run_cmd = b.addRunArtifact(tests);

View file

@ -1,21 +1,21 @@
.{
.name = .thespian,
.version = "0.0.1",
.minimum_zig_version = "0.15.2",
.minimum_zig_version = "0.16.0-dev.3133+5ec8e45f3",
.fingerprint = 0xe9ff00fd8e4e01a3,
.dependencies = .{
.cbor = .{
.url = "git+https://github.com/neurocyte/cbor?ref=zig-0.15#b6fc137250b7d3f70459652ee78c7b6cd9ad2826",
.hash = "cbor-1.0.0-RcQE_HwwAQAiNkKC9ezLxHUMkWgHeVa3QyTfv4hi3VZR",
.url = "git+https://github.com/neurocyte/cbor?ref=master#1b7cd3192552f5fd0b1679d535e5cd978794d13a",
.hash = "cbor-1.1.0-RcQE_DBMAQBrUYInw5H2ZYfBQT1Po-Y4LEwzUQYbtSJ5",
},
.asio = .{
.url = "git+https://github.com/neurocyte/asio#0f1cbf24e5fb6fabe7078a20b76452f42e24a0df",
.hash = "asio-1.30.2-tLhDd0SB4QB1041_DEW_1cvEw8eMfBYLAwjN_G53Fn66",
.url = "git+https://github.com/neurocyte/asio#824070c9385bf98d9de087af6c7992d7039e2836",
.hash = "asio-1.30.2-tLhDdxSC4QC8WGxqT0vKX1qp6y9UZyyC4yeAin4Krvmy",
},
.tracy = .{
.url = "git+https://github.com/neurocyte/zig-tracy#67070c146104d93fd3bed5091738f22e33e13bce",
.hash = "zig_tracy-0.0.3-5-cp3Ht3AAAfHqShKfTK7waFK3Wjd3l2NheiqxvRRAdo",
.zig_tracy = .{
.url = "git+https://github.com/neurocyte/zig-tracy?ref=master#33baab18edde33cf132b778301634c87ada2aeef",
.hash = "zig_tracy-0.0.3-5-cp3Lx3AAD5wyipG-N0smFX-YdExc4efrN4KsFQFpG5",
},
},
.paths = .{

View file

@ -254,11 +254,7 @@ fn store_stack_trace(stack_trace: std.builtin.StackTrace, writer: *std.Io.Writer
writer.print("Unable to store stack trace: debug info stripped\n", .{}) catch return;
return;
}
const debug_info = std.debug.getSelfDebugInfo() catch |err| {
writer.print("Unable to dump stack trace: Unable to open debug info: {s}\n", .{@errorName(err)}) catch return;
return;
};
std.debug.writeStackTrace(stack_trace, writer, debug_info, .no_color) catch |err| {
std.debug.writeStackTrace(&stack_trace, .{ .writer = writer, .mode = .no_color }) catch |err| {
writer.print("Unable to dump stack trace: {s}\n", .{@errorName(err)}) catch return;
return;
};
@ -655,7 +651,7 @@ fn to_result(ret: result) c.thespian_result {
if (!(cbor.match(msg, .{ "exit", "normal" }) catch false)) {
if (env.get().is("dump-stack-trace")) {
const trace_ = @errorReturnTrace();
if (trace_) |t| std.debug.dumpStackTrace(t.*);
if (trace_) |t| std.debug.dumpStackTrace(t);
}
}
return &error_buffer_tl;