Skip to content

Infer CPython base executables for virtual environment caching - #2571

Draft
zaniebot wants to merge 1 commit into
automations/reproduce-bug/22383from
zb/resolve-symlinked-interpreter-cache
Draft

zaniebot wants to merge 1 commit into
automations/reproduce-bug/22383from
zb/resolve-symlinked-interpreter-cache

Conversation

@zaniebot

@zaniebot zaniebot commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Venvs created from symlinked CPython executables can cache an unresolved sys._base_executable. On Unix, resolve that path in infer_cpython_base_executable and retain cache warming for CPython 3.11+ aliases within the same executable directory. Query Python for older versions, cross-directory aliases, and resolution limits, where additional startup behavior matters. Invalidate metadata from interpreter-v4.

Alternative to #2551, stacked on #2547.

Fixes astral-sh#22383.

The reproducer is stacked on astral-sh#22524.

@zaniebot
zaniebot deployed to automations October 9, 2026 18:10 — with GitHub Actions Active
@astral-automations-bot astral-automations-bot Bot added the bug Something isn't working label Oct 9, 2026
@codspeed

codspeed Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ 8 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

✅ 54 untouched benchmarks
⏩ 35 skipped benchmarks1


Comparing zb/resolve-symlinked-interpreter-cache (d50d3db) with automations/reproduce-bug/22383 (32d694a)

Open in CodSpeed

Footnotes

  1. 35 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@astral-automations-bot
astral-automations-bot Bot force-pushed the automations/reproduce-bug/22383 branch from 93729c7 to e3272ea Compare October 13, 2026 18:55
@zaniebot
zaniebot force-pushed the zb/resolve-symlinked-interpreter-cache branch from ad412be to d50d3db Compare October 13, 2026 19:01
@zaniebot
zaniebot force-pushed the automations/reproduce-bug/22383 branch from e3272ea to 32d694a Compare October 13, 2026 19:01
@zaniebot
zaniebot deployed to automations October 13, 2026 19:02 — with GitHub Actions Active
@zaniebot
zaniebot deployed to automations October 13, 2026 19:26 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
automations — d50d3db9 Deployed Oct 13, 2026 by zaniebot via review-code-quality / code quality review #9782
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant