Bump Swift stdlib presence thresholds for Span compatibility (#2915)#1
Open
denis15yo wants to merge 1 commit intoali-fareed:telegram-4.3.3from
Open
Conversation
…ild#2915) ## Summary Swift 6.2 introduced `libswiftCompatibilitySpan.dylib`, a back-deployment compatibility library for the `Span` type that must be embedded in app bundles targeting OS versions prior to the 2025 releases (iOS 26, macOS 26, etc.). The `_MIN_OS_PLATFORM_SWIFT_PRESENCE` thresholds previously assumed all Swift dylibs were present in the OS starting at iOS 15 / macOS 12, causing `swift-stdlib-tool` to skip scanning binaries entirely for apps with higher minimum deployment targets. This meant `libswiftCompatibilitySpan.dylib` was never embedded, resulting in a launch crash: ``` Library not loaded: @rpath/libswiftCompatibilitySpan.dylib ``` This bumps all platform thresholds to 26.0 so the tool runs and embeds the compatibility dylib when needed. Based on the same internal change as bazelbuild#2909, with tests and updated comments included. ## Test plan - Built an iOS app targeting iOS 18.0 with Bazel and confirmed `libswiftCompatibilitySpan.dylib` is now embedded in the `.app` bundle - Ran `swift stdlib-tool --print --scan-folder <app>.app --platform iphoneos` and confirmed no additional libs are needed - Added `archive_contents_test` cases verifying the dylib is present for pre-26 targets and absent for post-26 targets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Please pull this important change from the main rules_apple repository
bazelbuild#2915
Summary
Swift 6.2 introduced
libswiftCompatibilitySpan.dylib, a back-deployment compatibility library for theSpantype that must be embedded in app bundles targeting OS versions prior to the 2025 releases (iOS 26, macOS 26, etc.).The
_MIN_OS_PLATFORM_SWIFT_PRESENCEthresholds previously assumed all Swift dylibs were present in the OS starting at iOS 15 / macOS 12, causingswift-stdlib-toolto skip scanning binaries entirely for apps with higher minimum deployment targets. This meantlibswiftCompatibilitySpan.dylibwas never embedded, resulting in a launch crash:This bumps all platform thresholds to 26.0 so the tool runs and embeds the compatibility dylib when needed.
Based on the same internal change as bazelbuild#2909, with tests and updated comments included.
Test plan
libswiftCompatibilitySpan.dylibis now embedded in the.appbundleswift stdlib-tool --print --scan-folder <app>.app --platform iphoneosand confirmed no additional libs are neededarchive_contents_testcases verifying the dylib is present for pre-26 targets and absent for post-26 targets