-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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] Enable tests for FileManager in Android. #2176
[android] Enable tests for FileManager in Android. #2176
Conversation
Many tests were disable in Android, but they actually work without almost changes. - Android uses /proc/mounts as Linux. Enabling that code path gives good results in Android. - `attributesOfFileSystem` works on Android once glibc.modulemap includes the right headers (see swiftlang/swift#24286). - However, since Process is still not available in Android, the test that relies on xdgTestHelper tool will not work, and have been disabled (but instead of causing the test to fail, they are simply not run in Android, which probably will never conform to XDG).
Note that xdgTestHelper is used in other tests and is increasingly misnamed. Is there a way we can spawn processes programmatically on Android? |
I’m looking into it. Some of the POSIX APIs used by Foundation appeared in very recent Androids (ref: https://android.googlesource.com/platform/bionic/+/master/libc/include/spawn.h), so I don’t think they are a possibility. I don’t know if I can do |
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.
I had made the first two changes when building Foundation natively on Android AArch64. I also had to disable three other Android-specific blocks in FileManager because they wouldn't compile: the two mode_t & conversion functions and the TimeInterval conversion in attributesOfItem.
The posix_spawn added in Pie last year is a wrapper around fork, it has been backported to older Android versions too. |
@swift-ci test |
@swift-ci please test linux platform |
@swift-ci test linux |
@buttaface: I haven’t had problems with Re @swift-ci please test linux platform |
Hmm, I'm using the latest NDK r19, with the Android API set to 21, could be why.
Yes, that bitwise & function for Android makes other code not compile: I haven't looked into why, just disabled it.
I'll try it with the backported posix_spawn from Bionic and see how it goes. |
@swift-ci test linux |
Many tests were disabled in Android, but they actually work without
almost changes.
results in Android.
attributesOfFileSystem
works on Android once glibc.modulemapincludes the right headers (see [android] Add missing POSIX/Linux headers to Android build. swift#24286).
that relies on xdgTestHelper tool will not work, and have been
disabled (but instead of causing the test to fail, they are simply not
run in Android, which probably will never conform to XDG).