-
Notifications
You must be signed in to change notification settings - Fork 82
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
feat: Add aarch64-apple-darwin support #143
Conversation
@Gankra I was also trying to understand the reasoning behind |
Doing a quick skim before I look at this properly tomorrow morning: this seems like a reasonable minimal approach, although I had been mentally planning for this to look more like:
This would leave the CI untouched while also making local (non-CI) macos builds work better as well. It would also scale better to universal builds which need lipo (#77). Although the other platforms would however need to pull up a proper "cross-compile" core (#74). |
cargo-dist is now compiled for and also can be used to package other packages for aarch64-apple-darwin (M1/M2 chips)
da01071
to
467b7dc
Compare
Yes, this was exactly the goal of this PR, and I feel it solves the immediate pain point (#133) well without introducing complexity or diverging in a direction that will be hard to solve when a full-scale solution for cross-compilation will be developed. M1/M2 Macbooks are quite popular among developers these days, and I would either need to come up with some clever logic in the installer that would pull x86_64 binary when aarch64 artifact is missing, or I could just build my CLI for aarch64-apple-darwin; the latter turned out to be quite a straightforward thing to do. |
I'm adding this as a tentative candidate for 0.0.3 which I'm going to cut in a couple days. If I find the bandwidth to do the Ideal solution I'll opt for that. Otherwise I'll land this to help people Get Stuff Done (well, assuming the implementation works). My main concern is that the Ideal solution will restore the CI to its current state, so anyone who makes changes to their CI will have an extra round of otherwise-avoidable CI churn with this quick fix. |
@Gankra Sorry, I don't see where you are heading. The changes to CI script are minimal and the current diff is weird since the original file had a mix of CRLF line endings and now it is completely CRLF (I feel it is a separate issue to address). Change the diff view to skip the whitespace changes to see the actual change.
This is what essentially got changed, and I feel it is unavoidable unless you suggest cargo-dist should guess all the supported platforms and cross-compile to everything supported by default. |
Ugh I guess I didn't properly fix #131 :( But yes there will be some churn on CI as we refine things. There's definitely going to be a huge churn for 0.0.3 already, and that cost is already accepted. The question is after 0.0.3, when we ostensibly introduce the Ideal Solution.
It's not a big deal at all, I'm just noting the only real downside of accepting this PR. (I have been pondering making the first task actually generating the matrix so there would be no churn even for the Ideal solution but that's a bigger change and makes it harder for users to configure anything...) |
I believe the lines that setup rustup will inevitably get changed with the introduction of cross-compilation unless you want to go Zig-lang route and package cross-compilation toolkits for all the platforms or install Docker for users. I may think of some way to avoid |
We discussed this and 0.0.3 is too big already for us to be poking this feature too. I'm pushing this back to 0.0.4 which optimistically is "next week". |
I implemented my version in #172, which was indeed thankfully straight-forward with my refactor done :) This prerelease has it: https://github.com/axodotdev/cargo-dist/releases/tag/v0.0.4-prerelease.2 |
Resolves #133. cc @ashleygwilliams @Gankra
cargo-dist is now compiled for and also can be used to package other packages for aarch64-apple-darwin (M1/M2 chips)
I have tested this patch in a personal fork, here is the release: https://github.com/frol/cargo-dist/releases. Also, I have manually patched the CI scripts for my near-social CLI, and it worked like a charm (see that it now has aarch64-apple-darwin binary artifact), so I went ahead with creating this patch.
P.S. The
release.yml
file in main branch has a mix of CRLF and LF line endings. My guess is that git checks outci.yml
template with CRLF on Windows and then cargo-dist code generates some multiline strings with\n
(push_github_artifacts_matrix_entry
)