mesonbuild / mesonbuild/meson-python
Document how to use generated Cython `.pxi` headers
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 180
- Fork
- 93
- Merge medio
- 2g 7h
- PR unite (30g)
- 18
Descrizione
Sometimes when compiling pandas you end up having to compile twice to get the library to completely build. The files that get compiled the second time tend to be the outputs of a Tempita process.
Here are some small excerpts from pandas (some parts intentionally omitted to try and keep minimal):
_hashtable_class_helper = custom_target('hashtable_class_helper_pxi',
output: 'hashtable_class_helper.pxi',
input: 'hashtable_class_helper.pxi.in',
command: [
py, tempita, '@INPUT@', '-o', '@OUTDIR@'
]
)
_hashtable_func_helper = custom_target('hashtable_func_helper_pxi',
output: 'hashtable_func_helper.pxi',
input: 'hashtable_func_helper.pxi.in',
command: [
py, tempita, '@INPUT@', '-o', '@OUTDIR@'
]
)
...
cython_args = [
'--include-dir',
meson.current_build_dir(),
'-X always_allow_keywords=true'
]
py.extension_module(
hashtable,
sources: ['hashtable.pyx', _hashtable_class_helper, _hashtable_func_helper],
cython_args: cython_args,
...
)
When I look at the dotgraph that ninja generates, I noticed that the tempita outputs are declared as dependencies of both the cython_COMPILER and c_COMPILER steps, which is where I think a possible race condition leading up to the c_COMPILER step could be what requires a recompile.
Shouldn't the generated cython files only be a dependency for the cython_COMPILER? Is there a way to explicitly declare this?
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.
Direzione di ricerca
Inizia con gli estratti di Meson custom_target e py.extension_module presenti nell’issue, quindi esamina il comportamento del Ninja dotgraph generato descritto nell’issue. Determina se i file .pxi generati debbano dipendere solo dal compilatore Cython e documenta come dichiarare esplicitamente questa dipendenza, incluso come verificare il grafo di build risultante.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- build-system
- Tipo di issue
- Documentazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100