-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[6.2 🍒][Dependency Scanning] Emit a detailed error diagnostic on Clang module variant discovery #81337
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
base: release/6.2
Are you sure you want to change the base?
Conversation
…e variant discovery In expectation, this should never happen. Such a situation means that within the same scanning action, Clang Dependency Scanner has produced two different variants of the same module. This is not supposed to happen, but we are currently hunting down the rare cases where it does, seemingly due to differences in Clang Scanner direct by-name queries and transitive header lookup queries.
@swift-ci test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've seen multiple cases where builds complain about PCM being out of date. The root cause of these failures is mostly project configurations which take a lot of engineering time to track down. Having more detailed and explicit error messages like this helps us track down those issues more efficiently, thus I consider this to be a high value change to be cherry-picked. Additionally, this pure additive diagnostic logics are quite safe too.
@@ -618,5 +618,15 @@ ERROR(ast_format_requires_dump_ast,none, | |||
ERROR(unknown_dump_ast_format,none, | |||
"unknown format '%0' requested with '-dump-ast-format'", (StringRef)) | |||
|
|||
ERROR(dependency_scan_unexpected_variant, none, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we downgrade this from error to a warning? I suspect this would happen semi-frequently that a fatal error is probably an overkill.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should discuss more about the implication with @cyndyishida and other folks. Please hold off merging before that.
There is concern that this diagnostic may be breaking in some cases on its own.
@swift-ci test |
Thank you for downgrading to warning Artem! It's then safe enough to be merged for 6.2. |
@swift-ci test macOS platform |
Cherry-pick of #81313
Explanation: In expectation, this should never happen. Such a situation means that within the same scanning action, Clang Dependency Scanner has produced two different variants of the same module. We are currently hunting down the rare cases where it does, seemingly due to differences in Clang Scanner direct by-name queries and transitive header lookup queries and potential other causes. The code-path that this change modifies is only possible to trigger in a case that would already guarantee a build failure down-the-line.
Scope: Rare cases where dependency scanning ends up in a situation where it "discovers" two variants of the same Clang module
Risk: Low, this change affects only a code-path that would lead to a downstream build failure.
Issue: rdar://149230376
Reviewed By: @beccadax
Original PR: [Dependency Scanning] Emit a detailed error diagnostic on Clang module variant discovery #81313