From 7d508001cfb0da8bb5dd8beffe3114b8cf6ee667 Mon Sep 17 00:00:00 2001 From: Aaron Allen Date: Fri, 10 Jul 2026 14:59:49 -0500 Subject: [PATCH] fix(i18n): give test threads a large stack so the locale-backend init fits rust-i18n's i18n! macro embeds all ~31k translations (9 locales) into one generated backend-init function. In debug builds the compiler does not reuse stack slots, so that single frame is ~1.5 MB, and coverage instrumentation inflates it several times over. The first t!() call triggers the init on a libtest worker thread, whose default 2 MB stack overflows under coverage (Linux) or the smaller effective stack (Windows), aborting the run. Release builds optimize the frame away, so only the test harness is affected. Set RUST_MIN_STACK=16 MiB via .cargo/config.toml [env] so every cargo/nextest test process (and rustc) gets ample stack regardless of platform or coverage. --- .cargo/config.toml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 00000000..bd87c721 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,9 @@ +[env] +# rust-i18n's `i18n!` macro embeds every locale (assets/locales, ~31k strings across 9 languages) +# into one generated backend-init function. In debug builds the compiler does not reuse stack slots, +# so that single function's frame is ~1.5 MB on its own, and coverage instrumentation inflates it +# several times over. The first `t!(...)` call triggers that init on a libtest worker thread, whose +# default 2 MB stack overflows under coverage (Linux) or the smaller effective stack (Windows). +# Release builds optimize the frame away, so this only affects the test harness. Give test threads +# (and rustc) a generous stack so the init fits regardless of platform or instrumentation. +RUST_MIN_STACK = { value = "16777216", force = true } -- knotmirror 0.0.1