bundle.sh: cross-compile for 3 arches + use Debian container for reproducibility
This MR changes the bundle scripts to:
- Run in a Debian container, via an additional
bundle_repro.shscript. This is an additional mechanism to make the build easier to reproduce. - Cross-compile all 3 architectures that are the most common: amd64, arm64, arm. arm is only kept around since some old Raspberry Pis use it.
Having all 3 arches pre-built allows us to reuse them in other places. In particular, the Docker image builds or the Snap builds. Reusing a single central set of pre-built binaries in all those other places also makes reproducibility simpler.
Thoughts on packaging as ZIP
I decided to include all 3 binaries inside a single ZIP. This makes it easier for us maintainers to handle it:
- Only one file to upload to the packages server (instead of 6)
- Once we have signing set up: only one file to sign (instead of 3).
The downside is, that users now need to download more data. The combined ZIP is ~25 MB, compared to ~10 MB for a ZIP with a single arch.
For now, I find this tradeoff acceptable. Most people will download the releases to a server, where bandwidth is cheap (unlike for a mobile app). In the future, if the bandwidth becomes an issue for our packages server, we can split it up into 3 ZIPs.
Testing
For the latest release, I get the following results:
$ ./scripts/bundle_repro.sh v0.12.0
# it builds ...
$ cat fmd-server-v0.12.0.zip.sha256sum
a7a810b0565d8e79db483eb75342e6312599f049ce4472b83f1afaa82bc98756 fmd-server-v0.12.0.zip