diff --git a/CHANGELOG.md b/CHANGELOG.md index 674e46e..88412a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # `cargo-aur` Changelog +## Unreleased + +#### Changed + +- Run `strip` on the release binary before `tar`ring it. + ## 1.1.1 (2020-08-11) #### Fixed diff --git a/src/main.rs b/src/main.rs index e289036..6573564 100644 --- a/src/main.rs +++ b/src/main.rs @@ -154,6 +154,7 @@ fn tarball(musl: bool, package: &Package) -> anyhow::Result<()> { format!("target/release/{}", package.name) }; + strip(&binary)?; fs::copy(binary, &package.name)?; Command::new("tar") .arg("czf") @@ -165,6 +166,13 @@ fn tarball(musl: bool, package: &Package) -> anyhow::Result<()> { Ok(()) } +/// Strip the release binary, so that we aren't compressing more bytes than we +/// need to. +fn strip(path: &str) -> anyhow::Result<()> { + Command::new("strip").arg(path).status()?; + Ok(()) +} + fn sha256sum(package: &Package) -> anyhow::Result { let bytes = fs::read(package.tarball())?; let digest = Hash::hash(&bytes);