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
[SR-10503] Foundation exports CoreFoundation symbols unnecessarily #3439
Comments
To give more context on this, my goal is to achieve source compatibility across Windows and Linux here, not the actual principal of the issue (where I do think that we shouldn't be exporting those symbols). |
As we discussed on the forums, Core Foundation is not a supported part of swift-corelibs-foundation's API. Historically, it is available on Linux, but not by default: as an artifact of the way the build works on that platform, it can be imported with import CoreFoundation and used, but we do not make the same API guarantees we make on Darwin for it and we strongly caution against relying on it. In general, for new platforms such as Windows where we can avoid that exposure being the case, we want to maintain the symbols and the module not available to outside code. We will not break existing Linux code that uses the above without careful consideration, but we have no announcement about this at this time. Please use Foundation API instead. |
We certainly can't change the story about getting CF symbols when importing Foundation on Darwin platforms; that would break the world... Our intent here was, though, that on other platforms the Swift-friendly Foundation API was the right stuff to export. I thought we originally did want to restrict the export of CF symbols but couldn't for some kind of technical reason. |
Parts of CF are exposed in the ABI of Foundation, no? Either in If that's not the case, you could try experimenting with the new |
(Disregard the previous content of this comment.) We do have some methods that expose CF types in swift-corelibs-foundation, but we do not reexport CF API the way |
That still counts as being public, though, since the compiler needs to know whether |
|
Additional Detail from JIRA
md5: 2cbc4011d3ce60c83948bf72d0827d91
Issue Description:
CoreFoundation is an implementation detail of Foundation and should not be re-exported from Foundation. This is the case currently on Windows, but not on Linux/macOS. We should determine the correct course here for the long term and make the platforms identical so that we do not run into cases where code can be built on one target but not another.
The text was updated successfully, but these errors were encountered: