-
Notifications
You must be signed in to change notification settings - Fork 73
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
macOS: Create universal binaries (fat archives) #77
Comments
Depends on #74, I assume? Might ultimately want a flag to configure this, but I agree it would be good to do. |
Compiling macOS-but-other-arch from macOS is trivial - just pass |
At least on my x64 macbook pro you need to do
Before
will work. I'll definitely grant that's the most painless cross compile I've ever seen though. |
Will note there's |
Recording the fact that lipo on macos is comically easy to use I assume it also merges dsyms but haven't checked.
Unclear what the target naming scheme for such a binary should be (here I used universal-apple-darwin). |
Oh right, yes I forgot about the I'm not sure how dSYMs for universal binaries are usually handled. Having two dSYMs would make it easier to fetch the right one from a symbol server. But this section about property lists in dSYM bundles and this LLVM commit imply that you can have fat dSYMs. But I would be surprised if I don't have any input on the naming scheme for the universal binary. What you have sounds fine to me. |
Apparently the python ecosystem likes "universal2-apple-darwin" in deference to the fact that the OG ppc -> intel transition was the original "universal". I think I like that as compact but still pedantically future proof. |
Did some searching and testing and it appears that you can't invoke lipo on a dSYM but you can invoke it on the gooey binary center, at least according to this build script.
Copying one of the two dSYMs and overwriting its inner binary asset I think helps make sure you have a valid I think macos has... some weird amount of symbol magic going on so I'm having trouble figuring out an exact methodology where I don't get symbols without the dSYM but do get them with it. i.e. copying a binary to a temp dir, running |
@mstange Do you suggest cargo-dist be compiled as a universal binary or do you suggest having support inside cargo-dist that will generate CI scripts and build for this "universal" target? The former does not seem like it is worth the trouble as users would usually install it with a single-line shell installer or The latter might be useful in the future, but I feel it might create issues that are hard to debug. |
@frol markus is referring to the latter -- making universal binaries of end-user apps. This feature is also one of the biggest answers to your question in #143 (comment) (you otherwise make a reasonable point about parallelism, although each machine you spin up does have non-trivial fixed overheads so there's also an argument for Being Responsible and not needlessly spinning up more machines than you need just to reduce your build's latency). |
chore(deps): bump clap from 4.4.13 to 4.4.14
macOS supports bundling both the x86_64 and the arm64 binary into a single file using
lipo
. It would be nice to do this by default so that mac users don't have to think about their architecture when picking which file to download.The text was updated successfully, but these errors were encountered: