-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[ASTGen] Avoid including C standard libary headers in brigdging headers #65120
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
@swift-ci Please smoke test |
af2e962
to
03542e8
Compare
@swift-ci Please smoke test |
No, sadly, there is no good solution here that I can think of. We do have |
Seems that there are some width issues here |
03542e8
to
4ac9d0f
Compare
@swift-ci Please smoke test |
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.
huh, not having C headers is most unfortunate. Once we require a Swift compiler in the builder toolchain, we should be able to go back since we can use that Swift to generate the modules needed to build the compiler, no?
Alternatively, could we use the appropriate C++ headers instead? e.g #include <cstdint>
or does that trigger the same issue?
C stdlib headers are part of "Darwin"/"Glibc" clang module. If a Swift file imports a bridging headers and that has '#include' C stdlib headers, Swift compiler implicitly imports "Darwin"/"Glibc" overlay modules. That violates dependency layering. I.e. Compiler depends on Darwin overlay, Darwin overlay is created by the compiler. rdar://107957117
4ac9d0f
to
fe1eb46
Compare
@swift-ci Please smoke test |
Maybe 🤔? But since this is imported from Swift code built with host Swift compilers, I don't think we can use any C++ headers in these at this point |
Instead, use builtin types. e.g.
size_t
->unsigned long
C stdlib headers are part of
Darwin
/Glibc
clang module. If a Swift file imports a bridging headers and that has#include
C stdlib headers, Swift compiler implicitly importsDarwin
/Glibc
overlay modules. That violates dependency layering. I.e. Compiler depends on Darwin overlay, Darwin overlay is created by the compiler.rdar://107957117