Problem
On Windows, the default main-thread stack is 1MB. RTK's large Commands enum (70+ commands via Clap) can exceed this during startup, causing a stack overflow crash on rtk.exe --version or rtk.exe --help.
macOS/Linux default to 8MB stack so this doesn't affect them.
Fix
Add to build.rs:
#[cfg(windows)]
{
println!("cargo:rustc-link-arg=/STACK:8388608"); // 8MB
}
Origin
Identified by @timeshift92 in PR #771 (Copilot PR, closed as duplicate — but this fix is valuable).
References