[5/x] Fix pre-built library evolution and testability #265
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Stack
π #266 [6/x] Update example projects to use 0.19.1
π #265 β [5/x] Fix support for Swift library evolution
π #264 [4/x] Fix configurator relative path handling
π #263 [3/x] Fix package manager integrations
π #261 [2/x] Archive supporting sources in release workflow
π #260 [1/x] Fix CLI archiving and distribution
Overview
Library Evolution
Module stability is currently broken despite enabling the
BUILD_LIBRARIES_FOR_DISTRIBUTION
build setting which prevents using an βoldβ version of Mockingbird.framework if it hasnβt been compiled for the current toolchain and Swift version. After some investigation, itβs due to a known issue since Xcode 11.2 (SR-14195):Specifically, Mockingbird returns an
XCTest.XCTestExpectation
for asynchronous testing which is ambiguous in the module interface sinceXCTest
itself exports a class namedXCTest
. To fix the issue, this PR avoids referencing XCTest symbols in the Swift module interface by bridging them from Objective-C.A side effect of the test expectation changes is that the asynchronous verification API is improved:
Testability
The release version is set to strip debug symbols which prevents testable imports of Mockingbird. This explicitly sets
COPY_PHASE_STRIP
toNO
for both Carthage and CocoaPods.Fixes #242
Test Plan
Archiving the framework with Xcode 13.0 / Swift 5.5 and compiling it against the Xcode 13.2 / Swift 5.5.2 toolchain no longer produces errors.