Skip to content

Commit 9f500be

Browse files
committed
Also bundle swift-testing _Testing_*.framework helpers in CI
Xcode 26.4 split swift-testing further than first observed: in addition to lib_TestingInterop.dylib, helpers like _Testing_Foundation.framework now live under Platforms/<plat>/Developer/Library/Frameworks. libXCTestSwiftSupport links against them via @rpath, so test runs on Xcode 16.4 machines (macos-15 runner) still abort with "Library not loaded: _Testing_Foundation.framework" even after the previous dylib fix. Extend the post-build copy step to also bundle every sibling _Testing_*.framework next to the embedded Testing.framework. The prefix glob keeps the workaround forward-compatible if Apple adds more helpers later.
1 parent d8a11a2 commit 9f500be

1 file changed

Lines changed: 19 additions & 14 deletions

File tree

.github/workflows/ci.yml

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,17 @@ jobs:
5353
-testProductsPath '${{ runner.temp }}/PatronArchiver.xctestproducts'
5454
CODE_SIGNING_ALLOWED=NO
5555
56-
# WORKAROUND: Xcode 26.4+ split swift-testing's interop into a
57-
# separate lib_TestingInterop.dylib, but `xcodebuild
58-
# build-for-testing` only embeds Testing.framework itself in
59-
# .app/Frameworks — the sibling dylib (in
60-
# Platforms/.../Developer/usr/lib) is left out, so dyld aborts the
61-
# app on test machines whose Xcode toolchain predates the split.
62-
# Copy every lib_*.dylib sibling alongside the embedded
56+
# WORKAROUND: Xcode 26.4+ split swift-testing into multiple
57+
# components alongside Testing.framework — lib_TestingInterop.dylib
58+
# under Developer/usr/lib and _Testing_*.framework helpers under
59+
# Developer/Library/Frameworks. `xcodebuild build-for-testing`
60+
# only embeds Testing.framework itself in .app/Frameworks, so when
61+
# the test stage runs on a machine whose Xcode toolchain predates
62+
# the split, dyld can't resolve these helpers and the app aborts
63+
# before any test starts. Copy every lib_*.dylib and
64+
# _Testing_*.framework sibling alongside the embedded
6365
# Testing.framework so future splits are also covered.
64-
- name: 'Workaround: Bundle swift-testing helper dylibs'
66+
- name: 'Workaround: Bundle swift-testing helper components'
6567
run: |
6668
set -euo pipefail
6769
XCT_PRODUCTS='${{ runner.temp }}/PatronArchiver.xctestproducts'
@@ -76,19 +78,22 @@ jobs:
7678
app_fw='PatronArchiver.app/Frameworks'
7779
ui_fw='PatronArchiverUITests-Runner.app/Frameworks'
7880
fi
79-
src_dir="$(xcode-select -p)/Platforms/$plat/Developer/usr/lib"
81+
dev="$(xcode-select -p)/Platforms/$plat/Developer"
8082
dst_base="$XCT_PRODUCTS/Binaries/0/$cfg"
8183
8284
shopt -s nullglob
83-
siblings=("$src_dir"/lib_*.dylib)
84-
if [ ${#siblings[@]} -eq 0 ]; then
85-
echo "::notice::No lib_*.dylib found in $src_dir; nothing to bundle"
85+
dylibs=("$dev/usr/lib"/lib_*.dylib)
86+
subframeworks=("$dev/Library/Frameworks"/_Testing_*.framework)
87+
88+
if [ ${#dylibs[@]} -eq 0 ] && [ ${#subframeworks[@]} -eq 0 ]; then
89+
echo "::notice::No swift-testing helpers found under $dev"
8690
exit 0
8791
fi
92+
8893
for dst in "$dst_base/$app_fw" "$dst_base/$ui_fw"; do
8994
[ -d "$dst" ] || continue
90-
for dylib in "${siblings[@]}"; do
91-
cp -v "$dylib" "$dst/"
95+
for src in "${dylibs[@]}" "${subframeworks[@]}"; do
96+
cp -Rv "$src" "$dst/"
9297
done
9398
done
9499

0 commit comments

Comments
 (0)