forked from 1b-agent/opencadstudio-upstream
Fix two test failures affecting CI and local test runs:
1. Cross-platform test runner thread stack overflow:
In debug builds (opt-level = 0), `app.view(wid)` constructs the entire Iced UI
widget tree (ribbon, tool panels, palettes, command line, status bar).
Because libtest spawns test worker threads without setting an explicit stack
size, the default thread stack allocated by the OS (2MB on Linux glibc, 1-2MB
on Windows) overflows during recursive un-inlined view construction in
`app::automation::tests::test_pline_line_then_arc`.
- Set `[env] RUST_MIN_STACK = "8388608"` in `.cargo/config.toml` so `cargo test`
allocates 8MB per test thread across all platforms (Linux CI, macOS, Windows).
- Wrapped `test_pline_line_then_arc` in an explicit 8MB thread via
`std::thread::Builder` to guarantee immunity even when invoked without env vars.
2. Windows temporary path formatting in JSON payload:
In `app::update::page_setup_import::tests::psetupin_imports_named_setups_from_a_saved_drawing`,
interpolating `source.display()` directly into a raw JSON string resulted in
unescaped backslashes from Windows paths, causing JSON deserialization to fail.
Replaced backslashes with forward slashes to ensure cross-platform valid JSON strings.
36 lines
1.3 KiB
TOML
36 lines
1.3 KiB
TOML
# getrandom 0.3 (pulled by ahash via acadrust) needs this cfg to select its
|
|
# browser backend on wasm32-unknown-unknown, alongside its `wasm_js` feature
|
|
# (enabled in Cargo.toml for the wasm target). Without it the web build fails
|
|
# with "wasm32-unknown-unknown targets are not supported by default".
|
|
#
|
|
# `-Cstrip=none` overrides the release profile's `strip = true` for the wasm
|
|
# target only: stripping removes the `target_features` custom section, so
|
|
# `wasm-opt` can no longer see that `bulk-memory` is enabled and rejects the
|
|
# module's memory.fill/copy ops ("require bulk memory"). Native release binaries
|
|
# stay stripped; only the wasm keeps its feature section.
|
|
[target.wasm32-unknown-unknown]
|
|
rustflags = [
|
|
'--cfg',
|
|
'getrandom_backend="wasm_js"',
|
|
'-Cstrip=none',
|
|
# The debug UI build has a substantially deeper view-construction stack
|
|
# than the optimized bundle. Keep modal construction from exhausting the
|
|
# WebAssembly stack while developing with `trunk serve`.
|
|
'-Clink-arg=-zstack-size=4194304',
|
|
]
|
|
|
|
[target.x86_64-pc-windows-gnu]
|
|
rustflags = [
|
|
"-Clink-arg=-Wl,--stack,16777216",
|
|
"-Clink-arg=-Wl,--exclude-all-symbols",
|
|
]
|
|
|
|
[target.x86_64-pc-windows-msvc]
|
|
rustflags = [
|
|
"-Clink-arg=/STACK:16777216",
|
|
]
|
|
|
|
[env]
|
|
RUST_MIN_STACK = "8388608"
|
|
|