-
Notifications
You must be signed in to change notification settings - Fork 245
Rustix for android, part deux #1577
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
Open
gurchetansingh
wants to merge
4
commits into
bytecodealliance:main
Choose a base branch
from
gurchetansingh:rustix-for-android-part-deux
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
95cdffb
rustix: add ioctl wrappers
gurchetansingh 99c8050
rustix: improve for musl build without linux-raw-sys
gurchetansingh a0a2db6
rustix: enable rustix::thread::futex without linux-raw-sys
gurchetansingh f5b00ae
rustix: add Meson build to CI to guard Android use cases
gurchetansingh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # Copyright © 2026 Google | ||
| # SPDX-License-Identifier: MIT | ||
|
|
||
| project( | ||
| 'rustix', | ||
| 'rust', | ||
| version : '1.1.3', | ||
| license : 'Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT', | ||
| ) | ||
|
|
||
| dep_errno = dependency('errno-0.3-rs', fallback: ['errno-0.3-rs', 'dep_errno']) | ||
| dep_libc = dependency('libc-0.2-rs', fallback: ['libc-0.2-rs', 'dep_libc']) | ||
| dep_bitflags = dependency('bitflags-2-rs', fallback: ['bitflags-2-rs', 'dep_bitflags']) | ||
|
|
||
| rustix_args = [ | ||
| '--cfg', 'libc', | ||
| '--cfg', 'feature="use-libc"', | ||
| ] | ||
|
|
||
| os_deps = [] | ||
| if host_machine.system() == 'linux' or host_machine.system() == 'android' | ||
| rustix_args += [ | ||
| '--cfg', 'linux_like', | ||
| '--cfg', 'linux_kernel', | ||
| '--cfg', 'feature="std"', | ||
| '--cfg', 'feature="alloc"', | ||
| '--cfg', 'feature="event"', | ||
| '--cfg', 'feature="fs"', | ||
| '--cfg', 'feature="mm"', | ||
| '--cfg', 'feature="net"', | ||
| '--cfg', 'feature="param"', | ||
| '--cfg', 'feature="pipe"', | ||
| '--cfg', 'feature="thread"', | ||
| ] | ||
| elif host_machine.system() == 'windows' | ||
| os_deps += [dependency('windows-sys-0.6-rs', fallback: ['windows-sys-0.6-rs', 'dep_windows_sys'])] | ||
| endif | ||
|
|
||
| lib = static_library( | ||
| 'rustix', | ||
| 'src/lib.rs', | ||
| override_options : ['rust_std=2021', 'build.rust_std=2021'], | ||
| dependencies : [dep_errno, dep_libc, dep_bitflags] + os_deps, | ||
| rust_abi : 'rust', | ||
| rust_args: rustix_args, | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| [wrap-file] | ||
| directory = bitflags-2.9.1 | ||
| source_url = https://crates.io/api/v1/crates/bitflags/2.9.1/download | ||
| source_filename = bitflags-2.9.1.tar.gz | ||
| source_hash = 1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967 | ||
| patch_directory = bitflags-2-rs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| [wrap-file] | ||
| directory = errno-0.3.12 | ||
| source_url = https://crates.io/api/v1/crates/errno/0.3.12/download | ||
| source_filename = errno-0.3.12.tar.gz | ||
| source_hash = cea14ef9355e3beab063703aa9dab15afd25f0667c341310c1e5274bb1d0da18 | ||
| patch_directory = errno-0.3-rs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| [wrap-file] | ||
| directory = libc-0.2.177 | ||
| source_url = https://crates.io/api/v1/crates/libc/0.2.177/download | ||
| source_filename = libc-0.2.177.tar.gz | ||
| source_hash = 2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976 | ||
| patch_directory = libc-0.2-rs |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
These seem like weird inclusions for the public API.
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.
so nix has them too:
https://github.com/nix-rust/nix/blob/master/src/sys/ioctl/mod.rs#L652
I know of two places that are duplicating this logic:
https://github.com/Smithay/drm-rs/blob/develop/drm-ffi/src/ioctl.rs#L6
https://github.com/magma-gpu/rutabaga_gfx/blob/main/third_party/mesa3d/src/magma/sys/linux/amdgpu.rs#L43 (the project I work on)
Anything particularly wrong with these APIs? Otherwise, people have to excessively define things like
ioctl::Updaterandioctl::opcode::read_write.