axodotdev / axodotdev/cargo-dist

My native local dist workflow

Open
#465 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2.1k
Forks
149
Avg merge
1d 11h
Merged PRs (30d)
32

Description

I have my own messy `release.sh` scripts that I'd like to retire, but unfortunately `cargo-dist` and I live in a different world. In case you're looking for ideas what to add, here's how I build and distribute my software.

I build binaries for macOS, Windows, Debian (.deb), and Linux-MUSL. I'd like to add rpm into the mix.

1. Lack of #77 is a dealbreaker for me. Fat binaries are the expected standard on macOS, and having two versions asking for the architecture looks like software made by someone who never used macOS ("how do you do, fellow kids?" vibe). Running `lipo` is super easy, and Cargo even supports multiple `--target` args now.

2. macOS executables have to be code signed, unfortunately. Each year Apple gets more and more aggressive blocking unsigned software and telling users it's malware. I don't think cargo-dist does code signing. When building on macOS, once Xcode is set up, it's as easy as `codesign -vs "Developer Id" exe`. However, signing on GitHub is a massive pain of exporting private keys and certificates.

3. I'd rather not use GitHub's CI. I have my local machines that are faster. I associate GitHub CI with hours lost on pushing tweaks to YAML files without ability to investigate why they're failing. cargo-dist generates a complex workflow file that I can't test without pushing it live. The macOS builders don't have `MACOSX_DEPLOYMENT_TARGET` set. I'd prefer to build on the latest macOS, and target an older SDK from it.

4. I build with `-Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort` and `-Zlocation-detail=none`, and a separate `strip`, because I'm dissatisfied with sizes of executables that Rust produces by default. I don't think cargo-dist supports setting the nightly flags — these don't have `[profiles]` equivalents.

5. My Mac is ARM-based, so I cross-compile from ARM macOS to x86-64 macOS. This is generally very easy thanks to Apple shipping fat binary libraries. In pure-Rust projects it's also relatively easy to cross-compile from Mac to Linux/MUSL. If C code is involved, I use Docker (locally) with aarch64 Linux to build for both aarch64 and cross compile to x86-64 at the same time (x86 Docker images on ARM Macs are slow and crashy.)

6. I use `cargo deb` and also offer a zip/tarball with a plain executables. I do not offer `curl | sh`, since there are people who are irrationally offended by that.

Contributor guide

Open the contributing guide

Research direction

Start by comparing the author's local release.sh process with cargo-dist's generated GitHub workflow, focusing on the listed macOS, Linux, Windows, Debian, RPM, signing, nightly-flag, and cross-compilation requirements. Done would require a scoped proposal and agreed implementation boundaries; this issue does not name repository files or tests to change.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, github-actions, macos, rust
Domain
build-system, ci-cd, devops, release
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.