astral-sh / astral-sh/python-build-standalone
[Linux] Packages cannot be installed into `/`
- Dominant language
- Python
- Stars
- 4.4k
- Forks
- 314
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 27
Description
When using the glibc standalone Python builds for Linux containers, installing these standalone builds into `/` results in some weird behaviour. The root cause appears to be that `sys.base_prefix` is set to `/install`. I've created a Rockcraft file that demonstrates the issue at https://github.com/lengau/bug-reproducers/tree/python-standalone-bin
While the packages work correctly when placed into `/usr`, they don't work in `/`. If placed in `/usr` on a system with [/usr merge](https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/), the same issues appear when calling `/bin/python3` or related.
Given how different this is from the purpose of these builds I think it's reasonable to file it under quirks and move on, but I figured you ought to know :-)
Contributor guide
Research direction
Start with the linked Rockcraft reproducer and compare the standalone build installed into `/` with the same build under `/usr`. Check the reported `sys.base_prefix` value and the behavior of `/bin/python3` on a usr-merged system. Done would require a confirmed explanation and a decided fix or documented quirk, but the issue does not name repository files or tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, python
- Domain
- build-system, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100