Skip to content

Commit 4271e21

Browse files
runningcodeclaude
andauthored
fix(build): Improve error for xcarchive/IPA uploads on non-ARM64 (#3211)
## Summary - When users upload `.xcarchive` or `.ipa` files from a non-Apple Silicon Mac (e.g. Intel-based Xcode Cloud), the error now clearly states the Apple Silicon requirement instead of showing a confusing message that only lists Android formats (APK, AAB). Fixes EME-951 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 824533a commit 4271e21

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
### Fixes
2222

2323
- Accept ProGuard mapping files without line information instead of rejecting them ([#3192](https://github.com/getsentry/sentry-cli/pull/3192)).
24+
- Improve error message when uploading `.xcarchive` or `.ipa` files on non-Apple Silicon Macs ([#3211](https://github.com/getsentry/sentry-cli/pull/3211)).
2425

2526
### Experimental Feature 🧑‍🔬 (internal-only)
2627

src/commands/build/upload.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,20 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
143143
return Err(anyhow!("Path does not exist: {}", path.display()));
144144
}
145145

146+
// On non-Apple Silicon, reject xcarchive/IPA early before trying to
147+
// open the path as a file (xcarchive is a directory, so ByteView::open
148+
// would fail with a confusing I/O error).
149+
#[cfg(not(all(target_os = "macos", target_arch = "aarch64")))]
150+
{
151+
let ext = path.extension().and_then(|e| e.to_str()).unwrap_or("");
152+
if ext.eq_ignore_ascii_case("xcarchive") || ext.eq_ignore_ascii_case("ipa") {
153+
return Err(anyhow!(
154+
"Uploading XCArchive and IPA files requires an Apple Silicon Mac: {}",
155+
path.display()
156+
));
157+
}
158+
}
159+
146160
let byteview = ByteView::open(path)?;
147161
debug!("Loaded file with {} bytes", byteview.len());
148162

@@ -301,6 +315,7 @@ fn validate_is_supported_build(path: &Path, bytes: &[u8]) -> Result<()> {
301315
}
302316

303317
debug!("File format validation failed");
318+
304319
#[cfg(all(target_os = "macos", target_arch = "aarch64"))]
305320
let format_list = "APK, AAB, XCArchive, or IPA";
306321
#[cfg(not(all(target_os = "macos", target_arch = "aarch64")))]
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
```
2+
$ sentry-cli build upload tests/integration/_fixtures/build/ipa.ipa
3+
? failed
4+
error: Uploading XCArchive and IPA files requires an Apple Silicon Mac: tests/integration/_fixtures/build/ipa.ipa
5+
6+
Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
7+
Please attach the full debug log to all bug reports.
8+
9+
```

tests/integration/build/upload.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ fn command_build_upload_no_path() {
2626
TestManager::new().register_trycmd_test("build/build-upload-no-path.trycmd");
2727
}
2828

29+
#[cfg(not(all(target_os = "macos", target_arch = "aarch64")))]
30+
#[test]
31+
fn command_build_upload_ipa_not_arm64() {
32+
TestManager::new()
33+
.register_trycmd_test("build/build-upload-ipa-not-arm64.trycmd")
34+
.with_default_token();
35+
}
36+
2937
#[test]
3038
fn command_build_upload_invalid_aab() {
3139
TestManager::new()

0 commit comments

Comments
 (0)