[SDK-132] Fix Carthage build failure with Xcode 26 / Swift 6.2 #972
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.
Problem
Carthage builds with
--use-xcframeworksfail on Xcode 26.0.1 (Swift 6.2) with the error:This issue was reported by Grammarly's iOS team who rely on Carthage for dependency management.
Root Cause
When building with Carthage's library evolution mode (
BUILD_LIBRARY_FOR_DISTRIBUTION=YES), Swift generates.swiftinterfacefiles to ensure ABI stability. The issue occurs due to:Pendingtype visibility: ThePending<Value, Failure>class is defined asinternalinswift-sdk/Internal/Pending.swiftPushTrackerProtocol(internal protocol) has methods returningPending<SendRequestValue, SendRequestError>MockPushTrackeris apublicclass that implementsPushTrackerProtocol, compiled into thehost-apptest target$NonescapableTypescompiler feature, Swift attempts to export the public API surface ofMockPushTrackerin the generated.swiftinterfacefilePendingis internal to IterableSDK, it cannot be referenced in another module's public interface, causing the build to failSolution
Make the
Pending,FailPending, andFulfillclassespublic. These classes were already designed with public methods (onSuccess,onError,onCompletion) and are de facto part of the SDK's API since they're returned by various tracking methods.Changes
Pending<Value, Failure>class publicFailPending<Value, Failure>class and its initializer publicFulfill<Value, Failure>class public (initializers were already public)Impact
Testing
Verified that the error no longer occurs in Carthage build logs from Grammarly's environment showing the
Pendingtype resolution failure.Closes SDK-132