build: update to latest zig master
This commit is contained in:
parent
a98cb1f5e6
commit
3121af2ec4
5 changed files with 21 additions and 21 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,3 +1,3 @@
|
|||
/.cache/
|
||||
/zig-out/
|
||||
/zig-cache/
|
||||
/.zig-cache/
|
||||
|
|
18
build.zig
18
build.zig
|
@ -42,8 +42,8 @@ pub fn build(b: *std.Build) void {
|
|||
lib.defineCMacro("TRACY_ENABLE", null);
|
||||
lib.defineCMacro("TRACY_CALLSTACK", null);
|
||||
}
|
||||
lib.addIncludePath(.{ .path = "src" });
|
||||
lib.addIncludePath(.{ .path = "include" });
|
||||
lib.addIncludePath(b.path("src"));
|
||||
lib.addIncludePath(b.path("include"));
|
||||
lib.addCSourceFiles(.{ .files = &[_][]const u8{
|
||||
"src/backtrace.cpp",
|
||||
"src/c/context.cpp",
|
||||
|
@ -69,20 +69,20 @@ pub fn build(b: *std.Build) void {
|
|||
b.installArtifact(lib);
|
||||
|
||||
const cbor_mod = b.addModule("cbor", .{
|
||||
.root_source_file = .{ .path = "src/cbor.zig" },
|
||||
.root_source_file = b.path("src/cbor.zig"),
|
||||
});
|
||||
|
||||
const thespian_mod = b.addModule("thespian", .{
|
||||
.root_source_file = .{ .path = "src/thespian.zig" },
|
||||
.root_source_file = b.path("src/thespian.zig"),
|
||||
.imports = &.{
|
||||
.{ .name = "cbor", .module = cbor_mod },
|
||||
},
|
||||
});
|
||||
thespian_mod.addIncludePath(.{ .path = "include" });
|
||||
thespian_mod.addIncludePath(b.path("include"));
|
||||
thespian_mod.linkLibrary(lib);
|
||||
|
||||
const tests = b.addTest(.{
|
||||
.root_source_file = .{ .path = "test/tests.zig" },
|
||||
.root_source_file = b.path("test/tests.zig"),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
|
@ -90,9 +90,9 @@ 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(.{ .path = "test" });
|
||||
tests.addIncludePath(.{ .path = "src" });
|
||||
tests.addIncludePath(.{ .path = "include" });
|
||||
tests.addIncludePath(b.path("test"));
|
||||
tests.addIncludePath(b.path("src"));
|
||||
tests.addIncludePath(b.path("include"));
|
||||
tests.addCSourceFiles(.{ .files = &[_][]const u8{
|
||||
"test/cbor_match.cpp",
|
||||
"test/debug.cpp",
|
||||
|
|
|
@ -1 +1 @@
|
|||
0.12.0
|
||||
0.13.0-dev.363+7fc3fb955
|
||||
|
|
|
@ -4,12 +4,12 @@
|
|||
|
||||
.dependencies = .{
|
||||
.asio = .{
|
||||
.url = "https://github.com/neurocyte/asio/archive/cd95148112967de017653173c4cad6a9d0bf60b7.tar.gz",
|
||||
.hash = "12207e740e2924b615c030f9ae64f4257b89f741b1554a2494dbe349b32b815bfefd",
|
||||
.url = "https://github.com/neurocyte/asio/archive/b9c9c23ef2e6f11b6123535ec33e5a23ed0c59da.tar.gz",
|
||||
.hash = "1220c85e0d9438ec518849c84e3ea66633a0e191e49c4ae4bbb3bc46626cd8dfad75",
|
||||
},
|
||||
.tracy = .{
|
||||
.url = "https://github.com/neurocyte/zig-tracy/archive/303574aa9015b2c5e80e053234b3ec1d6227f0ed.tar.gz",
|
||||
.hash = "12209136682cc51f20f5a4ff2365ca1a13445688aadfc570c4684b828bf9e48d2011",
|
||||
.url = "https://github.com/neurocyte/zig-tracy/archive/58999b786089e5319dd0707f6afbfca04c6340e7.tar.gz",
|
||||
.hash = "1220a2c8f8db1b5265458ac967ea1f7cc0a8ddcd1d774df3b73d86c4f529aadbfb94",
|
||||
},
|
||||
},
|
||||
.paths = .{
|
||||
|
|
|
@ -3,14 +3,14 @@ const cbor = @import("cbor");
|
|||
const tp = @import("thespian.zig");
|
||||
|
||||
pid: ?tp.pid,
|
||||
stdin_behavior: std.ChildProcess.StdIo,
|
||||
stdin_behavior: std.process.Child.StdIo,
|
||||
|
||||
const Self = @This();
|
||||
pub const max_chunk_size = 4096 - 32;
|
||||
pub const Writer = std.io.Writer(*Self, error{Exit}, write);
|
||||
pub const BufferedWriter = std.io.BufferedWriter(max_chunk_size, Writer);
|
||||
|
||||
pub fn init(a: std.mem.Allocator, argv: tp.message, tag: [:0]const u8, stdin_behavior: std.ChildProcess.StdIo) !Self {
|
||||
pub fn init(a: std.mem.Allocator, argv: tp.message, tag: [:0]const u8, stdin_behavior: std.process.Child.StdIo) !Self {
|
||||
return .{
|
||||
.pid = try Proc.create(a, argv, tag, stdin_behavior),
|
||||
.stdin_behavior = stdin_behavior,
|
||||
|
@ -69,7 +69,7 @@ const Proc = struct {
|
|||
receiver: Receiver,
|
||||
args: std.heap.ArenaAllocator,
|
||||
parent: tp.pid,
|
||||
child: std.ChildProcess,
|
||||
child: std.process.Child,
|
||||
tag: [:0]const u8,
|
||||
stdin_buffer: std.ArrayList(u8),
|
||||
fd_stdin: ?tp.file_descriptor = null,
|
||||
|
@ -80,7 +80,7 @@ const Proc = struct {
|
|||
|
||||
const Receiver = tp.Receiver(*Proc);
|
||||
|
||||
fn create(a: std.mem.Allocator, argv: tp.message, tag: [:0]const u8, stdin_behavior: std.ChildProcess.StdIo) !tp.pid {
|
||||
fn create(a: std.mem.Allocator, argv: tp.message, tag: [:0]const u8, stdin_behavior: std.process.Child.StdIo) !tp.pid {
|
||||
const self: *Proc = try a.create(Proc);
|
||||
|
||||
var args = std.heap.ArenaAllocator.init(a);
|
||||
|
@ -97,7 +97,7 @@ const Proc = struct {
|
|||
i += 1;
|
||||
}
|
||||
|
||||
var child = std.ChildProcess.init(argv_, a);
|
||||
var child = std.process.Child.init(argv_, a);
|
||||
child.stdin_behavior = stdin_behavior;
|
||||
child.stdout_behavior = .Pipe;
|
||||
child.stderr_behavior = .Pipe;
|
||||
|
@ -250,7 +250,7 @@ const Proc = struct {
|
|||
return self.handle_term(self.child.wait() catch |e| return tp.exit_error(e));
|
||||
}
|
||||
|
||||
fn handle_term(self: *Proc, term_: std.ChildProcess.Term) tp.result {
|
||||
fn handle_term(self: *Proc, term_: std.process.Child.Term) tp.result {
|
||||
(switch (term_) {
|
||||
.Exited => |val| self.parent.send(.{ self.tag, "term", "exited", val }),
|
||||
.Signal => |val| self.parent.send(.{ self.tag, "term", "signal", val }),
|
||||
|
|
Loading…
Add table
Reference in a new issue