Skip to content

Bump Swift stdlib presence thresholds for Span compatibility (#2915)#1

Open
denis15yo wants to merge 1 commit intoali-fareed:telegram-4.3.3from
denis15yo:bump-min-os-platform-swift-presence
Open

Bump Swift stdlib presence thresholds for Span compatibility (#2915)#1
denis15yo wants to merge 1 commit intoali-fareed:telegram-4.3.3from
denis15yo:bump-min-os-platform-swift-presence

Conversation

@denis15yo
Copy link
Copy Markdown

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 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

…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants