hatch_build.py: the package cannot be built where `file(1)` is not installed
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 84/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- build-system
Hướng nghiên cứu
Bắt đầu trong hatch_build.py và đọc CFfiBuildHook._build_flatc, tập trung vào các lệnh gọi subprocess của readelf và file. Thử build trong môi trường Debian 13 không có file hoặc binutils, sau đó thử lại khi đã cài đặt cả hai công cụ. Hoàn tất khi build thành công mà không cần một trong hai công cụ chẩn đoán và in các dòng chẩn đoán khi cả hai đều khả dụng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 2.5k
- Fork
- 766
- Merge trung bình
- 4 giờ 24 phút
- Pull request đã merge (30 ngày)
- 20
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của crossbario/autobahn-python
-
CI-CD enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
crossbario/autobahn-python#1945 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug CI-CD
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
crossbario/autobahn-python#1932 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
CI-CD enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
crossbario/autobahn-python#1829 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
crossbario/autobahn-python#2033 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug CI-CD
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
crossbario/autobahn-python#2013 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của crossbario/autobahn-python
Issue tương tự
-
area/test type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Clodmony/starship-coop#70 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
punitarani/fli#270 ·
-
🐛 Bug 🔔 Pending processing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
jumpserver/jumpserver#17980 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
community enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Claiming namespace `prodmetrics`Đang mởnamespace
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 60/100
EclipseFdn/open-vsx.org#15341 ·
Maintainer thường phản hồi trong vòng 1 ngày