-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Make std tests pass on newer Android #102757
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @m-ou-se (or someone else) soon. Please see the contribution instructions for more information. |
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
cc @chriswailes |
This comment has been minimized.
This comment has been minimized.
Can we find another fs to test on instead? E.g. |
Unfortunately Android devices do not have a filesystem mounted at |
An issue with this is that we no longer know which tests are actually run and which are skipped on Android. Maybe we should explicitly check for the android version to decide whether a test should be skipped? Or just #[ignore] the tests on Android entirely? |
d157986
to
77da13a
Compare
I'm not sure if it's as simple as checking the Android version (I'm not sure when these restrictions were added and it might not have been at the same time on every device). Applications wouldn't be able to use these APIs successfully so there's less value in testing them, but on the other hand Rust is increasingly being used in the operating system itself. If we don't care that much about whether these tests pass on Android and we expect the existing testing on non-Android Linux to be sufficient then yes, the simplest approach is to ignore them on Android, and I've updated the patch to do that. For the operating system use case we may consider arranging to run these tests only on rooted devices, but that can come later. |
Anything else needed here? As I mentioned, the tests are now ignored on Android. |
Ping. |
@rustbot ready |
☔ The latest upstream changes (presumably #106673) made this pull request unmergeable. Please resolve the merge conflicts. |
Newer versions of Android forbid the creation of hardlinks as well as Unix domain sockets in the /data filesystem via SELinux rules, which causes several tests depending on this behavior to fail. So let's skip these tests on Android with an #[ignore] directive.
Ping. |
It seems somewhat unfortunate to be ignoring the tests entirely but...
Fair enough. And ignored tests can be run explicitly. I wonder though if there could be some way for the tests to be opt-in as a group? I'm thinking something like: #[cfg_attr(all(target_os = "android", not(test_rooted_android_device)), ignore)] Or some other |
What I had in mind for later was that the tests could opt in automatically by checking for I do think though that as a first step we should make these tests stop failing on Android, since after several months it's already getting rather tedious to need to patch this in every time I need to run the tests. |
Extremely annoying but at the same time seems fine to me. |
…bilee Make std tests pass on newer Android Newer versions of Android forbid the creation of hardlinks as well as Unix domain sockets in the /data filesystem via SELinux rules, which causes several tests depending on this behavior to fail. So let's skip these tests on Android if we see an EACCES from one of these syscalls. To achieve this, introduce a macro with the horrible name of or_panic_or_skip_on_android_eacces (better suggestions welcome) which skips (returns from) the test if an EACCES return value is seen on Android.
…bilee Make std tests pass on newer Android Newer versions of Android forbid the creation of hardlinks as well as Unix domain sockets in the /data filesystem via SELinux rules, which causes several tests depending on this behavior to fail. So let's skip these tests on Android if we see an EACCES from one of these syscalls. To achieve this, introduce a macro with the horrible name of or_panic_or_skip_on_android_eacces (better suggestions welcome) which skips (returns from) the test if an EACCES return value is seen on Android.
☀️ Test successful - checks-actions |
Finished benchmarking commit (a6236fa): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 650.76s -> 652.439s (0.26%) |
Newer versions of Android forbid the creation of hardlinks as well as Unix domain sockets in the /data filesystem via SELinux rules, which causes several tests depending on this behavior to fail. So let's skip these tests on Android if we see an EACCES from one of these syscalls. To achieve this, introduce a macro with the horrible name of or_panic_or_skip_on_android_eacces (better suggestions welcome) which skips (returns from) the test if an EACCES return value is seen on Android.