Merge branch 'flub/unoptimised-debug'

https://github.com/deltachat/deltachat-core-rust/pull/3699
This commit is contained in:
link2xt
2022-11-04 13:14:35 +00:00
5 changed files with 20 additions and 1 deletions

11
.cargo/config.toml Normal file
View File

@@ -0,0 +1,11 @@
[env]
# In unoptimised builds tokio tends to use a lot of stack space when
# creating some complicated futures, tokio has an open issue for this:
# https://github.com/tokio-rs/tokio/issues/2055. Some of our tests
# manage to not fit in the default 2MiB stack anymore due to this, so
# while the issue is not resolved we want to work around this.
# Because compiling optimised builds takes a very long time we prefer
# to avoid that. Setting this environment variable ensures that when
# invoking `cargo test` threads are allowed to have a large enough
# stack size without needing to use an optimised build.
RUST_MIN_STACK = "8388608"

View File

@@ -8,6 +8,7 @@ on:
env:
CARGO_TERM_COLOR: always
RUST_MIN_STACK: "8388608"
jobs:
build_and_test:

View File

@@ -11,6 +11,9 @@ debug = 0
panic = 'abort'
opt-level = 1
[profile.test]
opt-level = 0
[profile.release]
lto = true
panic = 'abort'

View File

@@ -30,7 +30,8 @@ export async function startServer(port: number = RPC_SERVER_PORT): Promise<RpcSe
cwd: tmpDir,
env: {
RUST_LOG: process.env.RUST_LOG || "info",
DC_PORT: '' + port
DC_PORT: '' + port,
RUST_MIN_STACK: "8388608"
},
});
let shouldClose = false;

View File

@@ -10,6 +10,9 @@ envlist =
commands =
pytest -n6 --extra-info --reruns 2 --reruns-delay 5 -v -rsXx --ignored --strict-tls {posargs: tests examples}
pip wheel . -w {toxworkdir}/wheelhouse --no-deps
setenv =
# Avoid stack overflow when Rust core is built without optimizations.
RUST_MIN_STACK=8388608
passenv =
DCC_RS_DEV
DCC_RS_TARGET