Commit 2a36128
authored
🐛 fix(discovery): resolve base interpreter executable-only symlinks (#3166)
Creating an environment with `-p` pointing at a symlink to just the
interpreter binary recorded the symlink in `pyvenv.cfg`: `home` ended up
as the symlink's directory, which contains no `lib/`, and
`base-executable` kept the unresolved link. 🐛 Standard CPython survives
because `getpath` re-resolves the link when reading `home`, but layouts
where `home` must directly locate the base stdlib, such as
python-build-standalone, produce a broken environment (#3157).
The resolution lives in python-discovery (tox-dev/python-discovery#85,
refined by tox-dev/python-discovery#87): `system_executable` follows the
symlink chain of the executable's final path component only, stopping as
soon as the stdlib landmark is reachable and never touching macOS
framework builds, the same semantics CPython's `getpath` uses and its
`venv` adopts in python/cpython#115237. A barren-directory symlink
resolves to the real interpreter while stable aliases like Homebrew's
`opt` paths, Debian's `/usr/bin/python3`, or a fully symlinked
interpreter tree keep their recorded form. This PR raises the dependency
floor to `python-discovery>=1.4.2` and bumps the app-data `py_info`
cache key from `4` to `5` so interpreter records probed by older
virtualenv versions are not shared with the corrected ones.
CI needs python-discovery `1.4.2` on PyPI (tox-dev/python-discovery#87
merge + release) to go green.
Fixes #3157.1 parent 5389c25 commit 2a36128
4 files changed
Lines changed: 28 additions & 2 deletions
File tree
- docs/changelog
- src/virtualenv/app_data
- tests/unit/create
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
388 | 410 | | |
389 | 411 | | |
390 | 412 | | |
| |||
0 commit comments