std.start: also don't print error trace targeting .other

This only matters if `callMain` is called by a user, since `std.start`
will never itself call `callMain` when `target.os.tag == .other`.
However, it *is* a valid use case for a user to call
`std.start.callMain` in their own startup logic, so this makes sense.
This commit is contained in:
mlugg 2025-09-13 18:02:57 +01:00
parent e9c0d43c5b
commit 604fb3001d
No known key found for this signature in database
GPG Key ID: 3F5B7DCCBF4AF02E

View File

@ -635,10 +635,11 @@ pub inline fn callMain() u8 {
else => {},
}
std.log.err("{s}", .{@errorName(err)});
if (native_os != .freestanding) {
if (@errorReturnTrace()) |trace| {
switch (native_os) {
.freestanding, .other => {},
else => if (@errorReturnTrace()) |trace| {
std.debug.dumpStackTrace(trace);
}
},
}
return 1;
};