`debug-files upload` fails on a fat Mach-O dSYM with "Object contains 2 architectures (1 expected)"

已关闭
#1,819 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

已经有一个关联 PR 被合并了。

  • #1849 来自 @sentry-junior —— 已合并

评估

难度
3/5
预计耗时
1-2 天
新手友好度
50/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python, typescript
领域
cli

调研方向

Start in matchedDif in packages/cli/src/lib/dif/scan.ts, which uploads the whole fat Mach-O as one DIF under the first object's debug id. The legacy archive.objects() loop in src/utils/dif_upload/mod.rs shows the per-slice approach. Done when a fat dSYM uploads one file per architecture with its own debug id and the "Object contains 2 architectures" error no longer appears; check create_dif_from_id in src/sentry/models/debugfile.py to confirm what the server accepts.

由索引模型根据 Issue 内容生成。

描述

On macOS with sentry 0.45.0 and current main, a watchOS app built with Xcode for arm64 and arm64_32 produces a fat Mach-O dSYM with two slices:

$ dwarfdump --uuid FooWatch.app.dSYM/Contents/Resources/DWARF/FooWatch
UUID: 8C4CD4E7-DB7C-3AC8-BC5B-605AF57BD7E2 (arm64) ...
UUID: 46FC586D-B173-37C8-B1CD-34D3CBEFF085 (arm64_32) ...

$ sentry debug-files upload --wait-for 300 FooWatch.app.dSYM
│ DIF │ 8c4cd4e7-db7c-3ac8-bc5b-605af57bd7e2  FooWatch  [error] │
1 file had failures: 8c4cd4e7-db7c-3ac8-bc5b-605af57bd7e2: error (Object contains 2 architectures (1 expected)).

matchedDif in packages/cli/src/lib/dif/scan.ts uploads the whole fat file as one DIF under the debug id of the first object. The server's assemble step, create_dif_from_id in src/sentry/models/debugfile.py, accepts only one object per file and rejects it. The second slice never reaches Sentry.

The legacy sentry-cli makes one upload per object of a fat archive (the archive.objects() loop in src/utils/dif_upload/mod.rs), so each slice gets its own debug id. Splitting the file first with lipo <file> -thin <arch> -output <out> works: both thin files come back [ok].

主要语言
TypeScript
星标
957
派生
174
平均合并
22 小时 56 分钟
30 天内合并 PR
345

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

getsentry/toolkit 的其他 Issue

查看 getsentry/toolkit 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。