astral-sh / astral-sh/python-build-standalone
File permissions change when unpacking with `tar_filter` enabled
- Dominant language
- Python
- Stars
- 4.4k
- Forks
- 314
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 27
Description
Many files in the published Linux archives appear to have `0o664` file permissions rather than `0o644` permissions.
I picked this up when using Python 3.11 to unpack a python-build-installer archive in `fully_trusted` mode and then repack it gave a different artifact hash than unpacking it using `tar_filter` mode in Python 3.12 and repacking it.
`diffoscope` blamed the discrepancy in the repacked archives on a whole lot of group write bits getting cleared ([diffoscope_pbs311_extract_with_tar_filter_enabled.log](https://github.com/user-attachments/files/17360079/diffoscope_pbs311_extract_with_tar_filter_enabled.log)), which is one of the expected behaviours described in the [`tar_filter` docs](https://docs.python.org/3/library/tarfile.html#tarfile.tar_filter).
A regular local CPython `make altinstall` build didn't produce any files with 0o664 permissions, hence filing this as an issue here rather than with CPython directly.
Edit: fixed Python version number reference. Python 3.11 always unpacks in `fully_trusted` mode, since extraction filters were only added in Python 3.12.
Contributor guide
Assessment
This issue has not been assessed yet.