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