Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

uucore: hardware feature detection always reports nothing on Android

Abierto
#15,233 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@limadog9 ya está trabajando en esto.

Desde el 15/10/2026.

  • #15367 de @limadog9 — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
android, rust
Área
cli

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Rust
Estrellas
24.3k
Forks
2.1k
Merge medio
1 d 21 h
PR fusionados (30 d)
357

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de uutils/coreutils

Todos los issues de uutils/coreutils

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.