[Serialization] Allow loading modules built on some SDK variants #58702
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.
When restricting loading swiftmodules to the SDK used to build them, an exception should be made for modules built against an SDK that is a subset of the SDK used when loading the module. For example, a module built with the
macOS11
SDK should be loadable by a client targeting themacOS11.secret
SDK. In such a case, the swiftmodule file is more likely to be reliable.This check is still gated behind the
ENABLE_RESTRICT_SWIFTMODULE_SDK
env var on the driver side. Loosening this check should make it easier to land it. However, this is still not a recommended configuration so we might want to remove this accepted use case in the future and bring back the requirement for an exact SDK name match.rdar://92827584