Open ychin opened 3 years ago
For building Vim as universal:
xcrun --sdk macosx11.0 clang
(on 10.15. on 11.0 is ok to default)-arch arm64e -arch x86_64
to CFLAGS and LDFLAGSref: https://github.com/ichizok/macvim/tree/build-universal https://travis-ci.com/github/ichizok/macvim/jobs/445399373
@ichizok Yes it will work, but as I mentioned, we still need to get both ARM and x86 versions of dependencies (gettext, python, etc) on the same build machine since Vim needs to be built against them. Right now we use Homebrew to do it, but I don't think it quite has full support for doing that yet. We also need to make sure the Apple Silicon version of MacVim knows where to grab pythonthreedll
from correctly.
Actually I'm not sure if we are supposed to use arm64e
. I remember when I looked into it a few months ago, it's not really an officially supported target yet, and Apple's docs just calls for arm64
.
Also, we don't need to add to CFLAGS I think. configure
script already supports a --with-macarchs
flag to do that for us.
I didn't know --with-macarchs
... thank you.
As to arm64e, since Apple native apps and executables are built for arm64e (and x86_64) so I just thought of using it and not particular about it.
And I overlooked Sparkle is built for arm64 but not arm64e thus MacVim cannot be for arm64e now.
(Speaking of this point, using CFLAGS
is applied to MacVim.app/Contents/MacOS/Vim
and not to MacVim
so then Vim
is built for arm64e/x86_64 and MacVim
is for arm64/x86_64)
We are currently building for Apple Silicon in CI! It will build the app, but no testing support though since we don't have M1 Macs in CI yet. Testing will have to be done manually.
Ok this is bad. Merging upstream Vim changes can cause GitHub issue closure markers to trigger, which closed this issue from a completely unrelated Vim issue.
Edit: See https://github.com/orgs/community/discussions/17308
We need to get an universal app built for MacVim that will work both on Apple Silicon / M1 Macs. Currently MacVim is buildable under Apple Silicon, but the binary release is only x86 and will work in Apple Silicon under Rosetta. This is usually not a big deal but it's less efficient, and it makes it impossible to interface with native Python / Ruby / etc in plugins.
Tracking some tasks that we need to do or dependencies:
gettext
and other scripting languages./opt/homebrew/
currently the tentative folder for arm64 packages (since Homebrew is planning to only support thin binaries for now, they have to put these packages at a difference place).lipo
to stitch it together. Also, it's unclear if each CI instance builds their own non-universal app and we combine them in a later CI step, or each CI builds an universal app separately (which is annoying because then we need to cross-compile with all the dependencies available).brew install macvim
also gets Apple Silicon version.Documentation for users for how to use this, turn on/off, configure scripting languages.