mirror of
https://github.com/oven-sh/bun
synced 2026-02-12 11:59:00 +00:00
* just kernel32 things * more * Update linux_c.zig * Update windows_c.zig * Add workaround Workaround https://github.com/ziglang/zig/issues/16980 * Rename http.zig to bun_dev_http_server.zig * Rename usages * more * more * more * thanks tigerbeetle * Rename `JSC.Node.Syscall` -> `bun.sys` * more * woops * more! * hmm * it says there are only 37 errors, but that's not true * populate argv * it says 32 errors! * 24 errors * fix regular build * 12 left! * Still 12 left! * more * 2 errors left... * 1 more error * Add link to Tigerbeetle * Fix the remainign error * Fix test timeout * Update syscall.zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
49 lines
1.5 KiB
Zig
49 lines
1.5 KiB
Zig
const std = @import("std");
|
|
|
|
const panicky = @import("./panic_handler.zig");
|
|
const MainPanicHandler = panicky.NewPanicHandler(std.builtin.default_panic);
|
|
|
|
pub const io_mode = .blocking;
|
|
|
|
pub fn panic(msg: []const u8, error_return_trace: ?*std.builtin.StackTrace, addr: ?usize) noreturn {
|
|
MainPanicHandler.handle_panic(msg, error_return_trace, addr);
|
|
}
|
|
|
|
const CrashReporter = @import("./crash_reporter.zig");
|
|
|
|
pub fn main() void {
|
|
const bun = @import("root").bun;
|
|
const Output = bun.Output;
|
|
const Environment = bun.Environment;
|
|
if (comptime Environment.isWindows) {
|
|
bun.win32.populateArgv();
|
|
}
|
|
|
|
if (comptime Environment.isRelease)
|
|
CrashReporter.start() catch unreachable;
|
|
|
|
bun.start_time = std.time.nanoTimestamp();
|
|
|
|
// The memory allocator makes a massive difference.
|
|
// std.heap.raw_c_allocator and default_allocator perform similarly.
|
|
// std.heap.GeneralPurposeAllocator makes this about 3x _slower_ than esbuild.
|
|
// var root_alloc = @import("root").bun.ArenaAllocator.init(std.heap.raw_c_allocator);
|
|
// var root_alloc_ = &root_alloc.allocator;
|
|
|
|
var stdout = std.io.getStdOut();
|
|
// var stdout = std.io.bufferedWriter(stdout_file.writer());
|
|
var stderr = std.io.getStdErr();
|
|
var output_source = Output.Source.init(stdout, stderr);
|
|
|
|
Output.Source.set(&output_source);
|
|
defer Output.flush();
|
|
|
|
bun.CLI.Cli.start(bun.default_allocator, stdout, stderr, MainPanicHandler);
|
|
}
|
|
|
|
test "panic" {
|
|
panic("woah", null);
|
|
}
|
|
|
|
pub const build_options = @import("build_options");
|