Skip to content

refactor: split main.rs into bootstrap and tui, join workers on exit - #598

Closed
domcyrus wants to merge 1 commit into
mainfrom
refactor/bootstrap-split
Closed

refactor: split main.rs into bootstrap and tui, join workers on exit#598
domcyrus wants to merge 1 commit into
mainfrom
refactor/bootstrap-split

Conversation

@domcyrus

@domcyrus domcyrus commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Prep for a headless front-end (PR 1 of 3).

  • src/bootstrap.rs owns the generic privileged startup sequence, src/tui.rs the terminal and UI loop; main.rs is a thin dispatcher
  • App retains worker JoinHandles and stop() joins them with a 2 s deadline, so PCAP and PCAPNG exports flush on exit
  • SIGINT is handled like SIGTERM; the startup splash thread is gated behind Config
  • process_group_label moves from ui into app, removing the last ui import from the pipeline

Verified: fmt, clippy --all-targets --all-features -D warnings, cargo test --workspace (default and no-default-features), TUI smoke test via VHS on macOS, Linux build and lib tests in OrbStack.

Note: cargo --locked fails on main independently of this change (Cargo.toml pins toml = "0.9" while Cargo.lock carries 1.1.4 from #594); every cargo run re-resolves and downgrades toml. Worth a separate one-line fix.

- src/bootstrap.rs owns the generic privileged startup, src/tui.rs the terminal
- App retains worker JoinHandles and stop() joins them with a 2 s deadline
- SIGINT is handled like SIGTERM; the splash thread is gated behind Config
- process_group_label moves from ui into app
Comment thread src/bootstrap.rs
Comment on lines +474 to +475
"Failed to chown {} file '{}' to uid {}: {} (the file may not be writable after the root uid drop)",
label, path, target.uid, e
@domcyrus

domcyrus commented Sep 4, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #599 and #602. The thin-entry-point approach was incorporated into #602 alongside the reviewed lifecycle and headless fixes. Both retained PRs now pass CI.

@domcyrus domcyrus closed this Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants