mesonbuild / mesonbuild/meson-python

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

オープン
#246 コメント 33 件 リアクション 5 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

enhancement
主要言語
Python
スター
180
フォーク
93
平均マージ
2日 7時間
マージ済み PR(30日)
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).

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、issue に示されている meson-log.txt パスを使って、Meson に起因する pip のビルド失敗がどのように報告され、クリーンアップされるかを追跡します。ログを保持する方法と、その内容を stdout に表示する方法を比較し、失敗するビルドを再現して利用可能な出力を調べます。一時ビルドディレクトリがクリーンアップされた後でも、ユーザーが根本原因を診断できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
build-system
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。