| ... | @@ -340,9 +340,10 @@ pub fn main() !void { | ... | @@ -340,9 +340,10 @@ pub fn main() !void { |
| 340 | } | 340 | } |
| 341 | } | 341 | } |
| 342 | | 342 | |
| 343 | if (webui_listen != null and watch) fatal( | 343 | if (webui_listen != null) { |
| 344 | \\the build system does not yet support combining '--webui' and '--watch'; consider omitting '--watch' in favour of the web UI "Rebuild" button | 344 | if (watch) fatal("using '--webui' and '--watch' together is not yet supported; consider omitting '--watch' in favour of the web UI \"Rebuild\" button", .{}); |
| 345 | , .{}); | 345 | if (builtin.single_threaded) fatal("'--webui' is not yet supported on single-threaded hosts", .{}); |
| | 346 | } |
| 346 | | 347 | |
| 347 | const stderr: std.fs.File = .stderr(); | 348 | const stderr: std.fs.File = .stderr(); |
| 348 | const ttyconf = get_tty_conf(color, stderr); | 349 | const ttyconf = get_tty_conf(color, stderr); |
| ... | @@ -449,16 +450,19 @@ pub fn main() !void { | ... | @@ -449,16 +450,19 @@ pub fn main() !void { |
| 449 | try run.thread_pool.init(thread_pool_options); | 450 | try run.thread_pool.init(thread_pool_options); |
| 450 | defer run.thread_pool.deinit(); | 451 | defer run.thread_pool.deinit(); |
| 451 | | 452 | |
| 452 | run.web_server = if (webui_listen) |listen_address| .init(.{ | 453 | run.web_server = if (webui_listen) |listen_address| ws: { |
| 453 | .gpa = gpa, | 454 | if (builtin.single_threaded) unreachable; // `fatal` above |
| 454 | .thread_pool = &run.thread_pool, | 455 | break :ws .init(.{ |
| 455 | .graph = &graph, | 456 | .gpa = gpa, |
| 456 | .all_steps = run.step_stack.keys(), | 457 | .thread_pool = &run.thread_pool, |
| 457 | .ttyconf = run.ttyconf, | 458 | .graph = &graph, |
| 458 | .root_prog_node = main_progress_node, | 459 | .all_steps = run.step_stack.keys(), |
| 459 | .watch = watch, | 460 | .ttyconf = run.ttyconf, |
| 460 | .listen_address = listen_address, | 461 | .root_prog_node = main_progress_node, |
| 461 | }) else null; | 462 | .watch = watch, |
| | 463 | .listen_address = listen_address, |
| | 464 | }); |
| | 465 | } else null; |
| 462 | | 466 | |
| 463 | if (run.web_server) |*ws| { | 467 | if (run.web_server) |*ws| { |
| 464 | ws.start() catch |err| fatal("failed to start web server: {s}", .{@errorName(err)}); | 468 | ws.start() catch |err| fatal("failed to start web server: {s}", .{@errorName(err)}); |
| ... | @@ -562,7 +566,7 @@ const Run = struct { | ... | @@ -562,7 +566,7 @@ const Run = struct { |
| 562 | max_rss_mutex: std.Thread.Mutex, | 566 | max_rss_mutex: std.Thread.Mutex, |
| 563 | skip_oom_steps: bool, | 567 | skip_oom_steps: bool, |
| 564 | watch: bool, | 568 | watch: bool, |
| 565 | web_server: ?WebServer, | 569 | web_server: if (!builtin.single_threaded) ?WebServer else ?noreturn, |
| 566 | /// Allocated into `gpa`. | 570 | /// Allocated into `gpa`. |
| 567 | memory_blocked_steps: std.ArrayListUnmanaged(*Step), | 571 | memory_blocked_steps: std.ArrayListUnmanaged(*Step), |
| 568 | /// Allocated into `gpa`. | 572 | /// Allocated into `gpa`. |