Skip to content

Commit a05a2f3

Browse files
committed
Work around Testing.framework ABI mismatch for cross-Xcode test runs
Standalone SPM test bundles (PatronArchiverKitTests) resolve @rpath frameworks via DYLD_FRAMEWORK_PATH → __SHAREDFRAMEWORKS__, which points to the local Xcode's SharedFrameworks. When the build Xcode (26) is newer than the test-runner Xcode (16.x/15.x), Testing.framework has ABI differences and dlopen fails with missing symbols. Copy all build-time frameworks from the app bundle into __TESTROOT__/ Debug/ before testing so DYLD_FRAMEWORK_PATH finds compatible copies first.
1 parent 0ad72e7 commit a05a2f3

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,24 @@ jobs:
194194
sleep 2
195195
/tmp/displaymode d || true
196196
197+
# WORKAROUND: Standalone SPM test bundles (e.g. PatronArchiverKitTests) resolve
198+
# @rpath frameworks via DYLD_FRAMEWORK_PATH → __SHAREDFRAMEWORKS__, which
199+
# points to the *local* Xcode's SharedFrameworks. When the build Xcode (26)
200+
# is newer than the test-runner Xcode (16.x/15.x), frameworks like
201+
# Testing.framework have ABI differences and dlopen fails with missing symbols.
202+
# Apple's xctestproducts embeds these frameworks inside the .app bundle but
203+
# does not make them available to standalone SPM test bundles.
204+
# Copying all build-time frameworks into __TESTROOT__/Debug/ ensures
205+
# DYLD_FRAMEWORK_PATH finds compatible copies first.
206+
# Remove this step once Apple fixes xctestproducts to properly provide
207+
# frameworks for standalone test bundles across Xcode versions.
208+
- name: 'Workaround: Provide build-time frameworks for standalone test bundles'
209+
if: matrix.platform == 'macOS'
210+
run: >
211+
cp -R
212+
'${{ runner.temp }}/PatronArchiver.xctestproducts/Binaries/0/Debug/PatronArchiver.app/Contents/Frameworks/'*
213+
'${{ runner.temp }}/PatronArchiver.xctestproducts/Binaries/0/Debug/'
214+
197215
- name: Test
198216
run: >
199217
xcodebuild test-without-building

0 commit comments

Comments
 (0)