Skip to content

Commit baba0b9

Browse files
committed
Fix macOS arm64 build by setting deployment target early and updating vcpkg baseline
- Add early MACOSX_DEPLOYMENT_TARGET=11.0 normalization in setup.py This runs before vcpkg invocation, ensuring all dependencies inherit the correct target. Fixes Arrow 21.0.0 compilation when vcpkg builds from source. - Update vcpkg baseline to commit with krb5 1.22.2 Previous baseline had broken krb5 1.22.1 autoreconf on macOS ARM64. Newer baseline has krb5 1.22.2 which fixes this issue. Removes need for vcpkg.json package overrides. Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
1 parent 9e2c894 commit baba0b9

3 files changed

Lines changed: 26 additions & 3 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ jobs:
273273
run: make dist-py-cibw
274274
env:
275275
CIBW_BUILD: "${{ matrix.cibuildwheel }}-macos*"
276-
CIBW_ENVIRONMENT_MACOS: CCACHE_DIR="/Users/runner/work/csp/csp/.ccache" VCPKG_DEFAULT_BINARY_CACHE="${{ env.VCPKG_DEFAULT_BINARY_CACHE }}" VCPKG_DOWNLOADS="${{ env.VCPKG_DOWNLOADS }}"
276+
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET="11.0" OSX_DEPLOYMENT_TARGET="11.0" CCACHE_DIR="/Users/runner/work/csp/csp/.ccache" VCPKG_DEFAULT_BINARY_CACHE="${{ env.VCPKG_DEFAULT_BINARY_CACHE }}" VCPKG_DOWNLOADS="${{ env.VCPKG_DOWNLOADS }}"
277277
CIBW_ARCHS_MACOS: arm64
278278
if: ${{ matrix.os == 'macos-14' }}
279279

setup.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,26 @@
88

99
from skbuild import setup
1010

11+
12+
def _parse_macos_target(value: str):
13+
try:
14+
parts = value.split(".")
15+
major = int(parts[0]) if len(parts) > 0 else 0
16+
minor = int(parts[1]) if len(parts) > 1 else 0
17+
return major, minor
18+
except Exception:
19+
return 0, 0
20+
21+
22+
if platform.system() == "Darwin":
23+
# Ensure deployment target is set before any vcpkg invocation.
24+
_deploy_target = os.environ.get("MACOSX_DEPLOYMENT_TARGET") or os.environ.get("OSX_DEPLOYMENT_TARGET", "11.0")
25+
# Apple Silicon requires macOS 11.0+.
26+
if platform.machine() == "arm64" and _parse_macos_target(_deploy_target) < (11, 0):
27+
_deploy_target = "11.0"
28+
os.environ["MACOSX_DEPLOYMENT_TARGET"] = _deploy_target
29+
os.environ["OSX_DEPLOYMENT_TARGET"] = _deploy_target
30+
1131
CSP_USE_VCPKG = os.environ.get("CSP_USE_VCPKG", "1").lower() in ("1", "on")
1232
# Allow arg to override default / env
1333
if "--csp-no-vcpkg" in sys.argv:
@@ -139,8 +159,7 @@
139159
os.environ["CMAKE_BUILD_PARALLEL_LEVEL"] = str(multiprocessing.cpu_count())
140160

141161
if platform.system() == "Darwin":
142-
os.environ["MACOSX_DEPLOYMENT_TARGET"] = os.environ.get("OSX_DEPLOYMENT_TARGET", "10.15")
143-
cmake_args.append(f"-DCMAKE_OSX_DEPLOYMENT_TARGET={os.environ.get('OSX_DEPLOYMENT_TARGET', '10.15')}")
162+
cmake_args.append(f"-DCMAKE_OSX_DEPLOYMENT_TARGET={os.environ['MACOSX_DEPLOYMENT_TARGET']}")
144163

145164
if which("ccache") and os.environ.get("CSP_USE_CCACHE", "") != "0":
146165
cmake_args.append("-DCSP_USE_CCACHE=On")

vcpkg.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@
4141
{
4242
"name": "arrow",
4343
"version": "21.0.0"
44+
},
45+
{
46+
"name": "krb5",
47+
"version": "1.21.3"
4448
}
4549
],
4650
"builtin-baseline": "b94ade01f19e4436d8c8a16a5c52e8c802ef67dd"

0 commit comments

Comments
 (0)