Add a dist profile and a cross-build script for the CLI binaries #664

Merged ngerakines.me
targeting main from dist-profile
Merged opened by and assigned to ngerakines.me
targeting main from dist-profile

The published binaries were built with cargo's default release settings, which do no size tuning at all: no LTO, sixteen codegen units, and no strip. On aarch64-apple-darwin at 0.15.0-rc.5 that made atpxrpc 11.2 MB and atpmcp 15.1 MB.

release is left alone so a local cargo build --release stays fast, and the new dist profile carries fat LTO, a single codegen unit and symbol stripping. Across the sixteen published artifacts that is 110.4 MB down to 76.5 MB, a 31% cut; the macOS ones fall by about 40% and the linux ones by about 20%, the difference being that zig's linker was already stripping the ELF output. The matrix takes 19 minutes instead of 3.

tools/build-dist.sh builds all four binaries for all four targets on macOS, using cargo for the darwin targets and cargo-zigbuild for the linux ones, and names the output the way the homebrew tap's publish.sh expects. Verified by running --version from each artifact: natively, under Rosetta, and in debian:12 containers on both linux architectures.

Commits 0