mesonbuild / mesonbuild/meson-python
Improve logging on build failure by displaying file contents of `meson-log.txt`
- 主要语言
- Python
- 星标
- 180
- 派生
- 93
- 平均合并
- 2 天 7 小时
- 30 天内合并 PR
- 18
描述
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).
贡献指南
这个仓库没有索引到贡献指南
调研方向
首先使用 issue 中显示的 meson-log.txt 路径,追踪来自 Meson 的 pip 构建失败是如何报告和清理的。比较保留日志与在 stdout 上显示其内容这两种方式,并复现一次失败的构建以检查可用的输出。当用户即使在临时构建目录被清理后仍能诊断根本原因时,即视为完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- build-system
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100