20

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?

codingFriend1
  • 5,863
  • 6
  • 36
  • 59

3 Answers3

5

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

lobstah
  • 786
  • 5
  • 12
4

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.

kowsky
  • 7,265
  • 1
  • 23
  • 37
  • 1
    Thanks for pointing to the discussion on github. That also links to a thread on the Apple developer forums. It seems like the `bcsymbolmap` files are required to upload the app to the App Store. But it looks like old files are never cleaned up by Carthage… BTW, the reason to commit the build products is to allow building the app right after pulling the repo without needing to rebuild all dependencies. Also, dependency project might be deleted from github, so we want to preserve them locally. – codingFriend1 Mar 08 '17 at 09:33
  • 4
    In the case of Carthage there are good reasons to commit the Build and Checkout folders. See http://stackoverflow.com/questions/39662504/list-of-carthage-files-to-be-pushed-to-git/44082073#44082073 . If you don't someone checking out the code may unwittingly build something different to what you tested before checking in. – pbm May 20 '17 at 05:20
0

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

yoAlex5
  • 13,571
  • 5
  • 105
  • 98