uucore: hardware feature detection always reports nothing on Android
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 55/100
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
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de uutils/coreutils
-
ls: `--block-size=0` is accepted when `--si` comes laterPosiblemente ocupada @Logic769 la tomó hoy. Abiertogood first issue U - ls
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
B - high priority U - ln
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
uutils/coreutils#15980 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
uutils/coreutils#15962 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
B - high priority U - tr
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día
-
U - df
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
Todos los issues de uutils/coreutils
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 1 día
-
o8 next debug build aborts on Glass to Dark appearance switch (nil identifier messaged before check)Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
hurttlocker/o8#5112 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
memory_patch_page drops the `#` of headings like `## Notes on C#`Posiblemente ocupada @viniciusdsandrade la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
akitaonrails/ai-memory#1859 ·
Los mantenedores suelen responder en 1 día