Skip to content

Commit d9fb515

Browse files
committed
ci(macos): build pip C extensions with Apple clang
python-ldap failed to link with 'ld: library ldap_r not found': the Homebrew llvm@14 clang (on PATH for the analyzer) cannot link against the current macOS SDK's .tbd libraries. Apple's clang handles the SDK natively, so set CC/CXX to it for pip builds. The analyzer selects its binary independently of $CC, so analysis still uses clang@14. Verified locally that Apple clang links -lldap_r -llber against the SDK.
1 parent 2eecca4 commit d9fb515

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/install-deps-macos.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,12 @@ if [ -n "$GITHUB_ENV" ]; then
5656
# (breaking analyze_and_parse's gcc tests). Pin the deployment target to the
5757
# SDK version so no override (and no warning) is emitted.
5858
echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun --show-sdk-version)" >> "$GITHUB_ENV"
59+
# Build pip C extensions (e.g. python-ldap) with Apple's clang, not the
60+
# Homebrew llvm@14 clang that this script puts on PATH for the analyzer.
61+
# clang@14 cannot link against the current macOS SDK's TBD libraries
62+
# (e.g. 'ld: library ldap_r not found'), whereas Apple clang handles the
63+
# SDK natively. CodeChecker selects its analyzer binary independently of
64+
# $CC, so this does not affect which compiler is analyzed/used as analyzer.
65+
echo "CC=/usr/bin/clang" >> "$GITHUB_ENV"
66+
echo "CXX=/usr/bin/clang++" >> "$GITHUB_ENV"
5967
fi

0 commit comments

Comments
 (0)