fs::hard_link: use linkat on Android#159346
Conversation
|
cc @rust-lang/miri |
|
r? @JohnTitor rustbot has assigned @JohnTitor. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
I found https://github.com/android/ndk/wiki/Compatibility which does not mention API level 21. Does that mean we still support Android 5...? |
|
The Compatibility page is a "last NDK that supported it" table, so API 21 not appearing there means no NDK has dropped it yet. The place the current floor got set is the r26 changelog: "KitKat (APIs 19 and 20) is no longer supported. The minimum OS supported by the NDK is Lollipop (API level 21)." So the minimum for r26 and everything after is exactly 21, meaning Android 5 is still supported and is the oldest thing that is. For what Rust actually builds with: the dist images use NDK r26d (src/ci/docker/host-x86_64/dist-android/Dockerfile), which can't target anything below 21 anyway. So assuming |
|
API level 20 also doesn't appear on that page so apparently has not been dropped yet? But that contradicts what you quote from the r26 changelog. How do I find out what the "most recent Long Term Support (LTS) Android Native Development Kit (NDK)" is? |
|
API 20 is Android 4.4W, the wearables-only KitKat release (API level table). It never existed as an NDK platform level: For the LTS: the NDK wiki front page lists current releases and support windows. Right now r29 is the newest release and r27d is the LTS ("2024 LTS", "supported until r30 is released"; r30 is in beta). The API 21 floor has been in place since r26, which covers both the r26d that Rust CI builds with and the current LTS. |
|
Okay, thanks a lot! IIUC that means we're good depending on |
|
Sorry for the slow response, I'm on leave at the moment. @Joel-Wwalker is correct though, API 21 is currently last supported and does support Re: compatibility, if you want a less glitzy description of when native APIs were introduced, you can look here |
|
@the8472 maybe I could get a review from you? |
There was a problem hiding this comment.
Are those miri tests executed anywhere on an android system/emulator?
All the hard_link tests in the std testsuite are guarded with this:
#[cfg_attr(target_os = "android", ignore = "Android SELinux rules prevent creating hardlinks")]
This was introduced in #102757
So we have nominal hardlink support on android but it's not available to regular apps. OS components might be able to use it, but we're not testing that at the moment.
There was a problem hiding this comment.
No, those tests are only run on Linux natively, and inside Miri on various targets.
There was a problem hiding this comment.
So Miri is simulating the android target and the restrictions don't apply, ok.
fs::hard_link: use linkat on Android According to rust-lang@6249cda, `linkat` needs API level 21. That is ancient (2014, Android 5). Our [target page](https://doc.rust-lang.org/rustc/platform-support/android.html) does not say which minimum Android version or API level we support, it just says: > Rust will support the most recent Long Term Support (LTS) Android Native Development Kit (NDK). By default Rust will support all API levels supported by the NDK, but a higher minimum API level may be required if deemed necessary. That's pretty useless as I have no idea how I'd figure out what the "API levels support by the NDK" are. Cc @chriswailes @jfgoog @maurer @pirama-arumuga-nainar Fixes rust-lang/miri#5080
fs::hard_link: use linkat on Android According to rust-lang@6249cda, `linkat` needs API level 21. That is ancient (2014, Android 5). Our [target page](https://doc.rust-lang.org/rustc/platform-support/android.html) does not say which minimum Android version or API level we support, it just says: > Rust will support the most recent Long Term Support (LTS) Android Native Development Kit (NDK). By default Rust will support all API levels supported by the NDK, but a higher minimum API level may be required if deemed necessary. That's pretty useless as I have no idea how I'd figure out what the "API levels support by the NDK" are. Cc @chriswailes @jfgoog @maurer @pirama-arumuga-nainar Fixes rust-lang/miri#5080
fs::hard_link: use linkat on Android According to rust-lang@6249cda, `linkat` needs API level 21. That is ancient (2014, Android 5). Our [target page](https://doc.rust-lang.org/rustc/platform-support/android.html) does not say which minimum Android version or API level we support, it just says: > Rust will support the most recent Long Term Support (LTS) Android Native Development Kit (NDK). By default Rust will support all API levels supported by the NDK, but a higher minimum API level may be required if deemed necessary. That's pretty useless as I have no idea how I'd figure out what the "API levels support by the NDK" are. Cc @chriswailes @jfgoog @maurer @pirama-arumuga-nainar Fixes rust-lang/miri#5080
Rollup of 8 pull requests Successful merges: - #159504 (Abort const-eval queries early when there are generics in the type) - #159523 (std: fix Xous UDP recv length over-report and OOB panic) - #159605 (Add fallback for `intrinsics::fabs`) - #159699 (bump std libc to 0.2.189) - #159306 (Add new variant to iterating-updating-mutref borrowck test) - #159346 (fs::hard_link: use linkat on Android) - #159513 (Consider `()` as suspicious only when expecting `!` for runtime symbols) - #159734 (Document the link_section attribute)
Rollup merge of #159346 - RalfJung:android-linkat, r=the8472 fs::hard_link: use linkat on Android According to 6249cda, `linkat` needs API level 21. That is ancient (2014, Android 5). Our [target page](https://doc.rust-lang.org/rustc/platform-support/android.html) does not say which minimum Android version or API level we support, it just says: > Rust will support the most recent Long Term Support (LTS) Android Native Development Kit (NDK). By default Rust will support all API levels supported by the NDK, but a higher minimum API level may be required if deemed necessary. That's pretty useless as I have no idea how I'd figure out what the "API levels support by the NDK" are. Cc @chriswailes @jfgoog @maurer @pirama-arumuga-nainar Fixes rust-lang/miri#5080
Rollup of 8 pull requests Successful merges: - rust-lang/rust#159504 (Abort const-eval queries early when there are generics in the type) - rust-lang/rust#159523 (std: fix Xous UDP recv length over-report and OOB panic) - rust-lang/rust#159605 (Add fallback for `intrinsics::fabs`) - rust-lang/rust#159699 (bump std libc to 0.2.189) - rust-lang/rust#159306 (Add new variant to iterating-updating-mutref borrowck test) - rust-lang/rust#159346 (fs::hard_link: use linkat on Android) - rust-lang/rust#159513 (Consider `()` as suspicious only when expecting `!` for runtime symbols) - rust-lang/rust#159734 (Document the link_section attribute)
According to 6249cda,
linkatneeds API level 21. That is ancient (2014, Android 5). Our target page does not say which minimum Android version or API level we support, it just says:That's pretty useless as I have no idea how I'd figure out what the "API levels support by the NDK" are.
Cc @chriswailes @jfgoog @maurer @pirama-arumuga-nainar
Fixes rust-lang/miri#5080