Skip to content
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

Build with Android NDK r24 is broken due to mio update in Tokio 1.39.0 #6748

Closed
link2xt opened this issue Aug 5, 2024 · 1 comment
Closed
Labels
A-tokio Area: The main tokio crate C-bug Category: This is a bug. M-net Module: tokio/net

Comments

@link2xt
Copy link

link2xt commented Aug 5, 2024

Since mio dependency update #6635
compilation using Android NDK r24 is broken.

We are using Android NDK r24 (24.0.8215888) to build deltachat-rpc-server binaries
and Android NDK r23c (23.2.8568313) to build actual Android applications.
Both NDK r23c and r24 do not have epoll_create1 in libc when compiling for armeabi-v7a.

For reference
Android NDK r23 requires API level 16,
Android NDK r24 requires API level 19 (KitKat),
Android NDK r25 requires API level 19,
Android NDK r26 requires API level 21 (Lollipop).
Current Android NDK is r27 LTS which requires API level 21.

Android API level does not actually pin the Linux version,
epoll_create1 syscall may be available if phone vendor ships newer Linux kernel.
I have previously added the code to try using epoll_create1 as a syscall
and fallback to epoll_create if it fails:
tokio-rs/mio#1590
This allowed us to compile with Android NDK r24 without issues
(we use it for deltachat-rpc-server releases)
and with Android NDK r23 using some shims
which we only use for the application releases.

The fallback however was removed in new mio again
stating the bump of the Linux version officially supported by Rust as the reason: tokio-rs/mio#1741.

@Darksonn
Copy link
Contributor

Darksonn commented Aug 5, 2024

Unfortunately, the Tokio project will not support Android versions that are no longer supported by the Rust language.

We are not alone in making these changes. For example, the recent PR rust-lang/rust#128416, which will land in rustc 1.82.0, removes support of these Android versions from the Rust standard library.

This is worked around for now by downgrading to Tokio 1.38. This solution will survive until dependencies start pushing us to upgrade tokio or until some tokio dependency get a RUSTSEC advisory and cargo-deny starts to fail.

Tokio version 1.38.x is a long term support release of Tokio. You should not run into such issues before July 2025, so you have a year to upgrade.

@Darksonn Darksonn closed this as not planned Won't fix, can't repro, duplicate, stale Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate C-bug Category: This is a bug. M-net Module: tokio/net
Projects
None yet
Development

No branches or pull requests

2 participants