-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[SymbolGraphGen] Refactor export-import logic #61049
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
Conversation
rdar://98808363 functionally reverts #58421
… extensions consider this scenario: - module A - struct BaseStruct - module B - struct BaseStruct.InnerStruct - func BaseStruct.InnerStruct.doStuff() - module C - `@_exported import B` the current export-import code effectively short-circuits if the direct parent of a symbol is from a re-exported module. however, that symbol could itself be another extension, so the check needs to recurse _first_, to catch this scenario. before this change, `BaseStruct.InnerStruct.doStuff()` would be sorted into C's main module graph, but `BaseStruct.InnerStruct` would be sorted into `C@A` instead, creating an orphan symbol.
|
@swift-ci Please test |
| @@ -0,0 +1,12 @@ | |||
| // RUN: %empty-directory(%t) | |||
| // RUN: cp -r %S/Inputs/ExportedImport/ObjcProperty.framework %t | |||
| // RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enable-objc-interop -emit-module -o %t/ObjcProperty.framework/Modules/ObjcProperty.swiftmodule/%target-swiftmodule-name -import-underlying-module -F %t -module-name ObjcProperty %S/Inputs/ExportedImport/A.swift | |||
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.
Is it worth also having a separate test for swift-symbolgraph-extract?
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.
swift-symbolgraph-extract doesn't have support for processing re-exports (#59920) so any tests i add for that will just confirm that the symbols don't exist.
Resolves rdar://98808363, fixes #60771
This PR fixes a handful of rough edges surrounding re-exported modules, extensions, and Clang symbols:
These issues primarily occur when a module re-exports Foundation, but the patterns can be recreated outside of Foundation.