astral-sh / astral-sh/python-build-standalone
Upstream patch `patch-getrandom-use-nr-3.14.patch`
- Dominant language
- Python
- Stars
- 4.4k
- Forks
- 314
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 27
Description
[`patch-getrandom-use-nr-3.14.patch`](https://github.com/astral-sh/python-build-standalone/blob/main/cpython-unix/patch-getrandom-use-nr-3.14.patch)
CPython uses `SYS_getrandom` for the `getrandom` syscall, but older glibc headers do not define this constant even when modern Linux UAPI headers provide `__NR_getrandom`.
This patch replaces `SYS_getrandom` with `__NR_getrandom`, enabling `os.getrandom` without increasing the minimum supported glibc or kernel version.
Contributor guide
Research direction
Start by reading cpython-unix/patch-getrandom-use-nr-3.14.patch and the CPython syscall code it changes. Verify the patch builds with older glibc headers while using modern Linux UAPI headers, and confirm that os.getrandom remains available without changing the supported glibc or kernel versions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, linux, python
- Domain
- build-system, operating-systems
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 70/100