From 1b26fc144ea95ff0924f7b7e189a8aed296d4e5c Mon Sep 17 00:00:00 2001 From: dr-frmr Date: Sat, 20 Jan 2024 20:38:16 -0300 Subject: [PATCH] add release_env with lto, codegen_units, strip --- scripts/build-release.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/build-release.py b/scripts/build-release.py index 9304b3ee..8cf94462 100755 --- a/scripts/build-release.py +++ b/scripts/build-release.py @@ -26,11 +26,15 @@ def build_and_move(feature, tmp_dir, architecture, os_name): print("=" * 50 + "\n") zip_prefix = f"kinode-{architecture}-{os_name}" + release_env = os.environ.copy() + release_env["CARGO_PROFILE_RELEASE_LTO"] = f"fat" + release_env["CARGO_PROFILE_RELEASE_CODEGEN_UNITS"] = f"1" + release_env["CARGO_PROFILE_RELEASE_STRIP"] = f"symbols" if feature: - subprocess.run(["cargo", "+nightly", "build", "--release", "--features", feature], check=True) + subprocess.run(["cargo", "+nightly", "build", "--release", "--features", feature], check=True, env=release_env) zip_name = f"{zip_prefix}-{feature}.zip" else: - subprocess.run(["cargo", "+nightly", "build", "--release"], check=True) + subprocess.run(["cargo", "+nightly", "build", "--release"], check=True, env=release_env) zip_name = f"{zip_prefix}.zip" # Move and rename the binary