Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

uucore: hardware feature detection always reports nothing on Android

Open
#15,233 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@limadog9 is already working on this.

Since Oct 15, 2026.

  • #15367 by @limadog9 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
android, rust
Domain
cli

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

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from uutils/coreutils

All issues in uutils/coreutils

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.