Skip to content

bug: Windows stack overflow on startup (1MB default too small for Clap command graph) #855

@pszymkowiak

Description

@pszymkowiak

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingeffort-smallQuelques heures, 1 fichiergood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions