Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid reusing interpreter metadata when running under Rosetta #9846

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/uv-cache/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ impl CacheBucket {
Self::SourceDistributions => "sdists-v6",
Self::FlatIndex => "flat-index-v2",
Self::Git => "git-v0",
Self::Interpreter => "interpreter-v3",
Self::Interpreter => "interpreter-v4",
// Note that when bumping this, you'll also need to bump it
// in crates/uv/tests/cache_clean.rs.
Self::Simple => "simple-v14",
Expand Down
5 changes: 4 additions & 1 deletion crates/uv-python/src/interpreter.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::borrow::Cow;
use std::env::consts::ARCH;
use std::io;
use std::path::{Path, PathBuf};
use std::process::{Command, ExitStatus};
Expand Down Expand Up @@ -746,7 +747,9 @@ impl InterpreterInfo {

let cache_entry = cache.entry(
CacheBucket::Interpreter,
"",
// Shard interpreter metadata by host architecture, to avoid cache collisions when
// running universal binaries under Rosetta.
ARCH,
// We use the absolute path for the cache entry to avoid cache collisions for relative
// paths. But we don't to query the executable with symbolic links resolved.
format!("{}.msgpack", cache_digest(&absolute)),
Expand Down
Loading