-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Fix two issues with the SwiftGlibc module map #32404
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
c8628af
to
a0ec0fd
Compare
@swift-ci Please test |
Build failed |
Build failed |
@swift-ci Please test OS X |
A fix for the broken test on Linux is in progress at #32465. |
Build failed |
This is failing with what looks like an unrelated error:
|
4f063e6
to
6754c9c
Compare
@swift-ci please smoke test. |
e177654
to
fb34283
Compare
@swift-ci please smoke test linux platform. |
(This comment is just so I remember what needs to be done.) To get the Linux build green we need to remove the |
@swift-ci please smoke test linux platform. |
@scentini see my above comment. We're going to need to update those three files to get the Linux build working. |
@zoecarver we are looking into fixing @_implementationOnly instead, see SR-13785. |
Oh, great. That's the better way to fix this :) |
fb34283
to
968f335
Compare
@swift-ci please test |
Build failed |
2dd14c9
to
cd8760d
Compare
@swift-ci please test |
We'd like to move forward with this PR. If nobody objects by Monday, we'll submit. We're happy to address all post-submit review comments. Thanks! |
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.
FWIW this LGTM. Ship it.
Not a blocker: Bionic (Android) has a different modulemap ( Once this lands, another PR can be created to do that, no need to change this PR at all (specially because the Android CI cannot be requested for a PR, so checking that it works would be complicated). |
@drodriguez, anybody working on the Android version of this pull? I can put it together if noone else is. @3405691582, you may want to do the same for OpenBSD. |
@buttaface I had the first step working (removing the complicated modulemap), but the test were failing. In the Android case, I think mostly because of the cross-compilation. These weekends have been quite busy and I haven't had time to work on anything, so if you want to have a try at this, feel free. Also, sorry for not being able to test and merge the other PR you had open. I will try to make time at some point. |
@drodriguez, no problem, I figured you were busy. If we get this modulemap change in first, we may not need to modify that C++ test in the NDK pull, so I will try to get this working first. |
This migrates OpenBSD to use the single-header Glibc modulemap proposed and implemented in swiftlang#32404, and necessitates introducing some missing headers for building Foundation added in swiftlang#38341. Additionally, incorporate nullability annotations in SwiftShims per
This migrates OpenBSD to use the single-header Glibc modulemap proposed and implemented in swiftlang#32404, and necessitates introducing some missing headers for building Foundation added in swiftlang#38341. Additionally, incorporate nullability annotations in SwiftShims per
When SwiftGlibc.h was added in swiftlang#32404, no cmake code was added to copy it to the static resources. Copy it along with glibc.modulemap, which references it.
The issues are:
Today, some submodules in
SwiftGlibc
fail to provide definitions that they should contain. As a consequence, Swift fails to import some code that compiles correctly with standalone Clang. As just one example, includingsignal.h
should make the typepid_t
available, but it currently does not.SwiftGlibc
is not compatible with the libc++ module map. Trying to include libc++ headers in a C++ module imported into Swift results in an error message about cyclic dependencies.This change fixes both of these issues by making it so that
SwiftGlibc
no actually longer defines a module map for the glibc headers but merely makes all of the symbols from those headers available in a module that can be imported into Swift. C / Objective-C / C++ code, on the other hand, will now include the glibc headers texually.For more context on the two issues and this fix, see this forum discussion:
https://forums.swift.org/t/problems-with-swiftglibc-and-proposed-fix/37594
This change only modifies
glibc.modulemap.gyb
for the time being but leavesbionic.modulemap.gyb
andlibc-openbsd.modulemap.gyb
unchanged. The intent is to fix these in the same way, but it will be easier to do this in separate PRs that can be tested individually.