-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Serialization] Soft-reject swiftmodules built against a different SDK on tagged compilers #58935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
Change the way swiftmodules built against a different SDK than their clients are rejected. This makes them silently ignored when the module can be rebuilt from their swiftinterface, instead of reporting a hard error. rdar://93257769
…lers Only production compilers should apply the per-SDK restriction on loading swiftmodules. Use the "is the compiler tagged" information over a release build to align with the other main swiftmodule loading restriction accepting only swiftmodules built by the same tag. Also use an env var SWIFT_DEBUG_FORCE_SWIFTMODULE_PER_SDK to enable testing this feature in any compilers.
6059538
to
3523adb
Compare
@swift-ci Please smoke test |
tshortli
reviewed
May 16, 2022
tshortli
approved these changes
May 16, 2022
@swift-ci Please smoke test |
1 similar comment
@swift-ci Please smoke test |
@swift-ci Please smoke test |
xymus
added a commit
to swiftlang/llvm-project
that referenced
this pull request
May 18, 2022
The Swift service validateSerializedAST now accepts the name of the client SDK to limit loading only swiftmodules built with the same SDK. This prevents loading swiftmodules built with an incompatible SDK where the context is different enough that it can lead to hard compiler crashes. In this use site, loading the swiftmodule from a binary should be safe as the SDK context will be extracted from that swiftmodule. Other imports will use regular loading path and apply the expected restriction. Swift API change: swiftlang/swift#58935
xymus
added a commit
to swiftlang/llvm-project
that referenced
this pull request
May 18, 2022
The Swift service validateSerializedAST now accepts the name of the client SDK to limit loading only swiftmodules built with the same SDK. This prevents loading swiftmodules built with an incompatible SDK where the context is different enough that it can lead to hard compiler crashes. In this use site, loading the swiftmodule from a binary should be safe as the SDK context will be extracted from that swiftmodule. Other imports will use regular loading path and apply the expected restriction. Swift API change: swiftlang/swift#58935
bnbarham
pushed a commit
to swiftlang/llvm-project
that referenced
this pull request
May 19, 2022
The Swift service validateSerializedAST now accepts the name of the client SDK to limit loading only swiftmodules built with the same SDK. This prevents loading swiftmodules built with an incompatible SDK where the context is different enough that it can lead to hard compiler crashes. In this use site, loading the swiftmodule from a binary should be safe as the SDK context will be extracted from that swiftmodule. Other imports will use regular loading path and apply the expected restriction. Swift API change: swiftlang/swift#58935
xymus
added a commit
to swiftlang/llvm-project
that referenced
this pull request
May 23, 2022
The Swift service validateSerializedAST now accepts the name of the client SDK to limit loading only swiftmodules built with the same SDK. This prevents loading swiftmodules built with an incompatible SDK where the context is different enough that it can lead to hard compiler crashes. In this use site, loading the swiftmodule from a binary should be safe as the SDK context will be extracted from that swiftmodule. Other imports will use regular loading path and apply the expected restriction. Swift API change: swiftlang/swift#58935
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.
Rework how the compiler handles swiftmodules built against a different SDK. Instead of raising an error this makes the compiler soft-reject the swiftmodule and silently rebuild from the swiftinterface (as it does with outdated modules). We still get the hard errors for modules with no swiftinterfaces as we can't rebuild them.
Also limit this check to tagged compilers only. This allows dev compilers to be more versatile for testing and production compilers to be more reliable once deployed.
rdar://93257769
Note that in practice, this feature is still turned off by default on the driver side.