Repository navigation
Heal interpreter metadata cache entries when creating a virtual environment indicates corruption - #617
Closed
zaniebot wants to merge 3 commits into
Closed
Heal interpreter metadata cache entries when creating a virtual environment indicates corruption#617zaniebot wants to merge 3 commits into
zaniebot wants to merge 3 commits into
Conversation
zanie-oai
reviewed
Aug 12, 2026
| } | ||
|
|
||
| /// Query the interpreter directly and update its cached metadata. | ||
| pub fn query_fresh(executable: impl AsRef<Path>, cache: &Cache) -> Result<Self, Error> { |
There was a problem hiding this comment.
I think we'd call this query_with_refresh?
There was a problem hiding this comment.
Though I wonder why we don't just make query_with_cache pub?
zanie-oai
reviewed
Aug 12, 2026
Comment on lines
+12637
to
+12639
| // Replace only exact MessagePack strings, preserving path fields and the executable ctime. | ||
| let mut encoded_version = vec![0xa0 | u8::try_from(actual_version.len())?]; | ||
| encoded_version.extend_from_slice(actual_version.as_bytes()); |
There was a problem hiding this comment.
This test case approach seems pretty questionable?
zanieb
reviewed
Aug 12, 2026
| ) { | ||
| ); | ||
|
|
||
| // A launcher's shared library can change without updating the executable timestamp used to |
Member
There was a problem hiding this comment.
I think we're over-specifying here? Can we just say that the cache can be corrupted?
zanieb
marked this pull request as ready for review
August 12, 2026 15:38
|
Promoted to #21073. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a system Python changes its loaded
libpythonwithout changing the launcher, its cached version can disagree with the interpreter already running inside a project environment.uvthen repeatedly recreates the environment with stalepyvenv.cfgmetadata and can evaluaterequires-pythonagainst the wrong version. Refresh the base interpreter's persistent metadata only when an existing environment has apyvenv.cfgversion conflict and the same underlying interpreter reports a different cached version, so subsequent discovery and environment creation use the actual interpreter while genuine incompatibilities retain their existing behavior.Fixes astral-sh#21066.