Zig 0.15: zig build test macOS
parent
d59d754e29
commit
0112607532
|
|
@ -32,10 +32,11 @@ pub const Log = opaque {
|
||||||
comptime format: []const u8,
|
comptime format: []const u8,
|
||||||
args: anytype,
|
args: anytype,
|
||||||
) void {
|
) void {
|
||||||
const str = nosuspend std.fmt.allocPrintZ(
|
const str = nosuspend std.fmt.allocPrintSentinel(
|
||||||
alloc,
|
alloc,
|
||||||
format,
|
format,
|
||||||
args,
|
args,
|
||||||
|
0,
|
||||||
) catch return;
|
) catch return;
|
||||||
defer alloc.free(str);
|
defer alloc.free(str);
|
||||||
zig_os_log_with_type(self, typ, str.ptr);
|
zig_os_log_with_type(self, typ, str.ptr);
|
||||||
|
|
|
||||||
|
|
@ -266,8 +266,8 @@ pub const App = struct {
|
||||||
// embedded apprt.
|
// embedded apprt.
|
||||||
self.performPreAction(target, action, value);
|
self.performPreAction(target, action, value);
|
||||||
|
|
||||||
log.debug("dispatching action target={s} action={} value={}", .{
|
log.debug("dispatching action target={t} action={} value={any}", .{
|
||||||
@tagName(target),
|
target,
|
||||||
action,
|
action,
|
||||||
value,
|
value,
|
||||||
});
|
});
|
||||||
|
|
@ -1910,7 +1910,7 @@ pub const CAPI = struct {
|
||||||
};
|
};
|
||||||
|
|
||||||
return ptr.core_surface.performBindingAction(action) catch |err| {
|
return ptr.core_surface.performBindingAction(action) catch |err| {
|
||||||
log.err("error performing binding action action={} err={}", .{ action, err });
|
log.err("error performing binding action action={f} err={}", .{ action, err });
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -265,8 +265,8 @@ pub const Transport = struct {
|
||||||
const json = envelope.serialize();
|
const json = envelope.serialize();
|
||||||
defer sentry.free(@ptrCast(json.ptr));
|
defer sentry.free(@ptrCast(json.ptr));
|
||||||
var parsed: crash.Envelope = parsed: {
|
var parsed: crash.Envelope = parsed: {
|
||||||
var fbs = std.io.fixedBufferStream(json);
|
var reader: std.Io.Reader = .fixed(json);
|
||||||
break :parsed try crash.Envelope.parse(alloc, fbs.reader());
|
break :parsed try crash.Envelope.parse(alloc, &reader);
|
||||||
};
|
};
|
||||||
defer parsed.deinit();
|
defer parsed.deinit();
|
||||||
|
|
||||||
|
|
@ -298,7 +298,10 @@ pub const Transport = struct {
|
||||||
});
|
});
|
||||||
const file = try std.fs.cwd().createFile(path, .{});
|
const file = try std.fs.cwd().createFile(path, .{});
|
||||||
defer file.close();
|
defer file.close();
|
||||||
try file.writer().writeAll(json);
|
var buf: [4096]u8 = undefined;
|
||||||
|
var file_writer = file.writer(&buf);
|
||||||
|
try file_writer.interface.writeAll(json);
|
||||||
|
try file_writer.end();
|
||||||
|
|
||||||
log.warn("crash report written to disk path={s}", .{path});
|
log.warn("crash report written to disk path={s}", .{path});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1440,7 +1440,7 @@ fn execCommand(
|
||||||
// grow if necessary for a longer command (uncommon).
|
// grow if necessary for a longer command (uncommon).
|
||||||
9,
|
9,
|
||||||
);
|
);
|
||||||
defer args.deinit();
|
defer args.deinit(alloc);
|
||||||
|
|
||||||
// The reason for executing login this way is unclear. This
|
// The reason for executing login this way is unclear. This
|
||||||
// comment will attempt to explain but prepare for a truly
|
// comment will attempt to explain but prepare for a truly
|
||||||
|
|
@ -1487,40 +1487,41 @@ fn execCommand(
|
||||||
// macOS.
|
// macOS.
|
||||||
//
|
//
|
||||||
// Awesome.
|
// Awesome.
|
||||||
try args.append("/usr/bin/login");
|
try args.append(alloc, "/usr/bin/login");
|
||||||
if (hush) try args.append("-q");
|
if (hush) try args.append(alloc, "-q");
|
||||||
try args.append("-flp");
|
try args.append(alloc, "-flp");
|
||||||
try args.append(username);
|
try args.append(alloc, username);
|
||||||
|
|
||||||
switch (command) {
|
switch (command) {
|
||||||
// Direct args can be passed directly to login, since
|
// Direct args can be passed directly to login, since
|
||||||
// login uses execvp we don't need to worry about PATH
|
// login uses execvp we don't need to worry about PATH
|
||||||
// searching.
|
// searching.
|
||||||
.direct => |v| try args.appendSlice(v),
|
.direct => |v| try args.appendSlice(alloc, v),
|
||||||
|
|
||||||
.shell => |v| {
|
.shell => |v| {
|
||||||
// Use "exec" to replace the bash process with
|
// Use "exec" to replace the bash process with
|
||||||
// our intended command so we don't have a parent
|
// our intended command so we don't have a parent
|
||||||
// process hanging around.
|
// process hanging around.
|
||||||
const cmd = try std.fmt.allocPrintZ(
|
const cmd = try std.fmt.allocPrintSentinel(
|
||||||
alloc,
|
alloc,
|
||||||
"exec -l {s}",
|
"exec -l {s}",
|
||||||
.{v},
|
.{v},
|
||||||
|
0,
|
||||||
);
|
);
|
||||||
|
|
||||||
// We execute bash with "--noprofile --norc" so that it doesn't
|
// We execute bash with "--noprofile --norc" so that it doesn't
|
||||||
// load startup files so that (1) our shell integration doesn't
|
// load startup files so that (1) our shell integration doesn't
|
||||||
// break and (2) user configuration doesn't mess this process
|
// break and (2) user configuration doesn't mess this process
|
||||||
// up.
|
// up.
|
||||||
try args.append("/bin/bash");
|
try args.append(alloc, "/bin/bash");
|
||||||
try args.append("--noprofile");
|
try args.append(alloc, "--noprofile");
|
||||||
try args.append("--norc");
|
try args.append(alloc, "--norc");
|
||||||
try args.append("-c");
|
try args.append(alloc, "-c");
|
||||||
try args.append(cmd);
|
try args.append(alloc, cmd);
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
return try args.toOwnedSlice();
|
return try args.toOwnedSlice(alloc);
|
||||||
}
|
}
|
||||||
|
|
||||||
return switch (command) {
|
return switch (command) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue