add release_env with lto, codegen_units, strip

This commit is contained in:
dr-frmr 2024-01-20 20:38:16 -03:00
parent ca6db9d0bf
commit 1b26fc144e
No known key found for this signature in database

View File

@ -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