From ccd4d46391c75a94337c5a22a4848e28d516fa06 Mon Sep 17 00:00:00 2001 From: Floris Bruynooghe Date: Fri, 28 Oct 2022 10:47:47 +0200 Subject: [PATCH] Do not use optimised debug builds Optimised debug builds result in an extremely slow code-build-test cycle. The reason we do this is because we have a few tests which end up overflowing the stack. This increases the stack instead. --- .cargo/config.toml | 9 +++++++++ Cargo.toml | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 000000000..34c30d13f --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,9 @@ +[env] +# In unoptimised builds tokio tends to use a lot of stack space when +# creating some complicated futures. Some of our tests manage to not +# fit in the default 2MiB stack anymore due to 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" diff --git a/Cargo.toml b/Cargo.toml index 871ad9dbb..82aa15e55 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ rust-version = "1.56" [profile.dev] debug = 0 panic = 'abort' -opt-level = 1 +opt-level = 0 [profile.release] lto = true