Android/Termux: etc fails to compile because `getpwent` declarations are unavailable
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Área
- operating-systems
Línea de trabajo
Comienza con la detección de getpwent de extconf.rb y las llamadas a setpwent/getpwent de etc.c. Reproduce el fallo con gem install etc --no-document en Android/Termux y, después, verifica que la detección de funcionalidades coincida con las declaraciones disponibles para la API de Android configurada. Se considera terminado cuando el gem se compila correctamente o deshabilita únicamente la funcionalidad afectada.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
My environment
- OS: Android/Termux
- arch: aarch64
- ruby: 4.0.6
- ruby gems version: 4.0.16
- gem version: etc 1.4.6
- compiler used: clang 21.1.8
- android api: 36
Description
Installing the etc gem is fails while compiling the native extension:
gem install etc
The configuration step reports that getpwent() is available in the output:
checking for getpwent()... yes
However, compilation fails because Android's headers looks like not expose declarations for getpwent() and setpwent():
etc.c:294:5: error: call to undeclared function 'setpwent'
etc.c:295:18: error: call to undeclared function 'getpwent'
error: incompatible integer to pointer conversion
Same problem occurs with older versions of the gem, including 1.4.1 through 1.4.5.
The expected behavior
The extension should either (I think):
- Compile successfully when these functions are available for the target android api; or
- Correctly detect that they are unavailable and disable only the affected functionality.
Current detection appears to report getpwent() as available even though the generated extension cannot compile against the android headers.
Reproduction process
I try to install ruby using Android Termux
gem install etc --no-document
Relevant output:
checking for getpwent()... yes
...
error: call to undeclared function 'setpwent'
error: call to undeclared function 'getpwent'
The declarations in Termux's pwd.h are guarded by Android API availability macros, for example:
struct passwd *getpwent(void) __INTRODUCED_IN(26);
void setpwent(void) __INTRODUCED_IN(26);
The etc extension includes pwd.h when HAVE_GETPWENT is defined, but the declarations are not visible for the API configuration used while compiling Ruby.
This causes a mismatch between the feature detection performed by extconf.rb and the code generated by the extension.
Thanks
- Lenguaje dominante
- C
- Estrellas
- 33
- Forks
- 16
- Merge medio
- 1 h 37 min
- PR fusionados (30 d)
- 3
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
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 ruby/etc
-
JRuby support Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Issues similares
-
internal.h中,漏掉了1个定义。 Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
Broadcast Documentation Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
kovidgoyal/kitty#10516 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 80/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
zephyrproject-rtos/zephyr#120011 ·