unsloth/tests/sh
Daniel Han 70d4cc4885 fix(install): rebuild x86_64 (Rosetta) venv as arm64 on Apple Silicon
On Apple Silicon, uv can create the Studio venv from a cached x86_64
Python (for example when uv itself is an x86_64 build) even though the
shell reports arm64, so MAC_INTEL stays false. The venv then reports
x86_64 to wheel resolvers and, because the PyTorch CPU index ships no
macOS wheels for any architecture, the torch install fails with:

  torch>=2.6.0,... has no wheels with a matching platform tag
  (e.g. macosx_26_0_x86_64)

The existing arm64 guard only handled the Python 3.13.8 torch import
bug. Extend it to also detect a venv whose platform.machine() is x86_64
on an arm64 host and recreate it with uv's arch-explicit selector
cpython-<ver>-macos-aarch64-none. The two checks run sequentially with a
re-inspection between them, so a venv that is x86_64 and lands on 3.13.8
after the arm64 rebuild is still downgraded to 3.12. Both are skipped
when the user passed --python.

Adds an Apple Silicon venv rebuild section to
tests/sh/test_mac_intel_compat.sh.

Supersedes #5187; credit to Ramakrishna Bachu (@ramankrishna).
2026-05-31 05:03:24 +00:00
..
test_get_torch_index_url.sh fix/strix halo and windows AMD ROCm support (#5301) 2026-05-29 22:29:56 -07:00
test_install_host_defaults.sh Default Studio host to 127.0.0.1 and prompt before auto-start (#5267) 2026-05-04 13:03:16 +04:00
test_mac_intel_compat.sh fix(install): rebuild x86_64 (Rosetta) venv as arm64 on Apple Silicon 2026-05-31 05:03:24 +00:00
test_nvcc_meets_llama_minimum.sh studio/setup.sh: cope with fresh CUDA toolkits like 13.3 (#5826) 2026-05-29 05:09:20 -07:00
test_tauri_install_exit_order.sh Add tauri (#5144) 2026-04-23 04:50:10 -07:00
test_torch_constraint.sh fix(tests/sh): accept pinned tokenizers line after #5359 (#5361) 2026-05-11 02:58:20 -07:00