asonix / release-manager

A utility to manage releasing rust programs for multiple platforms
1 stars 1 forks source link

Strip resulting binaries #2

Open asonix opened 6 years ago

asonix commented 6 years ago

Release Manager manages releases, as such, binaries can be stripped in order to reduce size. A flag can be added that says "Do not strip these binaries." I'm unsure of whether to make a single-letter flag for this, or just to leave the --no-strip option.

$ release-manager --no-strip
asonix commented 6 years ago

Stripping binaries in rust is done by calling out to the strip binary. We can infer what strip binary to use for a build by looking at the target string. For example arm-unknown-linux-gnueabihf can use arm-linux-gnueabihf-strip. It gets more difficult when dealing with the host system's architecture, since the binary won't be called host-system-triple-strip but strip. It gets even more confusing when factoring in musl builds, since they'll still use their GNU counterpart for stripping binaries (arm-unknown-linux-musleabihf targets still use arm-linux-gnueabihf-strip). We can get around this by including strip binaries in the Release.toml config file like the following:

[config.Linux.armv7h]
strip = "arm-linux-gnueabihf-strip"

Or we can default to using strip if a given target-triple-strip doesn't exist. Maybe we can have defaults that are overridden by the Release.toml. I'd accept a pull request that doesn't touch the Release.toml logic for this issue.