Android/Termux: etc fails to compile because `getpwent` declarations are unavailable
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Ambito
- operating-systems
Direzione di ricerca
Inizia con il rilevamento di getpwent in extconf.rb e le chiamate a setpwent/getpwent in etc.c. Riproduci il problema con gem install etc --no-document su Android/Termux, quindi verifica che il rilevamento delle funzionalità corrisponda alle dichiarazioni disponibili per l'API Android configurata. Il lavoro è completato quando il gem viene compilato correttamente o disabilita solo la funzionalità interessata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- C
- Stelle
- 33
- Fork
- 16
- Merge medio
- 1h 37m
- PR unite (30g)
- 3
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ruby/etc
-
JRuby support Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
Issue simili
-
internal.h中,漏掉了1个定义。 Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Broadcast Documentation Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
kovidgoyal/kitty#10516 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
zephyrproject-rtos/zephyr#120011 ·