Skip to content

Commit 02bad9d

Browse files
Force Apple Clang for macOS wheel builds (#18340)
A recent test-infra change (pytorch/test-infra#7848) updated `MACOSX_DEPLOYMENT_TARGET` and sets `CC=clang` / `CXX=clang++` without absolute paths. On GitHub Actions `macos-14-xlarge` runners, bare `clang` can resolve to Homebrew LLVM instead of Apple Clang. Homebrew's clang doesn't properly handle Apple SDK Objective-C framework headers, breaking the `limits.h` include chain and causing: ``` NSObjCRuntime.h: error: use of undeclared identifier 'NSIntegerMax' ``` This pins the compiler to `/usr/bin/clang` in the macOS wheel build environment to ensure Apple Clang is always used.
1 parent 2548ee1 commit 02bad9d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

.ci/scripts/wheel/envvar_macos.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,8 @@
99
# any variables so that subprocesses will see them.
1010

1111
source "${GITHUB_WORKSPACE}/${REPOSITORY}/.ci/scripts/wheel/envvar_base.sh"
12+
13+
# Force Apple Clang to avoid Homebrew LLVM, which doesn't properly handle
14+
# Apple SDK Objective-C framework headers (e.g. NSIntegerMax in NSObjCRuntime.h).
15+
export CC=/usr/bin/clang
16+
export CXX=/usr/bin/clang++

0 commit comments

Comments
 (0)