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