Skip to content

[5.7-04182022][SymbolGraphGen] consider modules not equal if they're not from the same compiler #58492

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

Conversation

QuietMisdreavus
Copy link
Contributor

Cherry-pick of #58421

Explanation: #41577 made it so that symbols were lifted into a module's symbol graph when their source module was re-exported via an @_exported import declaration. However, the comparison that checked this was based purely on the module's name, creating some false positives. This PR tightens that comparison to treat symbols in a foreign-type extension from being treated as part of the underlying Clang module (which is implicitly re-exported) and erroneously placed in the main module's symbol graph.

Scope: The change is isolated to SymbolGraphGen, and should only move symbols from the main symbol graph to module-extension symbol graphs.

Radar: rdar://92263972

Risk: Low. This won't affect normal compilation. There is no impact to the symbol graph data, only where it gets saved.

Testing: A new lit test, SymbolGraph/ClangImporter/ForeignExtensions.swift, has been added to verify that extensions on foreign types don't get added to the main module's symbol graph.

@QuietMisdreavus QuietMisdreavus requested a review from a team as a code owner April 28, 2022 16:45
@QuietMisdreavus
Copy link
Contributor Author

@swift-ci Please test

@QuietMisdreavus
Copy link
Contributor Author

@swift-ci Please test and merge

@swift-ci swift-ci merged commit 4baa288 into release/5.7-04182022 May 5, 2022
@swift-ci swift-ci deleted the QuietMisdreavus/5.7-04182022/module-collision branch May 5, 2022 18:46
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