Cover virtual environment interpreter caching through symlinks #2547
<!-- __CODSPEED_PERFORMANCE_REPORT_COMMENT__ -->
Merging this PR will not alter performance
<details>
<summary>:warning: <b>8 benchmarks spent significant time in system calls</b></summary>
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
> - `install_wheel_many_files
-unpack_sdist_many_files
-resolve_warm_airflow
-run_python_version_synthetic_workspace
-resolve_warm_jupyter
-discover_workspace_from_all_members_with_excludes
-resolve_warm_jupyter_universal
-discover_workspace_from_all_members
</details>
✅ 54 untouched benchmarks ⏩ 35` skipped benchmarks[^skipped]
---
<sub>Comparing <code>automations/reproduce-bug/22383</code> (32d694a) with <code>main</code> (06bf2e8)[^unexpected-base]</sub>
<a href="https://app.codspeed.io/astral-sh/uv-dev/branches/automations%2Freproduce-bug%2F22383?utm_source=github&utm_medium=comment-v2&utm_content=button">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://codspeed.io/pr-report/open-in-codspeed-dark.svg">
<source media="(prefers-color-scheme: light)" srcset="https://codspeed.io/pr-report/open-in-codspeed-light.svg">
<img alt="Open in CodSpeed" src="https://codspeed.io/pr-report/open-in-codspeed-light.svg" width="169" height="32">
</picture>
</a>
[^skipped]: 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.
[^unexpected-base]: No successful run was found on <code>zb/restore-interpreter-cache-warming</code> (e83627b) during the generation of this report, so <code>main</code> (06bf2e8) was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.
[P3] Check cached metadata at the symlink-resolution limit
This invocation bypasses uv’s interpreter cache, and print('ok') does not observe CPython’s base-executable fallback. An incorrect inferred sys_base_executable would therefore pass, leaving the cache behavior at this boundary uncharacterized. Load the created environment using the populated cache and a fresh cache, then snapshot their base executables as in the preceding symlink tests.
It seems kind of weird to test a negative here, i.e. test something that can't happen (v5 bump means we'll always miss this fake v4 entry)
woodruffw
astral-automations-bot[bot]
Characterize interpreter-cache behavior for symlinked Python executables, including environment recreation, absolute symlink targets, and the executable-symlink limit. Keep regular executables and parent environments as separate controls, and expose stale base paths retained in
interpreter-v4.Refs astral-sh/uv#22383.
Stacked on astral-sh/uv#22524.