-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
[android] Switch to new single-header modulemap for Bionic too #35707
Conversation
@@ -28,7 +28,6 @@ headers = [ | |||
'tgmath.h', | |||
'time.h', | |||
'utmp.h', | |||
'utmpx.h', |
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 header is included twice, so removed one.
Change the original UNSUPPORTED to XFAIL, to get signal if the test starts working. PR #35707 should allow this test to work properly.
I just tried this pull again with the May 3rd trunk source snapshot and got the following error this time:
@xymus, you added these new messages about |
We addressed this issue for macOS with the adequately numbered PR #36666. The problem here is that You can probably extend the workaround from #36666 to Android to get rid of this issue. |
Alright, I will try that. |
Applying that fix got the corelibs to build again and for all the same corelibs tests to pass, thanks Alexis. I've kicked off a run of the Swift compiler unit test and validation suite natively on Android, which takes much longer. @drodriguez, do you want to try applying this updated pull to the cross-compilation Android CI too, now that it seems to work natively on Android? |
This pull now gets 48 C++ Interop tests that were failing to pass, with no regressions in the validation suite. However, I now get a similar compiler error when building the Swift library wrapper for llbuild, this time with deserializing |
Rebased and that last I had to patch Swift NIO for some Bionic constants in that commit, but that's it. Hopefully, I won't need to revert the C++ interoperability that @zoecarver added to libswift any longer once this pull is in. @MaxDesiatov, would you run the CI? @xymus, would you review? @drodriguez, you may want to try this on your local setup that reproduces the Android CI before this is merged, though I doubt it will break that CI. |
@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.
PR changes working on my side, when applied on top of toolchain https://github.com/vgorloff/swift-everywhere-toolchain/releases/tag/1.0.77.
The only thing I changed – is maintained C/C++ header search paths (passed to swift build
command).
# Before
-Xcc -I/usr/local/ndk/21.4.7075529/.../include/c++/v1
# After
-Xcxx -I/usr/local/ndk/21.4.7075529/.../include/c++/v1.
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.
If it works for all of you, LGTM
@drodriguez, I just ran the compiler validation suite on linux x86_64 with a trunk commit from today, after applying this pull and #40625, for both AArch64 and armv7 and the same tests passed as on the Android CI, ie only the 13 C++ Interop tests that are currently broken on the Android CI failed (I was hoping this patch would fix those 13 tests, but no such luck). I think you can merge this now, shouldn't break anything. |
…om NIOCore Motivation: An upcoming pull, swiftlang/swift#35707, moves Android to the same single-header modulemap for Bionic as used on linux, but that doesn't work unless this casting is changed. This approach works both with the current release toolchain and with that new modulemap. Modifications: - Change how these constants are cast. - Remove them from NIOCore. Result: This repo compiles for Android and the tests pass with both modulemap approaches.
Motivation: An upcoming pull, swiftlang/swift#35707, moves Android to the same single-header modulemap for Bionic as used on linux, but that doesn't work unless this casting is changed. This approach works both with the current release toolchain and with that new modulemap. Modifications: Change how these constants are cast. Result: This repo compiles for Android and the tests pass with both modulemap approaches.
Motivation: An upcoming pull, swiftlang/swift#35707, moves Android to the same single-header modulemap for Bionic as used on linux, but that doesn't work unless this is changed. This approach works both with the current release toolchain and with that new modulemap. Modifications: Change how these Bionic constants are imported. Result: This repo compiles for Android and the tests pass with both modulemap approaches.
Motivation: An upcoming pull, swiftlang/swift#35707, moves Android to the same single-header modulemap for Bionic as used on linux, but that doesn't work unless this is changed. This approach works both with the current release toolchain and with that new modulemap. Modifications: Change how these Bionic constants are imported. Result: This repo compiles for Android and the tests pass with both modulemap approaches. Co-authored-by: Cory Benfield <[email protected]>
@artemcm, would you run the CI again? It hasn't been re-run since the holiday break. |
@swift-ci please test |
Ping, @drodriguez, just waiting for you to merge this. |
@CodaFi, would you merge? This will unbreak the build on the Android CI, and if @drodriguez has any changes he wants made, we can always add those whenever he gets back. |
@drodriguez, can we get this in? |
Alright, this fixed the build on the Android CI and it's able to run the host tests from the compiler validation suite again. @drodriguez, if you have any input, let us know, going to submit this for the 5.6 branch next. |
This pull gets all the same tests to pass in the Swift compiler test and validation suite when natively run on Android in the Termux app, but also gets 38 C++ interopability tests that were previously failing to pass, as was the intent of #32404. However, building
libFoundationNetworking.so
from the corelibs then fails with these errors:I am not familiar with this error, so maybe a Swift compiler dev can chime in. I can reproduce when cross-compiling the corelibs for Android with #33724 and a couple other related pulls.
@CodaFi, @drodriguez, @hlopko, any input would be appreciated.