From 8007386cbe40625eb0d97bad2a3018384c4705a3 Mon Sep 17 00:00:00 2001 From: Till Schneidereit Date: Thu, 24 Sep 2026 13:24:37 +0200 Subject: [PATCH] Speed up `just test-release` and enable panic-unwind in native builds Combined, these shave off more than 60% of build time for testing release builds, which should get our CI time to below 10 minutes again. --- Cargo.toml | 5 ++++- justfile | 10 +++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6d34f69..a43c7a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -58,9 +58,12 @@ cpp-builtins = { path = "crates/builtins/cpp-builtins" } [profile.release] lto = "thin" -panic = 'abort' strip = "symbols" +[profile.test-release] +inherits = "release" +lto = false + [profile.dev] lto = false diff --git a/justfile b/justfile index 345e4be..b6f49d2 100644 --- a/justfile +++ b/justfile @@ -35,9 +35,9 @@ build-release *TARGET: test *TARGET: cargo test --features debugmozjs --workspace {{TARGET}} -# Run all Rust tests in release mode. +# Run all Rust tests in the `test-release` profile: release optimizations without LTO. test-release *TARGET: - cargo test --release --workspace {{TARGET}} + cargo test --profile test-release --workspace {{TARGET}} # Run the starling shell with the given args. run *ARGS: @@ -143,10 +143,10 @@ test-wasm *TARGET: {{_wasm_cargo}} test --target {{WASM_TARGET}} --features debugmozjs --workspace {{TARGET}} @{{ if TARGET == "" { "just test-serve-wasm" } else { "echo 'Skipped the wasm serve end-to-end suite; run it with: just test-serve-wasm'" } }} -# Run all Rust tests in release mode. A run with no arguments also runs the wasm serve -# end-to-end suite. +# Run all Rust tests in the `test-release` profile: release optimizations without LTO. A run with +# no arguments also runs the wasm serve end-to-end suite against the full release build. test-wasm-release *TARGET: - {{_wasm_cargo}} test --target {{WASM_TARGET}} --release --workspace {{TARGET}} + {{_wasm_cargo}} test --target {{WASM_TARGET}} --profile test-release --workspace {{TARGET}} @{{ if TARGET == "" { "just test-serve-wasm-release" } else { "echo 'Skipped the wasm serve end-to-end suite; run it with: just test-serve-wasm-release'" } }} # Snapshot the component with `wasmtime wizer` and serve the result. Needs wasmtime on PATH.