-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Frontend: Require -language-mode option when emitting swiftinterfaces
#84244
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
tshortli
merged 1 commit into
swiftlang:main
from
tshortli:require-swift-version-in-module-interfaces
Sep 15, 2025
Merged
Frontend: Require -language-mode option when emitting swiftinterfaces
#84244
tshortli
merged 1 commit into
swiftlang:main
from
tshortli:require-swift-version-in-module-interfaces
Sep 15, 2025
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
Contributor
Author
|
@swift-ci please test |
Contributor
Author
|
@swift-ci please test Linux |
xedin
reviewed
Sep 12, 2025
-swift-version option when emitting swiftinterfaces-language-mode option when emitting swiftinterfaces
5215551 to
e588edd
Compare
Contributor
Author
|
@swift-ci please test |
e588edd to
0ecb87e
Compare
Contributor
Author
|
@swift-ci please test |
xedin
approved these changes
Sep 12, 2025
xymus
approved these changes
Sep 12, 2025
If a `.swiftinterface` file does not include an explicit `-language-mode` option (or its predecessor `swift-version`) and needs to be built as a dependency of a client compilation, then the invocation to build the module from interface would end up inheriting the language mode that the client code is built with. This can result in spurious type checking diagnostics or even mis-compilation. To ensure that a module interface is always built using the language mode that its source code was originally built with, require an explicit `-language-mode` option when emitting swiftinterface files. Resolves rdar://145168219.
0ecb87e to
13d61b0
Compare
Contributor
Author
|
@swift-ci please test |
artemcm
approved these changes
Sep 12, 2025
tshortli
added a commit
to tshortli/swift-driver
that referenced
this pull request
Sep 12, 2025
swiftlang/swift#84244 introduces the requirement that `swift-frontend` jobs emitting a swiftinterface must explicitly specify either `-language-mode` or `-swift-version` to avoid mis-compilation of the interface. Add the necessary arguments to various tests that form their own `swift-frontend` invocations.
tshortli
added a commit
to tshortli/swift-driver
that referenced
this pull request
Sep 13, 2025
swiftlang/swift#84244 introduces the requirement that `swift-frontend` jobs emitting a swiftinterface must explicitly specify either `-language-mode` or `-swift-version` to avoid mis-compilation of the interface. Add the necessary arguments to various tests that form their own `swift-frontend` invocations.
Contributor
Author
Contributor
Author
|
swiftlang/llvm-project#11391 @swift-ci please build toolchain macOS platform |
This was referenced Sep 13, 2025
Contributor
Author
|
@swift-ci please test macOS |
tshortli
added a commit
to tshortli/swift
that referenced
this pull request
Sep 15, 2025
…uage_mode'. Downgrade the new error in swiftlang#84244 to a warning. The PR smoke test build is using a different build system that is failing to pass `-swift-version` arguments when building various stdlib modules. That needs to be fixed, but for now we also need to unblock CI.
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.
If a
.swiftinterfacefile does not include an explicit-language-modeoption (or its predecessor-swift-version) and needs to be built as a dependency of a client compilation, then the invocation to build the module from interface would end up inheriting the language mode that the client code is built with. This can result in spurious type checking diagnostics or even mis-compilation. To ensure that a module interface is always built using the language mode that its source code was originally built with, require an explicit-language-modeoption when emitting swiftinterface files.Resolves rdar://145168219.