From 2de987ed37af1dcc4791e5d7d2d38f3ab1952a8d Mon Sep 17 00:00:00 2001 From: Zsolt Dollenstein Date: Wed, 12 Nov 2025 13:48:16 +0000 Subject: [PATCH] Skip python_install_emulated_macos except on ARM64 macos with rosetta (#16687) ## Summary This test isn't useful on non-arm64 macs, and it outright fails if rosetta isn't installed. ## Test Plan Run it on my rosetta-stripped macbook --- crates/uv/tests/it/python_install.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/crates/uv/tests/it/python_install.rs b/crates/uv/tests/it/python_install.rs index a8302e3e4..5cd76d8e8 100644 --- a/crates/uv/tests/it/python_install.rs +++ b/crates/uv/tests/it/python_install.rs @@ -2694,7 +2694,7 @@ fn python_install_no_cache() { "); } -#[cfg(target_os = "macos")] +#[cfg(all(target_os = "macos", target_arch = "aarch64"))] #[test] fn python_install_emulated_macos() { let context: TestContext = TestContext::new_with_versions(&[]) @@ -2702,6 +2702,20 @@ fn python_install_emulated_macos() { .with_managed_python_dirs() .with_python_download_cache(); + let arch_status = Command::new("/usr/bin/arch") + .arg("-x86_64") + .arg("true") + .status(); + if !arch_status.is_ok_and(|x| x.success()) { + // Rosetta is not available to run the x86_64 interpreter + // fail the test in CI, otherwise skip it + if env::var("CI").is_ok() { + panic!("x86_64 emulation is not available on this CI runner"); + } + debug!("Skipping test because x86_64 emulation is not available"); + return; + } + // Before installation, `uv python list` should not show the x86_64 download uv_snapshot!(context.filters(), context.python_list().arg("3.13"), @r" success: true