-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Fix Android device issues related to filesystem/IO #58586
Conversation
Tagging subscribers to this area: @dotnet/area-system-io Issue Details
|
Tagging subscribers to 'arch-android': @steveisok, @akoeplinger Issue Details
|
- Use F_SETLK64 for fcntl to fix an issue where 32bit arm Android apps would get the wrong flag - Add numerical magic numbers for missing file systems to Interop.UnixFileSystemTypes so they are correctly recognized - Make ping test a bit more forgiving if the process returns a few milliseconds _before_ the timeout - Disable System.IO.Net5Compat.Tests.csproj on Helix for non-Windows platforms like intended, we were still building it since we pass `/p:ArchiveTests=true` on CI
f20634a
to
db5cf28
Compare
#if defined(TARGET_ANDROID) && defined(HAVE_FLOCK64) | ||
// On Android, fcntl is always implemented by fcntl64 but before https://github.com/aosp-mirror/platform_bionic/commit/09e77f35ab8d291bf88302bb9673aaa518c6bcb0 | ||
// there was no remapping of F_SETLK to F_SETLK64 when _FILE_OFFSET_BITS=64 (which we set in eng/native/configurecompiler.cmake) so we need to always pass F_SETLK64 | ||
int command = F_SETLK64; | ||
#else | ||
int command = F_SETLK; | ||
#endif |
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.
Is there a case where generic condition won't work:
#if defined(TARGET_ANDROID) && defined(HAVE_FLOCK64) | |
// On Android, fcntl is always implemented by fcntl64 but before https://github.com/aosp-mirror/platform_bionic/commit/09e77f35ab8d291bf88302bb9673aaa518c6bcb0 | |
// there was no remapping of F_SETLK to F_SETLK64 when _FILE_OFFSET_BITS=64 (which we set in eng/native/configurecompiler.cmake) so we need to always pass F_SETLK64 | |
int command = F_SETLK64; | |
#else | |
int command = F_SETLK; | |
#endif | |
#ifdef F_SETLK64 | |
int command = F_SETLK64; | |
#else | |
int command = F_SETLK; | |
#endif |
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 wasn't sure and since I want the change to go back to release/6.0 I thought it's better to keep the existing code as is. We can try your version for 7.0.
src/libraries/Common/src/Interop/Unix/System.Native/Interop.UnixFileSystemTypes.cs
Show resolved
Hide resolved
src/libraries/System.IO/tests/Net5CompatTests/System.IO.Net5Compat.Tests.csproj
Outdated
Show resolved
Hide resolved
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, thank you @akoeplinger !
- Use F_SETLK64 for fcntl to fix an issue where 32bit arm Android apps would get the wrong flag - Add numerical magic numbers for missing file systems to Interop.UnixFileSystemTypes so they are correctly recognized - Make ping test a bit more forgiving if the process returns a few milliseconds _before_ the timeout (cherry picked from commit 462ab6e)
…t and test fixes for Android (#58841) Manual backport of #57208, #58519, #58562, #58210, #57732, #58428, #58586, #58745, #57687 to release/6.0 Numerous test suites have been failing for iOS/tvOS/MacCatalyst consistently on CI without useful logs as to why. Moreover, some of these suites pass locally. This PR looks to reduce the failures on CI by skipping the problematic suites Skips test suites logged in #53624 ActiveIssues #58440 #58418 #58367 #58584 Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com> Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com> Co-authored-by: Jo Shields <directhex@apebox.org>
- Make sure System.IO.Net5Compat.Tests.csproj builds formoved to run System.IO.Tests .NET 5 compat tests on every OS #58611$(NetCoreAppCurrent)
since it is now supposed to be running on all platforms.