Skip to content

Commit a13e3f5

Browse files
Avoid reusing interpreter metadata when running under Rosetta (#9846)
## Summary Closes #9836.
1 parent c0f8e20 commit a13e3f5

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

crates/uv-cache/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ impl CacheBucket {
784784
Self::SourceDistributions => "sdists-v6",
785785
Self::FlatIndex => "flat-index-v2",
786786
Self::Git => "git-v0",
787-
Self::Interpreter => "interpreter-v3",
787+
Self::Interpreter => "interpreter-v4",
788788
// Note that when bumping this, you'll also need to bump it
789789
// in crates/uv/tests/cache_clean.rs.
790790
Self::Simple => "simple-v14",

crates/uv-python/src/interpreter.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use std::borrow::Cow;
2+
use std::env::consts::ARCH;
23
use std::io;
34
use std::path::{Path, PathBuf};
45
use std::process::{Command, ExitStatus};
@@ -746,7 +747,9 @@ impl InterpreterInfo {
746747

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

0 commit comments

Comments
 (0)