Skip to content

Commit d8a11a2

Browse files
committed
Bundle swift-testing helper dylibs in CI build products
Xcode 26.4 split swift-testing's interop logic out of Testing.framework into a separate lib_TestingInterop.dylib that lives in Platforms/<plat>/Developer/usr/lib. `xcodebuild build-for-testing` embeds Testing.framework into the .app/Frameworks but leaves this sibling dylib behind, so when the test stage runs on a machine whose Xcode predates the split (e.g. macos-15 with Xcode 16.4), dyld can't locate @rpath/lib_TestingInterop.dylib and the app aborts before any test starts. Copy every lib_*.dylib next to Testing.framework after the build to restore the previous self-contained xctestproducts layout. Globbing the lib_* prefix keeps the workaround forward-compatible if Apple splits further helpers in later Xcodes.
1 parent 6c35142 commit d8a11a2

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,45 @@ 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
63+
# Testing.framework so future splits are also covered.
64+
- name: 'Workaround: Bundle swift-testing helper dylibs'
65+
run: |
66+
set -euo pipefail
67+
XCT_PRODUCTS='${{ runner.temp }}/PatronArchiver.xctestproducts'
68+
if [ '${{ matrix.platform }}' = 'macOS' ]; then
69+
plat='MacOSX.platform'
70+
cfg='Debug'
71+
app_fw='PatronArchiver.app/Contents/Frameworks'
72+
ui_fw='PatronArchiverUITests-Runner.app/Contents/Frameworks'
73+
else
74+
plat='iPhoneSimulator.platform'
75+
cfg='Debug-iphonesimulator'
76+
app_fw='PatronArchiver.app/Frameworks'
77+
ui_fw='PatronArchiverUITests-Runner.app/Frameworks'
78+
fi
79+
src_dir="$(xcode-select -p)/Platforms/$plat/Developer/usr/lib"
80+
dst_base="$XCT_PRODUCTS/Binaries/0/$cfg"
81+
82+
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"
86+
exit 0
87+
fi
88+
for dst in "$dst_base/$app_fw" "$dst_base/$ui_fw"; do
89+
[ -d "$dst" ] || continue
90+
for dylib in "${siblings[@]}"; do
91+
cp -v "$dylib" "$dst/"
92+
done
93+
done
94+
5695
- name: Archive Test Products
5796
run: >
5897
ditto -c -k --sequesterRsrc --keepParent

0 commit comments

Comments
 (0)