Skip to content

Commit f9ec1bf

Browse files
committed
update macos build dependencies
1 parent bed2d1b commit f9ec1bf

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

.github/workflows/ci.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ jobs:
4242
arch: arm64
4343
timeout-minutes: 20
4444
steps:
45-
# We need to use Xcode 11.7 for maximum compatibility with older macOS (x64)
46-
- name: Switch to Xcode 11.7
45+
# We need to use Xcode 14.3 for maximum compatibility with older macOS (x64)
46+
- name: Switch to oldest available Xcode
4747
if: matrix.targetPlatform == 'macOS' && matrix.arch == 'x64'
4848
run: |
49-
sudo xcode-select -s /Applications/Xcode_11.7.app/Contents/Developer/
49+
sudo xcode-select -s /Applications/Xcode_14.3.1.app/Contents/Developer/
5050
# Delete the command line tools to make sure they don't get our builds
51-
# messed up with macOS SDK 11 stuff.
51+
# messed up with macOS SDK stuff.
5252
sudo rm -rf /Library/Developer/CommandLineTools
5353
- uses: actions/checkout@v4
5454
with:
@@ -58,6 +58,8 @@ jobs:
5858
- name: Install go
5959
if: matrix.targetPlatform == 'macOS'
6060
uses: actions/setup-go@v5
61+
with:
62+
go-version: 'stable'
6163
- name: Install dependencies
6264
run: npm install
6365
- name: Check formatting

script/build-macos.sh

+2-12
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55

66
set -eu -o pipefail
77

8-
MACOSX_BUILD_VERSION="10.9"
8+
MACOSX_BUILD_VERSION="10.15"
9+
HOST_CPU=arm64
910

1011
if [ "$TARGET_ARCH" = "x64" ]; then
11-
HOST_CPU=x86_64
1212
TARGET_CFLAGS="-target x86_64-apple-darwin"
1313
GOARCH=amd64
1414
else
15-
HOST_CPU=arm64
1615
TARGET_CFLAGS="-target arm64-apple-darwin"
1716
GOARCH=arm64
1817
fi
@@ -76,15 +75,6 @@ if [[ "$GIT_LFS_VERSION" ]]; then
7675
git clone -b "v$GIT_LFS_VERSION" "https://github.com/git-lfs/git-lfs"
7776
(
7877
cd git-lfs
79-
80-
# HACK: When cross-compiling, there seems to be an issue when git-lfs attempts
81-
# to generate the manpage contents, and it seems that preffixing that command
82-
# with `GOARCH=` to use the host architecture fixes the issue.
83-
# This hack can be removed once the issue is fixed via the PR
84-
# https://github.com/git-lfs/git-lfs/pull/4492 or some other solution.
85-
GO_GENERATE_STRING="\$(GO) generate github.com\/git-lfs\/git-lfs\/commands"
86-
sed -i -e "s/$GO_GENERATE_STRING/GOARCH= $GO_GENERATE_STRING/" Makefile
87-
8878
make GOARCH="$GOARCH" CGO_CFLAGS="-mmacosx-version-min=$MACOSX_BUILD_VERSION" CGO_LDFLAGS="-mmacosx-version-min=$MACOSX_BUILD_VERSION" BUILTIN_LD_FLAGS="-linkmode external"
8979
)
9080
GIT_LFS_BINARY_PATH="git-lfs/bin/git-lfs"

0 commit comments

Comments
 (0)