Skip to content

Conversation

@artemcm
Copy link
Contributor

@artemcm artemcm commented Sep 25, 2023

Cherry-pick of #68549

• Release: Swift 5.10
• Explanation: Even though ClangDiagnosticConsumer filters out clang::diag::err_module_not_found from being emitted by the Swift compiler, delegating to Swift's module-loading logic for error-handling, we must also ensure that we reset Clang's DiagnosticEngine's error count. Otherwise, if we do not, final stages of IRGen will query Clang's code-gen to finalize its Module, which Clang will not do if its internal DiagnosticEngine contains errors. This will cause Swift's IRGen to fail, even though the only error emitted was one Swift intended to suppress.
• Scope of Issue: Some projects which fail to resolve optional transitive module dependencies may fail to build with explicit modules enabled.
• Reviewed by: @tshortli
• Risk: Minimal, this change only affects the code-path which currently leads to a hard compilation failure.
• Origination: Explicit Module Build feature development.

Resolves rdar://109426243

artemcm and others added 2 commits September 25, 2023 11:46
…ngine, in addition to filtering out the "module not found" diagnostic

Even though 'ClangDiagnosticConsumer' filters out 'clang::diag::err_module_not_found' from being emitted by the Swift compiler, delegating to Swift's module-loading logic for error-handling, we must also ensure that we reset Clang's 'DiagnosticEngine''s error count. Otherwise, if we do not, final stages of IRGen will query Clang's code-gen to finalize its 'Module', which Clang will not do if its internal DiagnosticEngine contains errors. This will cause Swift's IRGen to fail, even though the only error emitted was one Swift intended to suppress.
@artemcm artemcm added 🍒 release cherry pick Flag: Release branch cherry picks swift 5.10 labels Sep 25, 2023
@artemcm artemcm requested a review from nkcsgexi September 25, 2023 18:50
@artemcm artemcm requested a review from a team as a code owner September 25, 2023 18:50
@artemcm
Copy link
Contributor Author

artemcm commented Sep 25, 2023

@swift-ci please test

@artemcm artemcm merged commit a6f0aae into swiftlang:release/5.10 Sep 26, 2023
@artemcm artemcm deleted the 510NoErrorOnMissingOptionalTranstiveDep branch September 26, 2023 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🍒 release cherry pick Flag: Release branch cherry picks swift 5.10

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants