Skip to content

Commit 1e80ead

Browse files
committed
Set up CI to do split legacy build for macOS 10.9-10.12
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: - fix Python 2 library path set incorrectly - Update Python 3.10 to 3.11, as the new version was just released recently and needs to be updated in CI. - Update Perl to 5.30 from 5.18, as 5.18 is no longer installed in macOS 13. We could potentially change Perl to use the Homebrew version instead similar to how Python and other scripting languages are done but for now this works fine (except it won't work on older macOS versions). Perl is a rarely used language for Vim plugins. See #1288
1 parent 48f069d commit 1e80ead

File tree

1 file changed

+47
-14
lines changed

1 file changed

+47
-14
lines changed

.github/workflows/ci-macvim.yaml

Lines changed: 47 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,22 @@ concurrency:
1212
cancel-in-progress: true
1313

1414
env:
15-
MACOSX_DEPLOYMENT_TARGET: '10.9'
15+
MACOSX_DEPLOYMENT_TARGET: '10.13'
16+
MACOSX_DEPLOYMENT_TARGET_LEGACY: '10.9'
17+
18+
MACVIM_ARCHS: "x86_64 arm64" # Universal app for Intel/Apple Silicon
19+
MACVIM_ARCHS_LEGACY: "x86_64" # Legacy builds only need to build x86-64 because Apple Silicon can't run on these old OSes
1620

1721
CC: clang
1822

19-
VERSIONER_PERL_VERSION: '5.18'
23+
VERSIONER_PERL_VERSION: '5.30'
2024
VERSIONER_PYTHON_VERSION: '2.7'
2125
vi_cv_path_python: /usr/local/bin/python
2226
vi_cv_path_python3: /usr/local/bin/python3
2327
vi_cv_path_plain_lua: /usr/local/bin/lua
2428
vi_cv_path_ruby: /usr/local/opt/ruby/bin/ruby
25-
vi_cv_dll_name_perl: /System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/libperl.dylib
26-
vi_cv_dll_name_python: /usr/local/Library/Frameworks/Python.framework/Versions/2.7/Python
29+
vi_cv_dll_name_perl: /System/Library/Perl/5.30/darwin-thread-multi-2level/CORE/libperl.dylib
30+
vi_cv_dll_name_python: /usr/local/Frameworks/Python.framework/Versions/2.7/Python
2731
vi_cv_dll_name_python3: /usr/local/Frameworks/Python.framework/Versions/3.10/Python # Make sure to keep src/MacVim/vimrc synced with the Python version here for the Python DLL detection logic.
2832
vi_cv_dll_name_python3_arm64: /opt/homebrew/Frameworks/Python.framework/Versions/3.10/Python
2933
vi_cv_dll_name_ruby: /usr/local/opt/ruby/lib/libruby.dylib
@@ -40,23 +44,39 @@ jobs:
4044
# Builds and test MacVim
4145
build-and-test:
4246

43-
# Test on macOS 11.x / 12.x, and also older version of Xcode for compatibility testing.
47+
# Test on macOS 11.x / 12.x, and also older versions of Xcode for compatibility testing.
4448
strategy:
4549
fail-fast: false
4650
matrix:
4751
include:
48-
- os: macos-11
49-
publish: true
52+
# Oldest version of Xcode supported on GitHub Action to test source code backwards compatibility
5053
- os: macos-11
5154
xcode: '11.7'
55+
56+
# Older version of Xcode, and used to publish legacy builds (for macOS 10.9 - 10.12)
57+
- os: macos-12
58+
xcode: '14.0' # last version of Xcode that uses the macOS 12 SDK, which still supports deploying to macOS 10.9
59+
publish: true
60+
legacy: true
61+
publish_postfix: '_10.9'
62+
63+
# Most up to date OS and Xcode. Used to publish release for the main build.
5264
- os: macos-12
65+
xcode: '14.1'
66+
publish: true
5367

5468
runs-on: ${{ matrix.os }}
5569

5670
steps:
5771
- name: Checkout
5872
uses: actions/checkout@v3
5973

74+
- name: Set up legacy build
75+
if: matrix.legacy
76+
run: |
77+
echo "MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET_LEGACY" >> $GITHUB_ENV
78+
echo "MACVIM_ARCHS=$MACVIM_ARCHS_LEGACY" >> $GITHUB_ENV
79+
6080
# Set up, install, and cache gettext library for localization.
6181
#
6282
# Instead of using the default binary installed by Homebrew, need to build our own because gettext is statically
@@ -93,9 +113,16 @@ jobs:
93113
env:
94114
HOMEBREW_NO_AUTO_UPDATE: 1
95115
run: |
96-
brew install python
116+
brew install python3
97117
brew install ruby
98118
brew install lua
119+
120+
# CI sometimes have custom installed Python instead of using Homebrew. Forcefully re-
121+
# link Python, and then check that we are using the Homebrew version. This avoids us
122+
# using a mystery Python installation that we don't control.
123+
brew unlink python3 && brew link --overwrite python3
124+
readlink -f $vi_cv_path_python3 | grep "^$(brew --cellar python3)"
125+
99126
if [[ -d /usr/local/Cellar/perl ]]; then
100127
# We just use system perl to reduce dependencies
101128
brew unlink perl
@@ -129,7 +156,7 @@ jobs:
129156
--enable-rubyinterp=dynamic
130157
--enable-luainterp=dynamic
131158
--with-lua-prefix=/usr/local
132-
--with-macarchs="x86_64 arm64"
159+
--with-macarchs="$MACVIM_ARCHS"
133160
)
134161
else
135162
CONFOPT+=(
@@ -215,8 +242,8 @@ jobs:
215242
# Smoketest scripting languages
216243
macvim_excmd -c 'lua print("Test")'
217244
macvim_excmd -c 'perl VIM::Msg("Test")'
218-
macvim_excmd -c 'py import sys; print("Test")'
219-
macvim_excmd -c 'py3 import sys; print("Test")'
245+
macvim_excmd -c 'py print "Test"'
246+
macvim_excmd -c 'py3 print("Test")'
220247
macvim_excmd -c 'ruby puts("Test")'
221248
222249
# Check that localized messages work by printing ':version' and checking against localized word
@@ -231,8 +258,10 @@ jobs:
231258
# Make sure we are building universal x86_64 / arm64 builds and didn't accidentally create a thin app.
232259
check_arch() {
233260
local archs=($(lipo -archs "$1"))
234-
if [[ ${archs[@]} != "x86_64 arm64" ]]; then
261+
if [[ ${archs[@]} != "$MACVIM_ARCHS" ]]; then
235262
echo "Wrong arch(s) in $1: ${archs[@]}"; false
263+
else
264+
lipo -info "$1"
236265
fi
237266
}
238267
check_arch "${VIM_BIN}"
@@ -258,9 +287,13 @@ jobs:
258287
# CI environment.
259288
make -C src macvim-dmg CREATEDMG_FLAGS=--skip-jenkins
260289
290+
if ${{ matrix.publish_postfix != '' }}; then
291+
mv src/MacVim/build/Release/MacVim.dmg src/MacVim/build/Release/MacVim${{ matrix.publish_postfix }}.dmg
292+
fi
293+
261294
- name: Upload MacVim image
262295
if: startsWith(github.ref, 'refs/tags/') && matrix.publish
263296
uses: actions/upload-artifact@v3
264297
with:
265-
name: MacVim.dmg
266-
path: src/MacVim/build/Release/MacVim.dmg
298+
name: MacVim${{ matrix.publish_postfix }}.dmg
299+
path: src/MacVim/build/Release/MacVim${{ matrix.publish_postfix }}.dmg

0 commit comments

Comments
 (0)