-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[ModuleInterface] Report importing modules built from a swiftinterface without resilience #61765
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Open
xymus
wants to merge
3
commits into
swiftlang:main
Choose a base branch
from
xymus:report-non-resilient-swiftinterfaces
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
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
@swift-ci Please smoke test |
d710b5c
to
cf9e3fd
Compare
There are many tests generating swiftinterfaces without enabling library-evolution to update. |
54b7bfc
to
76cab29
Compare
@swift-ci Please smoke test |
76cab29
to
f46d841
Compare
@swift-ci Please smoke test |
e0a8081
to
132c85e
Compare
@swift-ci Please smoke test |
@swift-ci Please smoke test macOS |
…esilience Generating a swiftinterface for a module without library-evolution is not currently a recommended configuration, and it leads to a warning at building the module. We’re now considering generating more swiftinterface even without library evolution as the swiftinterface can be useful for documentation tools. However, while we can build against such a swiftinterface we shouldn’t expect the executable to work reliably. This PR adds the infrastructure necessary to detect when we’re importing a module from a swiftinterface without it having enabled library-evoluation. It is reported as an error which can be downgraded to a warning with an env var. Compiler engineers may still want a full build even if the binary is unusable. rdar://101637436
Define SWIFT_ACCEPT_NON_RESILIENT_INTERFACES in tests intentionnally building against a non-resilient swiftinterface.
132c85e
to
eb2a12b
Compare
@swift-ci Please smoke test |
artemcm
approved these changes
Dec 7, 2022
# for free
to join this conversation on GitHub.
Already have an account?
# 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.
Generating a swiftinterface for a module without library-evolution is not currently a recommended configuration, and it leads to a warning at building the module. We’re now considering generating more swiftinterfaces even without library-evolution as the swiftinterface can be useful for documentation tools. However, while we can build against such a swiftinterface we shouldn’t expect the executable to work reliably.
This PR adds the infrastructure necessary to detect when we’re importing a module from a swiftinterface without it having enabled library-evoluation. It is reported as an error which can be downgraded to a warning with an env var. Compiler engineers may still want a full build even if the binary is unusable.
rdar://101637436
The diagnostic is mostly to test the underlying information about modules built from interfaces, so there's room for improvement here. The check only catches local imports and won't report this issue on implicit or indirect imports. While it would be useful for compiler engineers to disable that check we may prefer an alternative to the env var.