Skip to content

Commit 9fb37ec

Browse files
committed
fix(ci): increase stack size for clap_complete recursive calls on Windows
- Increase stack size to 8MB on Windows - Set RUST_MIN_STACK to 8MB in CI test jobs Cargo test default (2MB) are insufficient for deep recursion in clap_complete::generate(). This causes stack overflow when generating shell completion scripts during tests.
1 parent 5f6a9f8 commit 9fb37ec

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

.cargo/config.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,17 @@ WORKSPACE_DIR = { value = "rolldown", relative = true }
44

55
[build]
66
rustflags = ["--cfg", "tokio_unstable"] # also update .github/workflows/ci.yml
7+
78
# fix sqlite build error on linux
89
[target.'cfg(target_os = "linux")']
910
rustflags = ["--cfg", "tokio_unstable", "-C", "link-args=-Wl,--warn-unresolved-symbols"]
1011

12+
# Increase stack size on Windows to avoid stack overflow
13+
[target.'cfg(all(windows, target_env = "msvc"))']
14+
rustflags = ["--cfg", "tokio_unstable", "-C", "link-arg=/STACK:8388608"]
15+
[target.'cfg(all(windows, target_env = "gnu"))']
16+
rustflags = ["--cfg", "tokio_unstable", "-C", "link-arg=-Wl,--stack,8388608"]
17+
1118
[unstable]
1219
bindeps = true
1320

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ jobs:
109109
# Test all crates/* packages. New crates are automatically included.
110110
# Also test vite-plus-cli (lives outside crates/) to catch type sync issues.
111111
- run: cargo test $(for d in crates/*/; do echo -n "-p $(basename $d) "; done) -p vite-plus-cli
112+
env:
113+
RUST_MIN_STACK: 8388608
112114

113115
lint:
114116
needs: detect-changes
@@ -399,6 +401,8 @@ jobs:
399401
git diff
400402
exit 1
401403
fi
404+
env:
405+
RUST_MIN_STACK: 8388608
402406

403407
# Upgrade tests (merged from separate job to avoid duplicate build)
404408
- name: Test upgrade (bash)

0 commit comments

Comments
 (0)