From f5d5359306dea53901e013ce32f974f2fee41ccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Tue, 2 Jun 2026 19:04:58 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20chore:=20tune=20build=20profiles?= =?UTF-8?q?=20and=20workspace=20deps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a fat-LTO release profile with panic=abort and symbol stripping, enable target-cpu=native plus dead-section linker flags per target, bump tokio, trim quinn to runtime-tokio, and promote rustls to the workspace dependency table. --- .cargo/config.toml | 26 +++++++++++++++++++++++++- Cargo.toml | 23 ++++++++++++++++------- 2 files changed, 41 insertions(+), 8 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index ac2b23f..5643a70 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,2 +1,26 @@ +[target.x86_64-unknown-linux-gnu] +rustflags = [ + "-C", "target-cpu=native", + "-C", "link-arg=-Wl,--gc-sections", + "-C", "link-arg=-Wl,-O2", +] + +[target.aarch64-apple-darwin] +rustflags = [ + "-C", "target-cpu=native", + "-C", "link-arg=-Wl,-dead_strip", +] + +[target.x86_64-apple-darwin] +rustflags = [ + "-C", "target-cpu=native", + "-C", "link-arg=-Wl,-dead_strip", +] + [target.x86_64-pc-windows-msvc] -rustflags = ["-C", "target-feature=+crt-static"] +rustflags = [ + "-C", "target-feature=+crt-static", + "-C", "target-cpu=native", + "-C", "link-arg=/OPT:REF", + "-C", "link-arg=/OPT:ICF" +] diff --git a/Cargo.toml b/Cargo.toml index 313df12..a57fbd7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,13 +1,22 @@ [workspace] resolver = "2" -members = [ - "crates/client", - "crates/common", - "crates/server", -] +members = ["crates/client", "crates/common", "crates/server"] + +[profile.release] +opt-level = 3 +lto = "fat" +codegen-units = 1 +panic = "abort" +strip = "symbols" +debug = false +overflow-checks = false +incremental = false [workspace.dependencies] common = { path = "crates/common" } -tokio = {version = "1.51.1", features = ["full"]} +tokio = { version = "1.52.3", features = ["full"] } bitcode = "0.6.9" -quinn = "0.11.9" +quinn = { version = "0.11.9", default-features = false, features = [ + "runtime-tokio", +] } +rustls = "0.23.40"