uucore: hardware feature detection always reports nothing on Android
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 55/100
Research direction
Start with the detect_* functions in src/uucore/src/lib/features/hardware.rs and the target_os = "android" branches in each. Read commit 8d740257a for the sandboxing rationale before changing anything, then check how debug_flag in tests/by-util/test_cksum.rs is skipped on Android. Done means the Android branches are removed, cksum --debug reports detected features on Android, and the debug_flag tests run in the Android CI job.
Written by the indexing model from the issue text.
Description
uucore::hardware returns false for every CPU feature on Android. Each detect_* function in src/uucore/src/lib/features/hardware.rs has this branch:
if cfg!(target_os = "android") {
false
} else {
std::arch::is_x86_feature_detected!("avx2")
}
The commit that added the module (8d740257a) explains it as "no CPUID access in sandboxed environment". My AI agent does not think that holds. On x86, CPUID is an unprivileged instruction, and Rust's std_detect reads it directly, with no OS involvement. On aarch64, std_detect reads AT_HWCAP through getauxval, which Android's libc provides, and it even carries an Android-specific workaround for the Exynos 9810. So the standard library supports Android here, and uutils opts out of it.
The effect: cksum --debug prints "support not detected" for every feature on Android, whatever the CPU has. wc never uses its SIMD counting path on Android, so wc -l and wc -m are slower than they need to be. The debug_flag tests in tests/by-util/test_cksum.rs are skipped on Android, so CI does not cover this.
I propose to remove the Android branches and let the Android CI job run the debug_flag tests. I have not checked what GNU coreutils reports on Android, so this is about using the same detection as every other Rust program there, not about matching GNU output.
- Dominant language
- Rust
- Stars
- 24.3k
- Forks
- 2.1k
- Avg merge
- 2d 15m
- Merged PRs (30d)
- 320
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from uutils/coreutils
-
minorbug(mv): invalid mode errors not quotedPossibly taken @henrimarconni claimed this 2 days ago. OpenU - mv
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
ptx: break file missing path in error messagePossibly taken @Franklin-Qi claimed this 2 days ago. OpenU - ptx
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
uutils/coreutils#15307 · 1 comment ·
Maintainers usually reply within 1 day
-
minorbug(stat): os errno not stripped when failing to flush stdoutPossibly taken @cestercian claimed this 9 days ago. OpenU - stat
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
uutils/coreutils#15200 · 3 comments ·
Maintainers usually reply within 1 day
-
stty: support B460800 and B921600 baud ratesPossibly taken @oech3 claimed this 5 days ago. Openawaiting upstream U - stty
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
B - high priority U - du
Difficulty 1/5 Under an hour Newbie friendliness 82/100
uutils/coreutils#14984 · 1 comment ·
Maintainers usually reply within 1 day
All issues in uutils/coreutils
Similar issues
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
IntersectMBO/developer-experience#347 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
registrystack/registry-stack#2168 ·
Maintainers usually reply within 1 day
-
bug crate: 3d help wanted triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
kornia/kornia-rs#1203 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
[Bug] ComponentType classifies 0x8A8A-0xEAEA as GREASE; mls-extensions §7.5 makes them private useOpen
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day