hatch_build.py: the package cannot be built where `file(1)` is not installed
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 84/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- python
- 領域
- build-system
調査の方向性
hatch_build.pyから始めてCFfiBuildHook._build_flatcを読み、readelfとfileを呼び出すsubprocessに注目してください。fileもbinutilsもないDebian 13環境でビルドを試し、その後、両方のツールをインストールした状態でもう一度試してください。どちらの診断ツールもなくてもビルドが成功し、両方が利用可能な場合は診断行が出力されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
What happens
On a Debian 13 host without the file package, every install or build of autobahn
from source fails: pip install -e ., uv pip install, and just install,
install-tools, install-docs, install-build-tools, build. At master 7d6978d,
CPython 3.11 to 3.14 and PyPy 3.11 all fail the same way:
FileNotFoundError: [Errno 2] No such file or directory: 'file'
...
error: metadata-generation-failed
flatc builds successfully first; the build fails only after that.
Why
CFfiBuildHook._build_flatc prints diagnostics about the built flatc, and finishes
with:
file_result = subprocess.run(
["file", str(flatc_dest)],
capture_output=True,
text=True,
)
if file_result.returncode == 0:
print(f" {file_result.stdout.strip()}")
The code checks the return code, but subprocess.run raises before returning one
when the executable itself is missing. The output is only diagnostic, yet a missing
diagnostic tool fails the whole build. GitHub's runners have file, so CI never hits
this. Minimal containers and build hosts often lack it.
Fix
Catch FileNotFoundError around this call and skip the line, and do the same for the
readelf call just above it, which has the same shape. Alternatively, look the tool
up with shutil.which() first.
Acceptance
- In a
debian:trixiecontainer withoutfile(and withoutbinutils),pip install .builds and installs autobahn. - Where both tools are present, the diagnostic lines are printed as before.
Found by running the GH CI steps on a local build node.
- 主要言語
- Python
- スター
- 2.5k
- フォーク
- 766
- 平均マージ
- 3時間 25分
- マージ済み PR(30日)
- 19
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
crossbario/autobahn-python のほかの issue
-
check-typing: ty 0.0.98+ fails on the renamed rule `unresolved-import` (now `import-not-found`)オープン
難易度 1/5 1時間未満 初心者へのやさしさ 94/100
crossbario/autobahn-python#2046 ·
メンテナーはふだん 1 日以内に返信
-
CI-CD enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
crossbario/autobahn-python#1945 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug CI-CD
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
crossbario/autobahn-python#1932 ·
メンテナーはふだん 1 日以内に返信
-
CI-CD enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
crossbario/autobahn-python#1829 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
crossbario/autobahn-python#2033 ·
メンテナーはふだん 1 日以内に返信
crossbario/autobahn-python の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
aws-samples/sample-per-model-bedrock#795 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
Pretalx reports older version to be the latest release than what is actually installed and availableオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
micropython/micropython#19906 ·
メンテナーはふだん 1 日以内に返信