mesonbuild / mesonbuild/meson-python

Improve logging on build failure by displaying file contents of `meson-log.txt`

Abierto
#246 33 comentarios 5 reacciones 0 asignados Ver en GitHub
enhancement
Lenguaje dominante
Python
Estrellas
180
Forks
93
Merge medio
2 d 7 h
PR fusionados (30 d)
18

Descripción

The current output from `pip` when encountering a build error is very poor. gh-231 will fix one part of that, by reducing the traceback of irrelevant pip/meson-python internals. There is a second part however which we need to improve on, which is showing the actual root cause of a build failure when possible. Now what happens is the user sees something like:

```
../../scipy/meson.build:40:0: ERROR: Command "/usr/bin/python3 -c import os; os.chdir(".."); import numpy; print(numpy.get_include())" failed with status 1.

A full log can be found at /tmp/pip-install-3okqoo15/scipy_a5afe2fae16c4250875f20d9db43706f/.mesonpy-u88p7q3f/build/meson-logs/meson-log.txt
```
and is then left wondering "_why does `import numpy` fail, given `numpy` is a build dependency?"_. The answer is in `meson-log.txt`, which `pip` has unhelpfully already cleaned up. So it's impossible to diagnose the issue (latest example for scipy [here](https://github.com/scipy/scipy/issues/16784#issuecomment-1352898268)).

Two options to improve here that I can think of:
1. Don't clean up the log file
2. Print to log file contents to stdout (possibly followed by repeating the root cause from the original stdout content)

(2) is probably better than (1).

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Comienza siguiendo cómo se informan y limpian los fallos de compilación de pip procedentes de Meson, utilizando la ruta meson-log.txt mostrada en el issue. Compara conservar el log con mostrar su contenido en stdout y reproduce una compilación fallida para inspeccionar la salida disponible. Se considera terminado cuando los usuarios puedan diagnosticar la causa raíz incluso después de que se haya limpiado el directorio de compilación temporal.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
build-system
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Activo
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.