From 71ddcfb79e4a1f4cd6b1367a92b27fcfd5b4759b Mon Sep 17 00:00:00 2001 From: t8y2 <1156263951@qq.com> Date: Fri, 11 Sep 2026 19:52:06 +0800 Subject: [PATCH] feat(plugin-cli): tune rust template release profile for size --- plugins/examples/hello-workbench/backend/Cargo.toml | 5 +++++ plugins/sdk/cli/templates/rust/backend/Cargo.toml | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/plugins/examples/hello-workbench/backend/Cargo.toml b/plugins/examples/hello-workbench/backend/Cargo.toml index 3db2f7cfb6..84228513c5 100644 --- a/plugins/examples/hello-workbench/backend/Cargo.toml +++ b/plugins/examples/hello-workbench/backend/Cargo.toml @@ -9,3 +9,8 @@ license = "Apache-2.0" [dependencies] dbx-plugin-sdk = { path = "../../../sdk/rust/dbx-plugin-sdk" } serde_json = "1" + +[profile.release] +strip = true +lto = true +codegen-units = 1 diff --git a/plugins/sdk/cli/templates/rust/backend/Cargo.toml b/plugins/sdk/cli/templates/rust/backend/Cargo.toml index 301acb9846..c72ef08585 100644 --- a/plugins/sdk/cli/templates/rust/backend/Cargo.toml +++ b/plugins/sdk/cli/templates/rust/backend/Cargo.toml @@ -9,3 +9,11 @@ license = "Apache-2.0" [dependencies] dbx-plugin-sdk = {{RUST_SDK_DEPENDENCY}} serde_json = "1" + +# Keep plugin binaries close to the host app's size: default release settings +# leave ~20MB of symbols and unoptimized generic code in an OpenDAL-sized backend. +# panic stays "unwind" so the sidecar protocol can report panics as errors. +[profile.release] +strip = true +lto = true +codegen-units = 1