macvim-dev / macvim

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

Set up CI support for Apple Silicon #1263

Closed ychin closed 8 months ago

ychin commented 2 years ago

We should set up CI on a machine running in Apple Silicon so we can run tests on native hardware to make sure it runs. Right now we only run CI on x86 machines (since that's the only option available in GitHub-hosted runners), which builds a cross-platform universal build, but doesn't allow us to actually test that the app works in Apple Silicon. There could be a lot of reasons how the Apple Silicon build could break (e.g. if the gettext dependency got broken on the ARM side) and we should at least try to test that the app launches.

Also, currently building the cross-platform build is somewhat annoying because on x86 we have to manually grab the ARM builds of gettext and other libraries and link against them, since Homebrew will only grab the x86 versions. On Apple Silicon machines this could potentially be easier since we can use Rosetta 2 to run both x86 and ARM binaries on a single host.

Currently this is blocked by available runners GitHub provides so unless there is an easy and free way to host Apple Silicon CI runners this won't be available.

Part of #1136.

mplough commented 2 years ago

Support for GitHub-hosted M1 runners is tracked on GitHub's roadmap. Currently the feature is in beta but it's sitting way over in "future" on the roadmap, so no estimated timeline until it goes GA. See https://github.com/github/roadmap/issues/528.

ychin commented 1 year ago

They have added M1 runners but it's paid-only for now. Still debating options.

dongyuwei commented 8 months ago

https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/ M1 macos runner is available to open source project.

Can speedup by 200%~300%.

ychin commented 8 months ago

Oh nice! Thanks for letting me know. I will take a look. Seems like starting from macOS 14, GitHub Actions will exclusively use Apple Silicon only anyway so I will have to make sure to migrate the CI pipeline to support Apple Silicon.

This does mean testing and supporting Intel Macs may become harder and harder in the future, which kind of makes sense given that you can't really buy them anymore. At least we can test them under Rosetta 2 in Apple Silicon (if Apple doesn't deprecate that too…).

Just a related comment to put it here so I remember: Another thing I noticed is that GitHub published a roadmap for future deprecation (https://github.com/actions/runner-images/issues/9255). Seems like they plan to deprecate the macos-12 image by EOY 2024, which is problematic because that's the image that we rely on to build the legacy binary (targeting macOS 10.9 - 10.12) for MacVim. This could make supporting legacy builds harder next year. Probably a problem for tomorrow me 🤷.