-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
My native local dist workflow #465
Comments
All of this is super reasonable, yeah. Just quickly giving my immediate thoughts on each point: 1 - universal buildsI agree #77 is conceptually easy to add, and can increase it's priority. cargo-dist is actually perfectly happy to cross macos, and this should work on either mac platform:
In earlier versions we actually defaulted to provisioning only one machine for macos and doing that, in anticipation of universal builds, but no one seemed to really need them with fetching installers handling it for you, and it sucked that it doubled the latency of releases and reduced fault-tolerance. You can however restore the previous behaviour with 2. macOS code signingYep, the macOS side of #21 is something I'd love to have an implementation for. This month we put a bunch of energy into the Windows side of it (which it turns out is a huge mess that got way messier in june), and I agree that "signing in the cloud" is painfully more complex than "singing on your local machine". I expect macOS signing will be a lot simpler, as you say. 3a. I want to run locallySo right up top I'll say "big agree". Here's some notes on how cargo-dist tries to deal with that: I agree the CI is daunting but that's because we keep adding UX improvements to it that are unrelated to the core functionality. The ultimate ethos of cargo-dist is that every machine is just "install cargo-dist, run cargo-dist exactly once, do the thing the machine-readable manifest it output says to do". The core behaviour that the CI is trying to run is just this:
This is intentionally designed to be runnable locally with identical results for debugging on your own machines or even using in your own custom infra. The biggest caveat is #236, as well as more infra-y tasks like "upload the results to github" or "push to a homebrew tap". A big focus of this coming month is going to be getting infra backends to N = 2 to break all these assumptions.
3b. GitHub has to be live, is brittleThis is also one of my biggest pain-points, and was actually a big focus of the v0.3.0 release we just shipped! By default we now run the "plan" step on all your PRs (and we made We also have a new 4. extra build flags / not in profileYeah this stuff is really annoying. On the one hand I can totally just add a config for "extra flags". On the other hand I'm tempted to try to see if encouraging people to use .cargo/config.toml is a better solution. In the past my attempts to have "non-standard" compiler setting config has resulted in more confusion than aide (i tried an alternative to rust-toolchain.toml, did not work out). 5. Interesting Notes On CrossingNot 100% sure if I have anything salient to say on this, but thanks for the info! 6. deb support100% happy to add an integration for that, do you have any interesting requirements/configuration or do you do "the default thing" for |
Thank you for your consideration. Regarding cargo deb — most of it can be configured via One exception is that I use different Cargo features on different platforms. When building for Debian, I need to link sys crates dynamically, and macOS/Windows/MUSL need static. |
I have my own messy
release.sh
scripts that I'd like to retire, but unfortunatelycargo-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.
Lack of macOS: Create universal binaries (fat archives) #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.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.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.I build with
-Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort
and-Zlocation-detail=none
, and a separatestrip
, 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.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.)
I use
cargo deb
and also offer a zip/tarball with a plain executables. I do not offercurl | sh
, since there are people who are irrationally offended by that.The text was updated successfully, but these errors were encountered: