Skip to content

Commit c0521ec

Browse files
committed
ci: compile-probe prf across Xcodes
1 parent fa464a5 commit c0521ec

1 file changed

Lines changed: 22 additions & 25 deletions

File tree

.github/workflows/_diag-macos.yml

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,29 @@ on:
55
branches: [ci/diag-macos]
66

77
jobs:
8-
diag:
9-
strategy:
10-
fail-fast: false
11-
matrix:
12-
runner:
13-
- blacksmith-6vcpu-macos-26
14-
- blacksmith-6vcpu-macos-latest
15-
- blacksmith-6vcpu-macos-15
16-
runs-on: ${{ matrix.runner }}
8+
prf:
9+
runs-on: blacksmith-6vcpu-macos-26
1710
timeout-minutes: 15
1811
steps:
19-
- name: probe xcode + SDK + prf symbol
12+
- name: compile-test ASAuthorization prf across installed Xcodes
2013
run: |
21-
echo "===== runner: ${{ matrix.runner }} ====="
22-
sw_vers || true
23-
echo "--- installed Xcodes ---"
24-
ls -d /Applications/Xcode*.app 2>/dev/null || echo "none"
25-
echo "--- default xcode + SDK ---"
26-
xcodebuild -version || true
27-
xcrun --sdk macosx --show-sdk-version || true
28-
echo "--- does each installed Xcode's macOS SDK expose ASAuthorization...prf? ---"
29-
for x in /Applications/Xcode*.app; do
30-
v=$("$x/Contents/Developer/usr/bin/xcodebuild" -version 2>/dev/null | head -1 | tr '\n' ' ')
31-
sdk="$x/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"
32-
hdr="$sdk/System/Library/Frameworks/AuthenticationServices.framework/Headers"
33-
sdkver=$(plutil -extract Version raw "$sdk/SDKSettings.plist" 2>/dev/null || echo "?")
34-
if grep -rqs "prf" "$hdr" 2>/dev/null; then prf="HAS prf"; else prf="NO prf"; fi
35-
echo " $x | $v | SDK $sdkver | $prf"
14+
cat > /tmp/t.m <<'EOF'
15+
#import <AuthenticationServices/AuthenticationServices.h>
16+
int main(void){
17+
ASAuthorizationSecurityKeyPublicKeyCredentialAssertion *a = nil;
18+
(void)a.prf;
19+
return 0;
20+
}
21+
EOF
22+
echo "default xcode: $(xcodebuild -version | head -1)"
23+
for x in /Applications/Xcode_26.*.app /Applications/Xcode.app; do
24+
[ -d "$x" ] || continue
25+
dev="$x/Contents/Developer"
26+
ver=$(DEVELOPER_DIR="$dev" xcodebuild -version 2>/dev/null | head -1 | tr '\n' ' ')
27+
sdk=$(DEVELOPER_DIR="$dev" xcrun --sdk macosx --show-sdk-version 2>/dev/null)
28+
if DEVELOPER_DIR="$dev" xcrun -sdk macosx clang -fsyntax-only -fobjc-arc /tmp/t.m 2>/tmp/err.txt; then
29+
echo " $x | $ver | SDK $sdk | prf COMPILES = YES"
30+
else
31+
echo " $x | $ver | SDK $sdk | prf FAILS: $(grep -m1 'error:' /tmp/err.txt | sed 's/.*error: //')"
32+
fi
3633
done

0 commit comments

Comments
 (0)