Do I need bcsymbolmap files created by Carthage
Asked Answered
S

3

24

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?

Sorrento answered 24/2, 2017 at 16:27 Comment(1)
great question.Alf
N
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

Notornis answered 1/7, 2019 at 22:57 Comment(0)
I
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.

Interesting answered 8/3, 2017 at 5:11 Comment(2)
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.Sorrento
In the case of Carthage there are good reasons to commit the Build and Checkout folders. See stackoverflow.com/questions/39662504/… . If you don't someone checking out the code may unwittingly build something different to what you tested before checking in.Averroism
N
1

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

Nailhead answered 26/4, 2021 at 23:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.