macvim-dev / macvim

Vim - the text editor - for macOS
https://macvim.org
Vim License
7.51k stars 683 forks source link

Epic: Build universal app to support Apple Silicon #1136

Open ychin opened 3 years ago

ychin commented 3 years ago

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:

ichizok commented 3 years ago

For building Vim as universal:

ref: https://github.com/ichizok/macvim/tree/build-universal https://travis-ci.com/github/ichizok/macvim/jobs/445399373

ychin commented 3 years ago

@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.

ychin commented 3 years ago

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.

ichizok commented 3 years ago

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)

ychin commented 3 years ago

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.

ychin commented 1 year ago

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