Tests for grafted_library_problem, the check that a recipe's library was linked statically
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- python
- Ambito
- testing-qa
Direzione di ricerca
Inizia con grafted_library_problem() in scripts/gap_wheels.py, che segnala qualsiasi membro la cui cartella di primo livello termina con .libs, e con i test bundled_licence_problem esistenti in tests/test_gap_wheels.py per copiarne lo stile zipfile in memoria. Aggiungi i casi elencati: nessuna cartella .libs dà None, una cartella .libs di primo livello dà il motivo, un file notes.libs di primo livello e una cartella annidata yaml/vendor.libs danno None, byte non zip danno il motivo dell'impossibilità di lettura, e uno zip vuoto dà None. Esegui uvx --python 3.14 [email protected] per confermare che passano su main, poi applica e annulla mutazioni di una riga per mostrare che due test falliscono.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
grafted_library_problem() in scripts/gap_wheels.py (added with library recipes, #33) is one of the checks between a built wheel and publication. A recipe's library must be linked into the extension statically. If the build instead picked up a shared copy from somewhere else, auditwheel bundles it into a <dist>.libs/ folder, and that copy didn't come from the recipe's checked source. The function reads the wheel's member names and returns a reason when it finds such a folder:
grafted = any("/" in n and n.partition("/")[0].endswith(".libs") for n in z.namelist())
...
return "bundles a shared library in a .libs folder; a recipe's library must be linked in statically" if grafted else None
cmd_stage() calls it for every wheel built with a recipe: reason = bundled_licence_problem(data, recipes) or grafted_library_problem(data).
Nothing tests it. git grep grafted_library_problem finds the definition and that one call. A slip in a later edit (say endswith(".libs") becoming == ".libs") would let a wheel with an unreviewed shared library through staging with every test green.
What to do
Add tests to tests/test_gap_wheels.py, next to the tests for bundled_licence_problem. Build each wheel in memory with zipfile (empty files are enough; other tests there show how):
- a wheel with no
.libsfolder:None; PyYAML.libs/libyaml-0.so.2: the reason;pyyaml.libs/x.soandpkg_name.libs/sub/y.so.1: the reason (any top-level folder ending in.libs);- a top-level file named
notes.libs(no/):None; - a nested folder
yaml/vendor.libs/x.so:None, since only a top-level folder is where auditwheel grafts (pin today's behaviour, and say in the PR if you think it's wrong); - bytes that aren't a zip: the reason
couldn't read its members, not an exception; - an empty zip:
None.
And one test through cmd_stage()'s path if the existing staging tests make that easy (tests/test_build_tool_lock.py patches take_wheel for one): a recipe wheel with a .libs folder isn't staged, and its summary line carries the reason.
Tests only: scripts/ stays as it is. If a case shows a real bug, report it in the PR and leave the fix to a maintainer.
Done when:
- The cases above are in
tests/test_gap_wheels.pyand pass onmain. - In the PR description, give two one-line changes to
grafted_library_problem()that each make a test fail (each applied, run and reverted). uvx --python 3.14 [email protected]passes, offline. No new dependencies.
- Lingua principale
- Python
- Stelle
- 0
- Fork
- 1
- Merge medio
- 5h 59m
- PR unite (30g)
- 19
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
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 wheelgap/wheels
-
documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement help wanted
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
I maintainer di solito rispondono entro 1 giorno
-
bug help wanted
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
bug help wanted
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di wheelgap/wheels
Issue simili
-
bug game: 0100FF500E34A000 game: 0400FF500E34A001 mac packing
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
jxxghp/MoviePilot#7576 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
jbaruch/software-factory#266 ·
I maintainer di solito rispondono entro 1 giorno
-
cron: raise a distinct error when next_fire finds no match in its search bound (from #813 item 5)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno