mesonbuild / mesonbuild/meson-python
Improve logging on build failure by displaying file contents of `meson-log.txt`
- Ngôn ngữ chính
- Python
- Star
- 180
- Fork
- 93
- Merge trung bình
- 2 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 18
Mô tả
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).
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Bắt đầu bằng cách theo dõi cách các lỗi build của pip từ Meson được báo cáo và dọn dẹp, sử dụng đường dẫn meson-log.txt được nêu trong issue. So sánh việc giữ lại log với việc hiển thị nội dung của nó trên stdout, và tái hiện một build bị lỗi để kiểm tra output hiện có. Công việc được hoàn thành khi người dùng có thể chẩn đoán nguyên nhân gốc ngay cả sau khi thư mục build tạm thời đã được dọn dẹp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- build-system
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Sôi nổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100