spotify / XCRemoteCache

Other
825 stars 50 forks source link

Why $(DWARF_DSYM_FOLDER_PATH)/$(DWARF_DSYM_FILE_NAME) output file appears in Prebuild phase? #176

Closed CharlieSuP1 closed 1 year ago

CharlieSuP1 commented 1 year ago

In my project, sometimes error shows: error: /../derived_data/Build/Intermediates.noindex/ArchiveIntermediates/DemoProject/BuildProductsPath/Release-iphoneos/FooTarget.appex.dSYM/Contents/Resources/DWARF/FooTarget: No such file or directory where FooTarget is a dynamic lib

I looked around logic about dsym, and I noticed there is an output file in Prebuild phase: image

But what confused me is that its in Postbuild phase that the dysm file is actually linked to output file location: image

So just wonder why is that?

CharlieSuP1 commented 1 year ago

And I noticed Recommended: avoid DWARF with dSYM File "Debug Information Format" build setting. Use DWARF instead Just wonder why is that?

polac24 commented 1 year ago

Hi @CharlieSuP1! To correctly handle debugging symbols in for dynamic libraries, XCRemoteCache always generates the .dSYM (also in the Debug build) by calling dsymutil under the hood.

It is described https://github.com/spotify/XCRemoteCache/blob/b6318e97855f8f23b2dc670a8765baad80340d25/Sources/XCRemoteCache/Debugging/DSYMOrganizer.swift#L23-L29

Also, the FAQ suggests that you are using DWARF with dSYM File (which makes sense for the Release configuration). If you are using XCRemoteCache, I guess changing that to DWARF (always, even for Release) should get rid of an error. If that is a case, maybe XCRemoteCache could do better to handle such a scenario.

In general dynamic libraries + Release setup was quite tricky so any contributions to handle that better are welcome.