-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[ClangImporter] Swift needs to pass -Xclang -fbuiltin-headers-in-system-modules
for its module maps that group cstd headers
#69707
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
[ClangImporter] Swift needs to pass -Xclang -fbuiltin-headers-in-system-modules
for its module maps that group cstd headers
#69707
Conversation
77d497b
to
1c84e4d
Compare
Indeed. Sadly that was necessary because of when this code gets built (it's before the |
I'm still testing this with swiftlang/llvm-project#7619, looks like it's not working yet. |
bb3833b
to
6b1490b
Compare
19e3772
to
1603f58
Compare
This turned out to be a bigger change, I'll clean up the PR tomorrow, I just pushed the branch to run the CI overnight. |
1603f58
to
d295ddb
Compare
The PR has changed completely since I originally looked.
b20e9cf
to
26d5cea
Compare
-Xclang -fbuiltin-headers-in-system-modules
for its module maps that group cstd headers
Running one more test in swiftlang/llvm-project#7619 and then I'll put this through CI |
6da5315
to
208c711
Compare
208c711
to
1a7352d
Compare
🤔 I only see that error in a few of the failed tests, is |
Awesome that made the "can't find file" errors all go away and the missing string one too. There's just one last "rebuilt a thing we didn't think we'd need to rebuild" error which isn't nearly so bad. I'll rerun the tests and see if it goes away. |
abff2b0
to
aea0b66
Compare
I'm suspicious of the error I'm getting from
I'm also having too much trouble trying to debug this without Windows, so I think what I'm going to do is try setting that flag in the MSVC driver/toolchain in clang for now. When I have a little breathing room, we'll either have removed that flag from Darwin and I'll have a better change at debugging how |
37add68
to
4e71c31
Compare
…tem-modules` for its module maps that group cstd headers Swift has some module maps it overlays on Linux and Windows that groups all of the C standard library headers into a single module. This doesn’t allow clang and C++ headers to layer properly with the OS/SDK modules. clang will set -fbuiltin-headers-in-system-modules as necessary for Apple SDKs, but Swift will need to pass that flag itself when required by its module maps.
4e71c31
to
94e860e
Compare
@swift-ci smoke test |
@swift-ci 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.
LGTM.
Swift has some module maps it overlays on Linux and Windows that groups all of the C standard library headers into a single module. This doesn’t allow clang and C++ headers to layer properly with the OS/SDK modules. clang will set -fbuiltin-headers-in-system-modules as necessary for Apple SDKs, but Swift will need to pass that flag itself when required by its module maps.
rdar://118361742