From 52e6a1925338f2db254c980e749140bb9bfa77f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Mon, 4 May 2026 18:00:46 +0200 Subject: [PATCH] kata-deploy: size-optimise the release profile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apply per-package release-profile overrides for the kata-deploy crate only: opt-level = "z" # optimise for size, not speed codegen-units = 1 # let LLVM see the whole crate when inlining The binary is throwaway: it runs once at DaemonSet pod start, finishes the install in seconds, and then sits idle waiting for SIGTERM. There is no hot path to optimise for speed, so trading a bit of compile time and a few percent of CPU for a meaningfully smaller text segment is the right call here. These overrides live at the workspace root and are scoped via [profile.release.package."kata-deploy"], so they do not affect the agent, runtime-rs, dragonball, or any of the libs / tools crates. Fixes: https://github.com/kata-containers/kata-containers/discussions/12976 Signed-off-by: Fabiano FidĂȘncio Assisted-by: Cursor --- Cargo.toml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 95a041c2e7..5499c77fdd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -199,3 +199,13 @@ tracing-subscriber = "0.3.20" ttrpc = "0.8.4" url = "2.5.4" which = "4.3.0" + +# Per-package release profile overrides for kata-deploy. The kata-deploy +# binary runs once at pod start and then idles waiting for SIGTERM, so we +# size-optimise it (opt-level = "z") and keep codegen-units = 1 to give +# the optimiser the whole picture. These overrides only affect the +# kata-deploy crate; agent / runtime-rs / dragonball compile with their +# usual defaults. +[profile.release.package."kata-deploy"] +opt-level = "z" +codegen-units = 1