Box clap commands to avoid windows debug clap stack overflow (#4768)

The changes in https://github.com/astral-sh/uv/pull/4708 caused an
overflow in debug mode only of the 1MB default stack size in windows
during clap. This means that even trivial wrong argument tests would
fail without increasing the stack size. As remedy, we box the clap
types.
This commit is contained in:
konsti 2024-07-03 19:06:15 +02:00 committed by GitHub
parent 1c6c8db1a2
commit 37f15367bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 7 deletions

View file

@ -55,13 +55,13 @@ fn extra_name_with_clap_error(arg: &str) -> Result<ExtraName> {
#[allow(clippy::struct_excessive_bools)]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
pub command: Box<Commands>,
#[command(flatten)]
pub global_args: GlobalArgs,
pub global_args: Box<GlobalArgs>,
#[command(flatten)]
pub cache_args: CacheArgs,
pub cache_args: Box<CacheArgs>,
/// The path to a `uv.toml` file to use for configuration.
#[arg(global = true, long, env = "UV_CONFIG_FILE")]