macvim-dev / macvim

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

Set up CI to do split legacy build for macOS 10.9-10.12 #1331

Closed ychin closed 1 year ago

ychin commented 1 year ago

SDK for the new macOS 13 (released as part of Xcode 14.1) increased the minimum deployed OS from 10.9 to 10.13. Since we still want to support a minimum OS requirement of 10.9, while building against the latest SDK to get the most up-to-date features, we have to split the build process to build two separate binaries. A regular MacVim that targets the macOS 13 SDK (with min OS target 10.13), and a "legacy" MacVim that targets the macOS 12 SDK (with min OS target 10.9).

Change the GitHub Action CI config to have two separate matrix entries that publish, with one having a "legacy" flag set, which will use the older version of Xcode and the correct env vars set. It will also only build for x86-64 (no arm64) since currently all Apple Silicon hardware can run the latest versions of macOS and would have no need to run legacy builds.

Also, fix some scripting issues:

See https://github.com/macvim-dev/macvim/discussions/1288

ychin commented 1 year ago

Will probably let this sit a while until Xcode 14.1 actually comes out (currently it's only in release candidate stage).

ychin commented 1 year ago

Also see #1332 which upgrades to Sparkle 2 from Sparkle 1. Because Sparkle 2 requires macOS 10.13, we will be enabling it only in normal builds, with legacy builds still using Sparkle 1.

ychin commented 1 year ago

Ugh, a new Python version (e.g. 3.11) got released recently and just got installed to GitHub's CI runners, so it's breaking the build, but only when using 14.0 but not 14.1 (which seems to work as configure can find the correct 3.10 path, somehow). Will need to find a way to fix this.

ichizok commented 1 year ago

Current Homebrew's default python is 3.10, thus need to specify version as brew install python@3.11.

ychin commented 1 year ago

Current Homebrew's default python is 3.10, thus need to specify version as brew install python@3.11.

Actually looking more into it I think there's some issues with GitHub CI's setup. It seems to be inconsistent, so I'm guessing that they are doing a rolling upgrade of their VMs which makes it really frustrating to test. But essentially there are some VMs (see this run) that have Python 3.11 installed, but they are installed not using Homebrew, but to /Library/Frameworks instead (the default Python installation folder). Incidentally the build then hit the HAVE_DUP issue that you filed at https://github.com/vim/vim/pull/11484. Either way this seems wrong, and I'm looking into forcing the CI to use the Homebrew version for consistency (since that's the one we set the dynamic linkage to anyway), probably just need a brew link --overwrite.

ychin commented 1 year ago

This is now merged, since Xcode 14.1 is now officially out (it's the same build as Release Candidate 2). Seems like GitHub's runners are still using RC1, but I don't know of any features / fixes that we need in RC2 anyway.