diff options
| author | divens <divens@users.noreply.github.com> | 2026-03-12 16:54:27 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-12 16:54:27 +0100 |
| commit | 15571f8083a3b7da23e60d4be65e855b32a85d65 (patch) | |
| tree | 398892cd6a8e56edaba0f0e1e934e4802cf4dd5e /src | |
| parent | fix: pass NotificationEnd to KeybindPipe to prevent 1s timeout (#4638) (diff) | |
| download | sl0ppij-15571f8083a3b7da23e60d4be65e855b32a85d65.tar.gz sl0ppij-15571f8083a3b7da23e60d4be65e855b32a85d65.tar.xz sl0ppij-15571f8083a3b7da23e60d4be65e855b32a85d65.zip | |
Fix debug-mode stack overflow on Windows (#4843)
* Fix debug-mode stack overflow on Windows
The clap-derived augment_subcommands for CliAction (~70 variants)
produces a >1 MB stack frame in debug mode, overflowing the Windows
default 1 MB main-thread stack. Increase it to 8 MB via linker flag
to match Linux. Only applies to debug builds; release optimizes the
frame down and doesn't need it.
* move file and include dev-opt
---------
Co-authored-by: divens <divens.dev@gmail.com>
Co-authored-by: Aram Drevekenin <aram@poor.dev>
Diffstat (limited to 'src')
| -rw-r--r-- | src/build.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/build.rs b/src/build.rs new file mode 100644 index 00000000..2fc98c57 --- /dev/null +++ b/src/build.rs @@ -0,0 +1,9 @@ +fn main() { + // The clap-derived `augment_subcommands` for `CliAction` (~70 variants) + // produces a >1 MB stack frame in debug mode, overflowing the Windows + // default 1 MB main-thread stack. Increase it to 8 MB to match Linux. + // Release builds optimize the frame down, so this is only needed for non-release profiles. + if cfg!(target_os = "windows") && std::env::var("PROFILE").unwrap_or_default() != "release" { + println!("cargo:rustc-link-arg=/STACK:8388608"); + } +} |
