-
released this
2026-06-03 16:29:18 +02:00 | 976 commits to main since this releaseFix macOS Apple Silicon installs resolving torch against x86_64 (#5976)
- Fix macOS Apple Silicon installs that resolve torch against x86_64
On Apple Silicon,
uv venv --python 3.13can reuse a cached x86_64
(Rosetta) CPython, often because uv itself is an x86_64 build. The
resulting venv reports macosx_*x86_64 to the wheel resolver, but PyTorch
has shipped no macOS x86_64 wheels since 2.2.2, so the torch install fails
with "no wheels with a matching platform tag (macosx..._x86_64)".Two changes, both scoped to macOS arm64 and additive (no other install
path is affected):- Create the venv with an arch-explicit
cpython-X.Y-macos-aarch64-none
request on Apple Silicon (no --python override), so uv cannot fall back
to a cached x86_64 interpreter. - Harden the existing x86_64 venv guard: when the venv python cannot be
executed (x86_64 binary on a Mac without Rosetta), the platform.machine()
probe returns empty and the recreate was silently skipped. Fall back to
reading the binary's Mach-O arch via lipo/file so migrated or
pre-existing x86_64 venvs are still recreated as arm64.
- Harden arm64 static-arch fallback: file -L and set -e safety
Address review feedback on the lipo/file fallback:
- uv symlinks the venv's bin/python to the base interpreter; plain
file
reports the symlink ("symbolic link to ...") and the arch substring never
matches. Usefile -Lto dereference (lipo already follows the link). - Append
|| trueso the command substitution cannot abort the installer
under set -e on a Mac that has neither lipo nor file.
Co-authored-by: danielhanchen michaelhan2050@gmail.com
Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
0 downloads