Closed simlay closed 9 months ago
I'm not sure how binstall does it but they have a universal binary.
cargo build --release --target=aarch64-apple-darwin && cargo build --release --target=x86_64-apple-darwin
, then use lipo
to merge them together into the universal binary. See their PR: https://github.com/cargo-bins/cargo-binstall/pull/551, which makes it look straightforward.
From the users' point of view, a universal binary would be preferrable to separate ARM and x86-64 binaries, since it would allow users to avoid some conditional logic in their build scripts / CI configuration.
My experience in GitHub Actions is that the prebuilt cargo-dignhy binary version 0.6.2 (presumably x86_64-only) works fine for macos-12 (x86_64) runners, and it runs on macos-14 (arm64) runners. However, it fails with error thread 'main' panicked at 'Failed to get the exit status line from lldb: "(lldb) command source -s 0
.
So basically, the prebuilt release cannot be used from a macos-14 runner in GitHub Actions. To work around this, I used cargo install --version 0.6.2
; the cargo install
ed version worked fine. See https://github.com/rust-random/getrandom/pull/398.
Was using
cargo-binstall
on CI with an M1 runner and it failed because the released CLI is built for intel macs. I'm not sure how binstall does it but they have a universal binary.It'd be nice if
aarch64-apple-darwin
was there as well.I might get around to doing this myself.