Skip to content

Conversation

@gurchetansingh
Copy link
Contributor

rustix: add Meson build to CI to guard Android use cases

Rustix has gone back-and-forth on it's policy on Android.
Android platform developers don't want a dependency on
linux-raw-sys.  This is documented here:

  https://github.com/bytecodealliance/rustix/issues/1095
  https://github.com/bytecodealliance/rustix/pull/1478
  https://github.com/rust-vsock/vsock-rs/pull/60

Android app developers seem to want to use linux-raw-sys though:

https://github.com/bytecodealliance/rustix/pull/1528

The Android platform developers don't REALLY care about
the cargo build though.

CI/CD testing on the particular build options Android likes
is useful.

This MR adds another non-cargo build system (Meson) to the
CI/CD, that mirrors the options Android likes.

Meson is renowned for being a easy-to-maintain build system.

By adding it here, we ensure the continue use of Rustix in
core Android platform code.

These ioctl wrappers are used by rustix users.  For example:

https://github.com/Smithay/drm-rs/blob/develop/drm-ffi/src/ioctl.rs#L6

Roughly, they match the ones provided by nix.  I'm upstreaming the
portion I have personally tested.
Android likes to build host tools (adb, Cuttlefish, ..)
via musl, using the same hermetic tree as for Bionic
build.

And linux-raw-sys isn't in that hermetic tree, so add support
for the libc-backend.
It's desirable to enable futex for some cases that will be
run on Android.  The strategy is just to define the constants
needed by the libc ourselves, if libc doesn't provide the
necessary constant.  Long-term, that could make the libc
backend only depend on libc.
Rustix has gone back-and-forth on it's policy on Android.
Android platform developers don't want a dependency on
linux-raw-sys.  This is documented here:

  bytecodealliance#1095
  bytecodealliance#1478
  rust-vsock/vsock-rs#60

Android app developers seem to want to use linux-raw-sys though:

bytecodealliance#1528

The Android platform developers don't REALLY care about
the cargo build though.

CI/CD testing on the particular build options Android likes
is useful.

This MR adds another non-cargo build system (Meson) to the
CI/CD, that mirrors the options Android likes.

Meson is renowned for being a easy-to-maintain build system.

By adding it here, we ensure the continue use of Rustix in
core Android platform code.
@gurchetansingh gurchetansingh force-pushed the rustix-for-android-part-deux branch from e97ec4e to f5b00ae Compare February 2, 2026 22:28
@gurchetansingh gurchetansingh changed the title [WIP] Rustix for android part deux [WIP] Rustix for android, part deux Feb 3, 2026
@gurchetansingh
Copy link
Contributor Author

CC: @sunfishcode @qwandor @HemantKArya

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant