Skip to content

[Dependency Scanning] Emit a detailed error diagnostic on Clang module variant discovery #81313

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
merged 1 commit into from
May 6, 2025

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented May 5, 2025

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.

@artemcm
Copy link
Contributor Author

artemcm commented May 5, 2025

@swift-ci test

Copy link
Contributor

@beccadax beccadax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I take it there are no tests because you don't know of even an artificial way to induce this condition? Fair enough.

Copy link
Contributor

@cyndyishida cyndyishida left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few nits but overall looks good & thank you!

seemingly due to differences in Clang Scanner direct by-name queries and transitive header lookup queries.

I don't know if every case can be attributed to that, for example, there is one case where we don't have a reproducer but it didn't seem like there was a search issue since the modulemaps resolve the same but still have different hashes.

…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.
@artemcm artemcm force-pushed the DepScanVariantError branch from c3dce5b to 4b26a3d Compare May 6, 2025 15:56
@artemcm
Copy link
Contributor Author

artemcm commented May 6, 2025

I take it there are no tests because you don't know of even an artificial way to induce this condition? Fair enough.

Unfortunately, yes.

@artemcm
Copy link
Contributor Author

artemcm commented May 6, 2025

@swift-ci smoke test

@artemcm artemcm merged commit 69f8a6f into swiftlang:main May 6, 2025
3 checks passed
@artemcm artemcm deleted the DepScanVariantError branch May 6, 2025 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants