Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do I need bcsymbolmap files created by Carthage

I am using Carthage dependency manager in my iOS project. I have the Carthage/build folder in my repository to always have ready to go built frameworks when checking out the repo.

I am wondering what the bcsymbolmap files in the build folder are for. Quite a few of them are created with every carthage update.

Do I need to keep these files? Should I have them in my repository?

like image 760
codingFriend1 Avatar asked Feb 24 '17 16:02

codingFriend1


3 Answers

No, you don't need those files. If you set up Carthage properly, binary, .dsym and .bcsymbolmap files will be copied on build phase. When you archive the build for distributing using App Store, all needed files will be included in archive and after you upload the build to App Store you will be able to upload dsyms files anytime (to be able to decode your crash reports). If fact you don't need to store .dsyms and .bcsymbolmap files in your repository.

There is a good article explaining what is happening when the framework is being build (and what in fact Carthage scripts do) https://instabug.com/blog/ios-binary-framework/. Also it explains what for .bcsymbolmaps files used for - so Apple servers can rebuild your code using Bitcode and then you can desymbolicate your crash reports.

So, you don't need to keep those files. No need to store them in repository. The other reason not to store content of Build folder is that anyway your project can fail build with it on another machine with different environment. If you want to build your project with the same versions of dependencies - use Carthage bootstrap command instead of update.

P.S. Also you can investigate what copy-frameworks command do: https://github.com/Carthage/Carthage/blob/fc0166b4827736bac2c804fc928797f1a742c455/Source/carthage/CopyFrameworks.swift

like image 161
lobstah Avatar answered Oct 30 '22 19:10

lobstah


If you use carthage build without the specification of a project, all .bcsymbolmaps should be deleted, but if you use e.g. carthage build Alamofire it should just delete the corresponding .bcsymbolmap

From the discussion of a github issue. Looks like you do not need those files, since the default behaviour is to delete them when building a new build.

In general, you should not commit files generated during a local build into your repository, since builds can be device specific, and everyone cloning into or pulling from your repository should be able to perform a build themselves.

like image 24
kowsky Avatar answered Oct 30 '22 20:10

kowsky


Bitcode Symbol Map(BCSymbolMap)

.bcsymbolmap is a textual file with debug information and which is generated for decoding stack trace. Solves same issues as .dSYM[About] but on more low level for and when Bitcode[About] is generated

It looks like:

BCSymbolMap Version: 2.0
__swift_FORCE_LOAD_$_swiftCompatibility50
__swift_FORCE_LOAD_$_swiftCompatibility51
__swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements
_$sSo26SCNetworkReachabilityFlagsVMa
_$sSo24SCNetworkReachabilityRefaMa
...

Do I need to keep these files? Should I have them in my repository?

They are optional

like image 23
yoAlex5 Avatar answered Oct 30 '22 19:10

yoAlex5