hatch_build.py: the package cannot be built where `file(1)` is not installed
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- build-system
Research direction
Start in hatch_build.py and read CFfiBuildHook._build_flatc, focusing on the readelf and file subprocess calls. Try the build in a Debian 13 environment without file or binutils, then repeat with both tools installed. Done when the build succeeds without either diagnostic tool and prints the diagnostic lines when both are available.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Python
- Stars
- 2.5k
- Forks
- 766
- Avg merge
- 4h 24m
- Merged PRs (30d)
- 20
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from crossbario/autobahn-python
-
CI-CD enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
crossbario/autobahn-python#1945 · 1 comment ·
Maintainers usually reply within 1 day
-
bug CI-CD
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
crossbario/autobahn-python#1932 ·
Maintainers usually reply within 1 day
-
CI-CD enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
crossbario/autobahn-python#1829 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
crossbario/autobahn-python#2033 ·
Maintainers usually reply within 1 day
-
bug CI-CD
Difficulty 4/5 3-5 days Newbie friendliness 52/100
crossbario/autobahn-python#2013 ·
Maintainers usually reply within 1 day
All issues in crossbario/autobahn-python
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
jejjohnson/gaussx#752 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
521xueweihan/HelloGitHub#4270 ·
-
enhancement owner: den-haag
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 6 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ok-oldking/ok-wuthering-waves#1828 ·
Maintainers usually reply within 1 day
-
lesson-submission pending-review
Difficulty 1/5 Under an hour Newbie friendliness 65/100
Ikalus1988/MisakaNet#4512 ·
Maintainers usually reply within 1 day