Skip to content

[SymbolGraph] rename symbol graph files for cross-import overlays #38039

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
Jun 30, 2021

Conversation

QuietMisdreavus
Copy link
Contributor

Resolves rdar://79474927

Currently, when generating a symbol graph for a cross-import overlay, the filename is fixed based on the declaring and bystander modules. However, this pattern falls flat when the overlay module contains extensions to other modules' symbols. Since extension graphs are emitted after the main graph, but still get emitted with the same name as the base graph, this would cause the base graph's symbols to be overwritten with the extension symbols.

This PR changes how cross-import overlay modules' symbol graph file names are generated. Now, the main module's name is used all the time, but the symbols it exports are treated as "extensions" of the declaring module in terms of the file naming convention. To prevent a clash with symbols that extend the declaring module, they are merged into the main graph of the overlay.

@QuietMisdreavus
Copy link
Contributor Author

@swift-ci Please smoke test

Copy link
Contributor

@bitjammer bitjammer left a comment

Choose a reason for hiding this comment

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

Seems much clearer to me. LGTM

@QuietMisdreavus QuietMisdreavus merged commit d477efb into main Jun 30, 2021
@QuietMisdreavus QuietMisdreavus deleted the QuietMisdreavus/overlay-symbol-extensions branch June 30, 2021 20:41
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.

2 participants