-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[5.3][ModuleInterface] Print some implementation-only imports in the private interface #32902
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
This comment has been minimized.
This comment has been minimized.
@swift-ci Please test |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
This seems okay as a workaround, but I'm a little confused about what happens when you're working with swiftmodule files instead of swiftinterfaces. Can you explain?
A swiftmodule file that has implementation-only imports and SPIs relying on the imports works because of deserialization recovery. A client can access the SPIs only if the client also imported the module behind the related implementation-only import. If the module isn't imported by the client, the SPIs fail to deserialize and are not visible. We don't want to rely on deserialization recovery for this in the long term either. |
…te interface Print implementation-only imports in the private textual interface only if also importing SPI. This allows to export types from implementation-only imports in SPI and brings the private textual interfaces in line with the binary interfaces. This is a temporary solution as we need to better design the language feature around this. This feature requires passing -experimental-spi-imports to the frontend that generates the private swiftinterface file.
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.
Thank you, @xymus !
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@swift-ci Please nominate |
Introduce an experimental feature to print implementation-only imports that include SPIs in the private swiftinterface, e.g.
@_implementationOnly @_spi(Private) import A
. This allows projects to export types from implementation-only imports in local SPI and aligns the behavior of compiling against binary interfaces with the use of private textual interfaces.This is a temporary solution behind the frontend flag
-experimental-spi-imports
.