Feature-gate the TUI (ghostty) so turbo can be built without it
#14094
Closed
GourangaDasSamrat
started this conversation in
Ideas
Replies: 1 comment
|
No thanks! We're not going to add derivations of our builds for every one-off request. Great option here would be to fork! |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Goals
turborepo-lib(andturbo) be compiled with the TUI (--ui=tui) support left out entirely, via a Cargo feature.turborepo-ghostty→turborepo-ghostty-sys→ Zig dependency chain out of the build when that feature is off.Non-goals
turborepo-ghostty-sys's Android target support or the x86_64-android TLS issue directly — this is a separate, simpler escape hatch for platforms where that vendored build doesn't work at all yet.turborepo-ui's public API/behavior when the feature is on.Background
We're packaging
turbofor Termux (runningturbodirectly on Android, viatermux-packages) and hit a build failure onturbo2.10.1:turborepo-ghostty-sysvendors ghostty'slibghostty-vtvia azig buildshell-out, and:zig_target()(crates/turborepo-ghostty-sys/build.rs) only supportsaarch64-linux-androidandx86_64-linux-android, soarmv7-linux-androideabiandi686-linux-androidpanic with "unsupported Rust target for vendored build".x86_64-linux-android, the vendored ghostty/simdutf code needs real ELF TLS (__tls_get_addr), which Android bionic only provides at API 29+, so it fails at Termux's API 24 baseline.Full details/build logs: bump(main/turbo): 2.10.1 termux/termux-packages#31379.
We looked into just disabling the TUI at the Cargo level, since
turborepo-uiis already cleanly gated internally (#[cfg(feature = "tui")]throughoutcrates/turborepo-ui/src/lib.rs). The problem:turborepo-lib'sCargo.tomlforces the feature on unconditionally —— and its own source calls straight into TUI-only APIs with no
#[cfg]of its own (panic_handler.rs:restore_terminal_on_panic,is_tui_active/set_tui_active/set_tui_inactive;run/mod.rs:tui::terminal_big_enough(),tui::run_app(),tui::TuiSender).UISender(turborepo-ui::sender) is also gated behindtuiinternally, but is threaded structurally asOption<UISender>throughrun/mod.rs,commands/run.rs, andtask_graph/visitor/mod.rswith no non-TUI variant — so today there's no way to turn the feature off without breaking the build in several places, even though the underlying crate design already supports it.Proposal
Add a real
tuiCargo feature toturborepo-lib, forwarded throughturbo's ownCargo.toml(mirroring the existingnative-tls/rustls-tlspattern), enabled by default. When disabled:panic_handler.rs,run/mod.rsgate their TUI-only calls behind#[cfg(feature = "tui")].--ui=tui/"ui": "tui"still exists as a CLI/config option, but fails at runtime with a clear "this build of turbo was compiled without TUI support" error rather than silently not existing.UISender-related plumbing inrun/mod.rs,commands/run.rs, andtask_graph/visitor/mod.rseither gets#[cfg]-gated at each site, orUISendergains a non-TUI stub so the type stays available and the diff stays smaller — happy to go either way, whichever the team would rather maintain.Yes, happy to put together a PR for this — wanted to sanity-check the approach first since it touches a handful of files, and to confirm where the team would want the "TUI-only" vs "generic UI plumbing" line drawn for
UISenderbefore sending something up.All reactions