Due to an (unconfirmed) bug in Xcode (https://developer.apple.com/forums/thread/659187), 0 byte dSYMs can be generated by Xcode. These show up as filename.dSYMfiles rather than dirname.dSYMdirectories (which contain the DWARF data of interest, normally).
Design
Adds a check for whether each dSYM is a file (and additionally calculates its size if so for support purposes)
Prompts the user to run with --verbose if failures or warnings are presented.
Changeset
Main bugsnag-dsym-upload binary is modified to catch dSYM files, and throw warning.
Changed calls of Bundler.with_clean_env to Bundler.with_unbundled_env due to deprecation.
Further consideration
If not in verbose mode, the warnings won't be shown β should these be shown regardless of verbosity?
Should DWARF files without UUID also be considered warnings instead of failures?
Should dSYMS with missing DWARF files be considered warnings instead of failures?
Testing
Updated automated tests to throw examples of 0b dSYMs and show they're skipped without causing an error code to be thrown
Additionally added automated test for missing DWARF data dSYMs (these do throw errors, exit code 1)
CLI
Manually tested with 4 different dSYM folders:
dsym_test_ok: contains one dSYM with known acceptable DWARF data
Checking exit code of last command run (expecting `0`):
echo $?
0
* `dsym_test_warning`: contains one dSYM file that's 0 bytes
$ ./bugsnag-dsym-upload --verbose --api-key 0c0ea7242a829310a625f599db2e5752 ./dsyms_test_warning
Uploading files to https://upload.bugsnag.com
Preparing to upload ./dsyms_test_warning/REDACTED.framework.ios-x86_64-maccatalyst.dSYM
Skipping ./dsyms_test_warning/REDACTED.framework.ios-x86_64-maccatalyst.dSYM as it's is a file (0 bytes), not a directory with DWARF data
1 file(s) failed to upload with warnings
Re-run the bugsnag-dsym-upload tool with the --verbose option for more information
Checking exit code of last command run (expecting `0`):
echo $?
0
* `dsym_test_error`: contains one dSYM with DWARF data removed (manually deleted)
$ ./bugsnag-dsym-upload --verbose --api-key 0c0ea7242a829310a625f599db2e5752 ./dsyms_test_error
Uploading files to https://upload.bugsnag.com
Preparing to upload ./dsyms_test_error/bugsnag-example.app.dSYM
Skipping file without UUID: ./dsyms_test_error/bugsnag-example.app.dSYM/Contents/Resources/DWARF/*
1 file(s) failed to upload with errors
Re-run the bugsnag-dsym-upload tool with the --verbose option for more information
Checking exit code of last command run (expecting `1`):
echo $?
1
* `dsym_test`: contains 3 dSYMS from each of the directories above
Preparing to upload ./dsyms_test/REDACTED.framework.ios-x86_64-maccatalyst.dSYM
Skipping ./dsyms_test/REDACTED.framework.ios-x86_64-maccatalyst.dSYM as it's is a file (0 bytes), not a directory with DWARF data
Preparing to upload ./dsyms_test/bugsnag-example.app.dSYM
Skipping file without UUID: ./dsyms_test/bugsnag-example.app.dSYM/Contents/Resources/DWARF/*
1 file(s) uploaded successfully
1 file(s) failed to upload with warnings
1 file(s) failed to upload with errors
Re-run the bugsnag-dsym-upload tool with the --verbose option for more information
Checking exit code of last command run (expecting `1`):
echo $?
1
### Fastlane
This change affects Fastlane as the exit code is being manipulated. Using the same directories as above, and pointing the `Fastfile` to each directory independently:
* `dsym_test_ok`: contains one dSYM with known acceptable DWARF data
$ bundle exec fastlane ios release --verbose
...
DEBUG [2021-04-06 15:41:45.63]: Uploading dSYMs to Bugsnag with the following parameters:
DEBUG [2021-04-06 15:41:45.63]: api_key: 0c0ea7242a829310a625f599db2e5752
DEBUG [2021-04-06 15:41:45.63]: dsym_path: ["./dsyms_test_ok"]
...
Uploading files to https://upload.bugsnag.com
Preparing to upload ./dsyms_test_ok/Bugsnag.framework.dSYM
Uploading UUID: E599CF69-D848-3ED2-9093-68A44234CFCF (armv7) ./dsyms_test_ok/Bugsnag.framework.dSYM/Contents/Resources/DWARF/Bugsnag UUID: 40112A5E-4A23-37EC-9A5D-95AF2C18AE39 (arm64) ./dsyms_test_ok/Bugsnag.framework.dSYM/Contents/Resources/DWARF/Bugsnag
1 file(s) uploaded successfully
INFO [2021-04-06 15:41:48.21]: Uploaded dSYMs in ./dsyms_test_ok
...
INFO [2021-04-06 15:41:48.21]: fastlane.tools finished successfully π
DEBUG [2021-04-06 15:41:48.21]: All plugins are up to date
* `dsym_test_warning`: contains one dSYM file that's 0 bytes
$ bundle exec fastlane ios release --verbose
...
DEBUG [2021-04-06 15:43:57.28]: Uploading dSYMs to Bugsnag with the following parameters:
DEBUG [2021-04-06 15:43:57.28]: api_key: 0c0ea7242a829310a625f599db2e5752
DEBUG [2021-04-06 15:43:57.28]: dsym_path: ["./dsyms_test_warning"]
...
Uploading files to https://upload.bugsnag.com
Preparing to upload ./dsyms_test_warning/REDACTED.framework.ios-x86_64-maccatalyst.dSYM
[WARNING] Skipping ./dsyms_test_warning/REDACTED.framework.ios-x86_64-maccatalyst.dSYM as it's is a file (0 bytes), not a directory with DWARF data
1 file(s) failed to upload with warnings
Re-run the bugsnag-dsym-upload tool with the --verbose option for more information
...
INFO [2021-04-06 15:43:57.30]: fastlane.tools finished successfully π
* `dsym_test_error`: contains one dSYM with DWARF data removed (manually deleted)
$ bundle exec fastlane ios release --verbose
...
DEBUG [2021-04-06 15:47:12.39]: Uploading dSYMs to Bugsnag with the following parameters:
DEBUG [2021-04-06 15:47:12.39]: api_key: 0c0ea7242a829310a625f599db2e5752
DEBUG [2021-04-06 15:47:12.39]: dsym_path: ["./dsyms_test_error"]
...
Uploading files to https://upload.bugsnag.com
Preparing to upload ./dsyms_test_error/bugsnag-example.app.dSYM
[ERROR] Skipping file without UUID: ./dsyms_test_error/bugsnag-example.app.dSYM/Contents/Resources/DWARF/*
1 file(s) failed to upload with errors
Re-run the bugsnag-dsym-upload tool with the --verbose option for more information
...
ERROR [2021-04-06 15:47:12.41]: Failed uploading ./dsyms_test_error
...
FastlaneCore::Interface::FastlaneError: [!] Failed uploading ./dsyms_test_error
* `dsym_test`: contains 3 dSYMS from each of the directories above
$ bundle exec fastlane ios release --verbose
...
DEBUG [2021-04-06 15:50:34.36]: Uploading dSYMs to Bugsnag with the following parameters:
DEBUG [2021-04-06 15:50:34.36]: api_key: 0c0ea7242a829310a625f599db2e5752
DEBUG [2021-04-06 15:50:34.36]: dsym_path: ["./dsyms_test"]
...
Uploading files to https://upload.bugsnag.com
Preparing to upload ./dsyms_test/Bugsnag.framework.dSYM
Uploading UUID: E599CF69-D848-3ED2-9093-68A44234CFCF (armv7) ./dsyms_test/Bugsnag.framework.dSYM/Contents/Resources/DWARF/Bugsnag UUID: 40112A5E-4A23-37EC-9A5D-95AF2C18AE39 (arm64) ./dsyms_test/Bugsnag.framework.dSYM/Contents/Resources/DWARF/Bugsnag
Preparing to upload ./dsyms_test/REDACTED.framework.ios-x86_64-maccatalyst.dSYM
[WARNING] Skipping ./dsyms_test/REDACTED.framework.ios-x86_64-maccatalyst.dSYM as it's is a file (0 bytes), not a directory with DWARF data
Preparing to upload ./dsyms_test/bugsnag-example.app.dSYM
[ERROR] Skipping file without UUID: ./dsyms_test/bugsnag-example.app.dSYM/Contents/Resources/DWARF/*
1 file(s) uploaded successfully
1 file(s) failed to upload with warnings
1 file(s) failed to upload with errors
Re-run the bugsnag-dsym-upload tool with the --verbose option for more information
...
FastlaneCore::Interface::FastlaneError: [!] Failed uploading ./dsyms_test
Goal
Due to an (unconfirmed) bug in Xcode (https://developer.apple.com/forums/thread/659187), 0 byte dSYMs can be generated by Xcode. These show up as
filename.dSYM
files rather thandirname.dSYM
directories (which contain the DWARF data of interest, normally).Design
--verbose
if failures or warnings are presented.Changeset
bugsnag-dsym-upload
binary is modified to catch dSYM files, and throw warning.Bundler.with_clean_env
toBundler.with_unbundled_env
due to deprecation.Further consideration
Testing
CLI
Manually tested with 4 different dSYM folders:
dsym_test_ok
: contains one dSYM with known acceptable DWARF data1 file(s) uploaded successfully
echo $? 0
$ ./bugsnag-dsym-upload --verbose --api-key 0c0ea7242a829310a625f599db2e5752 ./dsyms_test_warning Uploading files to https://upload.bugsnag.com Preparing to upload ./dsyms_test_warning/REDACTED.framework.ios-x86_64-maccatalyst.dSYM Skipping ./dsyms_test_warning/REDACTED.framework.ios-x86_64-maccatalyst.dSYM as it's is a file (0 bytes), not a directory with DWARF data 1 file(s) failed to upload with warnings Re-run the bugsnag-dsym-upload tool with the --verbose option for more information
echo $? 0
$ ./bugsnag-dsym-upload --verbose --api-key 0c0ea7242a829310a625f599db2e5752 ./dsyms_test_error
Uploading files to https://upload.bugsnag.com Preparing to upload ./dsyms_test_error/bugsnag-example.app.dSYM Skipping file without UUID: ./dsyms_test_error/bugsnag-example.app.dSYM/Contents/Resources/DWARF/* 1 file(s) failed to upload with errors Re-run the bugsnag-dsym-upload tool with the --verbose option for more information
echo $? 1
$ ./bugsnag-dsym-upload --verbose --api-key 0c0ea7242a829310a625f599db2e5752 ./dsyms_test
Uploading files to https://upload.bugsnag.com Preparing to upload ./dsyms_test/Bugsnag.framework.dSYM Uploading UUID: E599CF69-D848-3ED2-9093-68A44234CFCF (armv7) ./dsyms_test/Bugsnag.framework.dSYM/Contents/Resources/DWARF/Bugsnag UUID: 40112A5E-4A23-37EC-9A5D-95AF2C18AE39 (arm64) ./dsyms_test/Bugsnag.framework.dSYM/Contents/Resources/DWARF/Bugsnag
Preparing to upload ./dsyms_test/REDACTED.framework.ios-x86_64-maccatalyst.dSYM Skipping ./dsyms_test/REDACTED.framework.ios-x86_64-maccatalyst.dSYM as it's is a file (0 bytes), not a directory with DWARF data Preparing to upload ./dsyms_test/bugsnag-example.app.dSYM Skipping file without UUID: ./dsyms_test/bugsnag-example.app.dSYM/Contents/Resources/DWARF/* 1 file(s) uploaded successfully 1 file(s) failed to upload with warnings 1 file(s) failed to upload with errors Re-run the bugsnag-dsym-upload tool with the --verbose option for more information
echo $? 1
$ bundle exec fastlane ios release --verbose ... DEBUG [2021-04-06 15:41:45.63]: Uploading dSYMs to Bugsnag with the following parameters: DEBUG [2021-04-06 15:41:45.63]: api_key: 0c0ea7242a829310a625f599db2e5752 DEBUG [2021-04-06 15:41:45.63]: dsym_path: ["./dsyms_test_ok"] ... Uploading files to https://upload.bugsnag.com Preparing to upload ./dsyms_test_ok/Bugsnag.framework.dSYM Uploading UUID: E599CF69-D848-3ED2-9093-68A44234CFCF (armv7) ./dsyms_test_ok/Bugsnag.framework.dSYM/Contents/Resources/DWARF/Bugsnag UUID: 40112A5E-4A23-37EC-9A5D-95AF2C18AE39 (arm64) ./dsyms_test_ok/Bugsnag.framework.dSYM/Contents/Resources/DWARF/Bugsnag
1 file(s) uploaded successfully INFO [2021-04-06 15:41:48.21]: Uploaded dSYMs in ./dsyms_test_ok ... INFO [2021-04-06 15:41:48.21]: fastlane.tools finished successfully π DEBUG [2021-04-06 15:41:48.21]: All plugins are up to date
$ bundle exec fastlane ios release --verbose ... DEBUG [2021-04-06 15:43:57.28]: Uploading dSYMs to Bugsnag with the following parameters: DEBUG [2021-04-06 15:43:57.28]: api_key: 0c0ea7242a829310a625f599db2e5752 DEBUG [2021-04-06 15:43:57.28]: dsym_path: ["./dsyms_test_warning"] ... Uploading files to https://upload.bugsnag.com Preparing to upload ./dsyms_test_warning/REDACTED.framework.ios-x86_64-maccatalyst.dSYM [WARNING] Skipping ./dsyms_test_warning/REDACTED.framework.ios-x86_64-maccatalyst.dSYM as it's is a file (0 bytes), not a directory with DWARF data 1 file(s) failed to upload with warnings Re-run the bugsnag-dsym-upload tool with the --verbose option for more information ... INFO [2021-04-06 15:43:57.30]: fastlane.tools finished successfully π
$ bundle exec fastlane ios release --verbose ... DEBUG [2021-04-06 15:47:12.39]: Uploading dSYMs to Bugsnag with the following parameters: DEBUG [2021-04-06 15:47:12.39]: api_key: 0c0ea7242a829310a625f599db2e5752 DEBUG [2021-04-06 15:47:12.39]: dsym_path: ["./dsyms_test_error"] ... Uploading files to https://upload.bugsnag.com Preparing to upload ./dsyms_test_error/bugsnag-example.app.dSYM [ERROR] Skipping file without UUID: ./dsyms_test_error/bugsnag-example.app.dSYM/Contents/Resources/DWARF/* 1 file(s) failed to upload with errors Re-run the bugsnag-dsym-upload tool with the --verbose option for more information ... ERROR [2021-04-06 15:47:12.41]: Failed uploading ./dsyms_test_error ... FastlaneCore::Interface::FastlaneError: [!] Failed uploading ./dsyms_test_error
$ bundle exec fastlane ios release --verbose ... DEBUG [2021-04-06 15:50:34.36]: Uploading dSYMs to Bugsnag with the following parameters: DEBUG [2021-04-06 15:50:34.36]: api_key: 0c0ea7242a829310a625f599db2e5752 DEBUG [2021-04-06 15:50:34.36]: dsym_path: ["./dsyms_test"] ... Uploading files to https://upload.bugsnag.com Preparing to upload ./dsyms_test/Bugsnag.framework.dSYM Uploading UUID: E599CF69-D848-3ED2-9093-68A44234CFCF (armv7) ./dsyms_test/Bugsnag.framework.dSYM/Contents/Resources/DWARF/Bugsnag UUID: 40112A5E-4A23-37EC-9A5D-95AF2C18AE39 (arm64) ./dsyms_test/Bugsnag.framework.dSYM/Contents/Resources/DWARF/Bugsnag
Preparing to upload ./dsyms_test/REDACTED.framework.ios-x86_64-maccatalyst.dSYM [WARNING] Skipping ./dsyms_test/REDACTED.framework.ios-x86_64-maccatalyst.dSYM as it's is a file (0 bytes), not a directory with DWARF data Preparing to upload ./dsyms_test/bugsnag-example.app.dSYM [ERROR] Skipping file without UUID: ./dsyms_test/bugsnag-example.app.dSYM/Contents/Resources/DWARF/* 1 file(s) uploaded successfully 1 file(s) failed to upload with warnings 1 file(s) failed to upload with errors Re-run the bugsnag-dsym-upload tool with the --verbose option for more information ... FastlaneCore::Interface::FastlaneError: [!] Failed uploading ./dsyms_test