Add rust profile release-lto
All checks were successful
Build and test / build (push) Successful in 2m39s
Build and test / check (push) Successful in 2m45s
Build and test / check-license (push) Successful in 5m32s
Build and test / test (push) Successful in 3m8s
Build and test / docs (push) Successful in 7m5s

This commit is contained in:
2025-12-15 10:08:58 +09:00
parent 47a4bccd2c
commit 1cf9273fcd
3 changed files with 15 additions and 10 deletions

View File

@@ -51,6 +51,13 @@ uuid = { version = "1.19.0", features = ["v4"] }
[target.'cfg(target_os = "linux")'.dependencies]
landlock = "0.4.4"
[build-dependencies]
anyhow = "1.0.100"
git2 = { version = "0.20.3", default-features = false }
[dev-dependencies]
regex = "1.12.2"
[features]
default = ["mysql-admutils-compatibility"]
mysql-admutils-compatibility = []
@@ -61,18 +68,12 @@ name = "muscl"
bench = false
path = "src/main.rs"
[profile.release]
[profile.release-lto]
inherits = "release"
strip = true
lto = true
codegen-units = 1
[build-dependencies]
anyhow = "1.0.100"
git2 = { version = "0.20.3", default-features = false }
[dev-dependencies]
regex = "1.12.2"
[package.metadata.deb]
name = "muscl"
priority = "optional"

View File

@@ -2,6 +2,8 @@
set -euo pipefail
declare -r RUST_PROFILE="release-lto"
if [[ "${CREATE_DEB_DEBUG:-}" == "1" ]]; then
set -x
fi
@@ -16,12 +18,12 @@ if ! command -v cargo-deb &> /dev/null; then
exit 1
fi
cargo build --release
cargo build --profile "$RUST_PROFILE"
mkdir -p assets/completions
(
PATH="./target/release:$PATH"
PATH="./target/$RUST_PROFILE:$PATH"
COMPLETE=bash muscl > assets/completions/muscl.bash
COMPLETE=zsh muscl > assets/completions/_muscl
@@ -41,6 +43,7 @@ sed -i 's/muscl/mysql-dbadm/g' assets/completions/{mysql-dbadm.bash,mysql-dbadm.
sed -i 's/muscl/mysql-useradm/g' assets/completions/{mysql-useradm.bash,mysql-useradm.fish,_mysql-useradm}
DEFAULT_CARGO_DEB_ARGS=(
--profile "$RUST_PROFILE"
--no-build
)

View File

@@ -22,6 +22,7 @@ let
pname = "${cargoToml.package.name}${pnameSuidSuffix}${pnameCraneSuffix}";
rustPlatformArgs = {
buildType = "release-lto";
buildFeatures = lib.optional suidSgidSupport "suid-sgid-mode";
cargoLock.lockFile = cargoLock;