From 32a0cb50d5b17dacdc7b7e771b077851c8821a60 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Thu, 12 Mar 2026 11:25:29 +0100 Subject: [PATCH 1/3] fix(build): Improve error for xcarchive/IPA uploads on non-ARM64 When users try to upload .xcarchive or .ipa files from a non-Apple Silicon Mac (e.g. Intel-based Xcode Cloud), they get a confusing error that only mentions Android formats (APK, AAB). The real reason is that xcarchive/IPA processing is compile-time gated to ARM64 macOS. Add a targeted check on non-ARM64 platforms that detects these file extensions and returns a clear error explaining the Apple Silicon requirement. EME-951 Co-Authored-By: Claude Opus 4.6 (1M context) --- src/commands/build/upload.rs | 12 ++++++++++++ .../_cases/build/build-upload-ipa-not-arm64.trycmd | 9 +++++++++ tests/integration/build/upload.rs | 8 ++++++++ 3 files changed, 29 insertions(+) create mode 100644 tests/integration/_cases/build/build-upload-ipa-not-arm64.trycmd diff --git a/src/commands/build/upload.rs b/src/commands/build/upload.rs index 96701b74e5..135106bac8 100644 --- a/src/commands/build/upload.rs +++ b/src/commands/build/upload.rs @@ -542,6 +542,18 @@ fn validate_is_supported_build(path: &Path, bytes: &[u8]) -> Result<()> { } debug!("File format validation failed"); + + #[cfg(not(all(target_os = "macos", target_arch = "aarch64")))] + { + let ext = path.extension().and_then(|e| e.to_str()).unwrap_or(""); + if ext.eq_ignore_ascii_case("xcarchive") || ext.eq_ignore_ascii_case("ipa") { + return Err(anyhow!( + "Uploading XCArchive and IPA files requires an Apple Silicon Mac: {}", + path.display() + )); + } + } + #[cfg(all(target_os = "macos", target_arch = "aarch64"))] let format_list = "APK, AAB, XCArchive, or IPA"; #[cfg(not(all(target_os = "macos", target_arch = "aarch64")))] diff --git a/tests/integration/_cases/build/build-upload-ipa-not-arm64.trycmd b/tests/integration/_cases/build/build-upload-ipa-not-arm64.trycmd new file mode 100644 index 0000000000..8975f3d9d1 --- /dev/null +++ b/tests/integration/_cases/build/build-upload-ipa-not-arm64.trycmd @@ -0,0 +1,9 @@ +``` +$ sentry-cli build upload tests/integration/_fixtures/build/ipa.ipa +? failed +error: Uploading XCArchive and IPA files requires an Apple Silicon Mac: tests/integration/_fixtures/build/ipa.ipa + +Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output. +Please attach the full debug log to all bug reports. + +``` diff --git a/tests/integration/build/upload.rs b/tests/integration/build/upload.rs index 94c2dfd294..3a07ddb4b6 100644 --- a/tests/integration/build/upload.rs +++ b/tests/integration/build/upload.rs @@ -26,6 +26,14 @@ fn command_build_upload_no_path() { TestManager::new().register_trycmd_test("build/build-upload-no-path.trycmd"); } +#[cfg(not(all(target_os = "macos", target_arch = "aarch64")))] +#[test] +fn command_build_upload_ipa_not_arm64() { + TestManager::new() + .register_trycmd_test("build/build-upload-ipa-not-arm64.trycmd") + .with_default_token(); +} + #[test] fn command_build_upload_invalid_aab() { TestManager::new() From 805ed87010bbb81d8aa9fd40db55202e104380ac Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Thu, 12 Mar 2026 11:28:04 +0100 Subject: [PATCH 2/3] docs(changelog): Add entry for xcarchive/IPA error improvement (#3211) Co-Authored-By: Claude Opus 4.6 (1M context) --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 982b5375fe..afc56191c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Fixes - Accept ProGuard mapping files without line information instead of rejecting them ([#3192](https://github.com/getsentry/sentry-cli/pull/3192)). +- Improve error message when uploading `.xcarchive` or `.ipa` files on non-Apple Silicon Macs ([#3211](https://github.com/getsentry/sentry-cli/pull/3211)). ### Experimental Feature 🧑‍🔬 (internal-only) From 07c0b768bdd797c2893e5eaa6d58722db0cb0c94 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Thu, 12 Mar 2026 12:07:38 +0100 Subject: [PATCH 3/3] fix(build): Check xcarchive/IPA extension before ByteView::open MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ByteView::open() calls File::open() internally, which fails with a generic I/O error on directories. Since .xcarchive is a directory bundle, the previous validation in validate_is_supported_build() was unreachable — users on non-Apple Silicon got a confusing "Is a directory" error instead of the intended helpful message. Move the extension check before ByteView::open() so the clear error message is shown. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/commands/build/upload.rs | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/commands/build/upload.rs b/src/commands/build/upload.rs index 135106bac8..27b4b03cca 100644 --- a/src/commands/build/upload.rs +++ b/src/commands/build/upload.rs @@ -209,6 +209,20 @@ pub fn execute(matches: &ArgMatches) -> Result<()> { return Err(anyhow!("Path does not exist: {}", path.display())); } + // On non-Apple Silicon, reject xcarchive/IPA early before trying to + // open the path as a file (xcarchive is a directory, so ByteView::open + // would fail with a confusing I/O error). + #[cfg(not(all(target_os = "macos", target_arch = "aarch64")))] + { + let ext = path.extension().and_then(|e| e.to_str()).unwrap_or(""); + if ext.eq_ignore_ascii_case("xcarchive") || ext.eq_ignore_ascii_case("ipa") { + return Err(anyhow!( + "Uploading XCArchive and IPA files requires an Apple Silicon Mac: {}", + path.display() + )); + } + } + let byteview = ByteView::open(path)?; debug!("Loaded file with {} bytes", byteview.len()); @@ -543,17 +557,6 @@ fn validate_is_supported_build(path: &Path, bytes: &[u8]) -> Result<()> { debug!("File format validation failed"); - #[cfg(not(all(target_os = "macos", target_arch = "aarch64")))] - { - let ext = path.extension().and_then(|e| e.to_str()).unwrap_or(""); - if ext.eq_ignore_ascii_case("xcarchive") || ext.eq_ignore_ascii_case("ipa") { - return Err(anyhow!( - "Uploading XCArchive and IPA files requires an Apple Silicon Mac: {}", - path.display() - )); - } - } - #[cfg(all(target_os = "macos", target_arch = "aarch64"))] let format_list = "APK, AAB, XCArchive, or IPA"; #[cfg(not(all(target_os = "macos", target_arch = "aarch64")))]