Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datadog-ci dsyms upload command doesn't recognize a dSYM file #2176

Open
arslaman opened this issue Jan 17, 2025 · 3 comments
Open

datadog-ci dsyms upload command doesn't recognize a dSYM file #2176

arslaman opened this issue Jan 17, 2025 · 3 comments
Assignees
Labels
awaiting response Waiting for response / confirmation from the reporter bug Something isn't working

Comments

@arslaman
Copy link

arslaman commented Jan 17, 2025

Describe the bug

I'm trying to manually upload a dsym file generated from a debug build (I set to build DWARF with dSYM File for the debug builds in Xcode).
When I run
npx @datadog/datadog-ci dsyms upload /Users/ruslan.mansurov/Library/Developer/Xcode/DerivedData/Odyssey-Generated-grmyszfovljfhnfrulrhgmaaqzkh/
it shows:

Starting upload with concurrency 20. 
Will look for dSYMs in /Users/ruslan.mansurov/Library/Developer/Xcode/DerivedData/Odyssey-Generated-grmyszfovljfhnfrulrhgmaaqzkh/
Once dSYMs upload is successful files will be processed and ready to use within the next 5 minutes.
Will use temporary intermediate directory: /var/folders/8w/3xm2s8gn19g2lv4ykdmz0k6c0000gn/T/4011640769112347.5/datadog-ci/dsyms/intermediate
Will use temporary upload directory: /var/folders/8w/3xm2s8gn19g2lv4ykdmz0k6c0000gn/T/4011640769112347.5/datadog-ci/dsyms/upload
⚠️ Failed to export 'arm64' arch (B30E4F2A-6577-3376-8A16-F79C9E555BD8) from /Users/ruslan.mansurov/Library/Developer/Xcode/DerivedData/Odyssey-Generated-grmyszfovljfhnfrulrhgmaaqzkh/Build/Products/Debug-iphoneos/Odyssey.app.dSYM
⚠️ Failed to export 'arm64' arch (5862C1C7-036B-366B-B0E8-53E6035D4FE8) from /Users/ruslan.mansurov/Library/Developer/Xcode/DerivedData/Odyssey-Generated-grmyszfovljfhnfrulrhgmaaqzkh/Build/Products/Debug-iphoneos/Odyssey.app.dSYM
⚠️ Failed to export 'arm64' arch (ECAF232F-F6F2-37CD-A678-B3D19F022115) from /Users/ruslan.mansurov/Library/Developer/Xcode/DerivedData/Odyssey-Generated-grmyszfovljfhnfrulrhgmaaqzkh/Build/Products/Debug-iphonesimulator/Odyssey.app.dSYM
⚠️ Failed to export 'arm64' arch (4B6EA0A7-4E0A-3EC4-8531-BC4E7CA74295) from /Users/ruslan.mansurov/Library/Developer/Xcode/DerivedData/Odyssey-Generated-grmyszfovljfhnfrulrhgmaaqzkh/Build/Products/Debug-iphonesimulator/Odyssey.app.dSYM
Uploading 0A9C45E3-7652-378F-B398-C6B9B8E0A0C3.zip (Lottie, arch: arm64, UUID: 0A9C45E3-7652-378F-B398-C6B9B8E0A0C3)
Uploading 7A3A4F68-AC13-305B-9557-58C941F800B7.zip (OdysseyUITests, arch: arm64, UUID: 7A3A4F68-AC13-305B-9557-58C941F800B7)
Uploading B65D0D3D-AB92-3580-A769-3BEE7D73C944.zip (Lottie, arch: x86_64, UUID: B65D0D3D-AB92-3580-A769-3BEE7D73C944)
Uploading D9343FA1-ABDE-380F-B233-94DC68F30B71.zip (Lottie, arch: arm64, UUID: D9343FA1-ABDE-380F-B233-94DC68F30B71)

Command summary:
✅ Uploaded 4 dSYMs in 7.579 seconds.

You can see that it successfully uploaded Lottie and OdysseyUITests dSYM files but not the Odyssey.app.dSYM which I'm interested in.

npx @datadog/datadog-ci --version shows 2.47.0.

When I manually compressed /Users/ruslan.mansurov/Library/Developer/Xcode/DerivedData/Odyssey-Generated-grmyszfovljfhnfrulrhgmaaqzkh/Build/Products/Debug-iphoneos/Odyssey.app.dSYM file and uploaded it to Firebase and forced a crash on my iPhone I was able to see the crash and the stacktrace on the Firebase, but for some reason datadog-ci doesn't like that dSYM file.

Reproduction steps

Run npx @datadog/datadog-ci dsyms upload command with a path to a directory containing dSYM files or a path to a compressed dSYM file.

SDK logs

⚠️ Failed to export 'arm64' arch (B30E4F2A-6577-3376-8A16-F79C9E555BD8) from /Users/ruslan.mansurov/Library/Developer/Xcode/DerivedData/Odyssey-Generated-grmyszfovljfhnfrulrhgmaaqzkh/Build/Products/Debug-iphoneos/Odyssey.app.dSYM

Expected behavior

Expected to see something like Uploading ...

Affected SDK versions

2.47.0

Latest working SDK version

0

Did you confirm if the latest SDK version fixes the bug?

Yes, I'm using the latest version of datadog-ci

Integration Methods

SPM

Xcode Version

16.2

MacOS Version

14.6.1

Deployment Target

iOS 15

@arslaman arslaman added the bug Something isn't working label Jan 17, 2025
@ncreated
Copy link
Member

Hey @arslaman 👋,

Thanks for reaching out! The error message could be more specific, but it points to this code in datadog-ci.

From your logs, it seems like you're dealing with a fat dSYM file (one that bundles multiple architectures). To better understand the issue, could you inspect the dSYM file and share the output of the following commands? Both dwarfdump and lipo should already be available if you have Xcode installed.

Step 1: Inspect the dSYM with dwarfdump

Run this command to list the UUIDs and architectures in the dSYM:

dwarfdump --uuid Odyssey.app.dSYM

This will output something like the following:

UUID: C8469F85-B060-3085-B69D-E46C645560EA (armv7) Odyssey.app.dSYM/Contents/Resources/DWARF/Odyssey
UUID: 06EE3D68-D605-3E92-B92D-2F48C02A505E (arm64) Odyssey.app.dSYM/Contents/Resources/DWARF/Odyssey

Step 2: Extract and Analyze Each Architecture with lipo

Next, you can use lipo to extract a specific architecture slice. For example, to extract the arm64 slice:

lipo Odyssey.app.dSYM/Contents/Resources/DWARF/Odyssey -thin arm64 -output extracted_arm64_slice

Here, the path Odyssey.app.dSYM/Contents/Resources/DWARF/Odyssey comes from the dwarfdump output.

What's Next

I suspect that datadog-ci might be encountering an issue while processing the lipo command. Getting the outputs from these commands will help us pinpoint the problem more effectively. Looking forward to your findings!

@ncreated ncreated self-assigned this Jan 20, 2025
@mariedm mariedm added the awaiting response Waiting for response / confirmation from the reporter label Jan 30, 2025
@arslaman
Copy link
Author

arslaman commented Jan 30, 2025

Hey ncreated, sorry, I didn't notice your response until today.

Running dwarfdump --uuid Odyssey.app.dSYM showed me this:

UUID: 836FB54A-1EC1-32D3-9D4E-D7B3034E1B0E (arm64) Odyssey.app.dSYM/Contents/Resources/DWARF/Odyssey.debug.dylib
UUID: 5862C1C7-036B-366B-B0E8-53E6035D4FE8 (arm64) Odyssey.app.dSYM/Contents/Resources/DWARF/Odyssey

Running the lipo command you provided on any of the 2 items give this result:

Debug-iphoneos % lipo Odyssey.app.dSYM/Contents/Resources/DWARF/Odyssey -thin arm64 -output extracted_arm64_slice
fatal error: /Applications/Xcode-16.2.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: input file (Odyssey.app.dSYM/Contents/Resources/DWARF/Odyssey) must be a fat file when the -thin option is specified
Debug-iphoneos % lipo Odyssey.app.dSYM/Contents/Resources/DWARF/Odyssey.debug.dylib -thin arm64 -output extracted_arm64_slice
fatal error: /Applications/Xcode-16.2.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: input file (Odyssey.app.dSYM/Contents/Resources/DWARF/Odyssey.debug.dylib) must be a fat file when the -thin option is specified

@mariedm
Copy link
Member

mariedm commented Jan 31, 2025

Hi @arslaman 👋

It looks like our tool assumes dSYMs are fat binaries when trying to thin them, which fails. I've filed a ticket so we can fix this.

In the meantime, you could try to convert your dSYM to a fat binary by adding a dummy slice to it:

# Create an empty file 
touch empty_slice

# Create a fat binary 
lipo -create Odyssey.app.dSYM/Contents/Resources/DWARF/Odyssey -arch x86_64 empty_slice -output Odyssey_fat

# Replace original file 
mv Odyssey_fat Odyssey.app.dSYM/Contents/Resources/DWARF/Odyssey

# Clean up empty file
rm empty_slice

And then try to upload again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting response Waiting for response / confirmation from the reporter bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants