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

Android/Termux: etc fails to compile because `getpwent` declarations are unavailable

Abierto
#99 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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
Stack tecnológico
android, c, ruby

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):

  1. Compile successfully when these functions are available for the target android api; or
  2. 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

  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 ruby/etc

Todos los issues de ruby/etc

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.