Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

[ios] Preserve bcsymbolmap files when using CocoaPods - #12257

Merged
friedbunny merged 2 commits into
masterfrom
fb-cocoapods-preserve-bcsymbolmaps
Jun 28, 2018
Merged

friedbunny merged 2 commits into
masterfrom
fb-cocoapods-preserve-bcsymbolmaps

Conversation

@friedbunny

@friedbunny friedbunny commented Jun 28, 2018 •

Copy link
Copy Markdown
Contributor

Bitcode symbol map files (bcsymbolmap) are used in conjunction with dSYMs to symbolicate crashes. CocoaPods doesn't yet automatically preserve bcsymbolmap files when it is installing vendored pods, so this PR stops CocoaPods from discarding these files.

CocoaPods also does not add bcsymbolmap files to an app's xcarchive, so the developer needs to do this themselves, typically as an install-only build script phase — see #8463 (comment) for general instructions.

Related issues

/cc @julianrex @1ec5 @akitchen

Bitcode symbol map files (`bcsymbolmap`) are used in conjunction with dSYMs to symbolicate crashes. CocoaPods doesn't yet preserve these or add them to an app's `xcarchive`, so the developer needs to do this themselves (typically as an install-only build script phase).
@friedbunny friedbunny added iOS Mapbox Maps SDK for iOS CocoaPods labels Jun 28, 2018
@friedbunny friedbunny added this to the ios-v4.2.0 milestone Jun 28, 2018
@friedbunny friedbunny self-assigned this Jun 28, 2018
@friedbunny
friedbunny requested review from 1ec5 and julianrex June 28, 2018 20:16

@julianrex julianrex left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@friedbunny

friedbunny commented Jun 28, 2018 •

Copy link
Copy Markdown
Contributor Author

For posterity, I should note that, as a vendored framework (that has no CocoaPods-created target), there’s apparently nothing we can reasonably add to our podspec that would automatically copy bcsymbolmap files into an appropriate build folder. 😢

@friedbunny
friedbunny merged commit acbcf7e into master Jun 28, 2018
@friedbunny
friedbunny deleted the fb-cocoapods-preserve-bcsymbolmaps branch June 28, 2018 21:18
@friedbunny

friedbunny commented Jun 29, 2018 •

Copy link
Copy Markdown
Contributor Author

If you were using this podspec and really wanted a copy-paste solution (instead of manually fiddling with build phases in Xcode), you could do this in your app’s Podfile:

target 'YourMainAppTargetName' do
  script_phase :name => "Copy bitcode symbol maps into Products directory",
    :script => "if [ \"$ACTION\" = \"install\" ]; then mdfind -name .bcsymbolmap -onlyin \"${PODS_ROOT}\" | xargs -I{} cp -v {} \"${CONFIGURATION_BUILD_DIR}\"; fi;",
    :execution_position => :after_compile
end

This will create a build script phase that searches for .bcsymbolmap files in your Pods/ folder and then copies them to the build product directory.

@friedbunny

Copy link
Copy Markdown
Contributor Author

The CocoaPods team is working on fixing this in 1.7.0 (CocoaPods/CocoaPods#8470), which should eventually obviate the workaround in #12257 (comment).

@winstondu

Copy link
Copy Markdown

@friedbunny , I am using https://github.com/leavez/cocoapods-binary to prebuild my binaries, and I'm having issues with "__hidden" on the obfuscations when I build my app with bitcode. I do happen to do the extra step of saving my bcsymbolmaps in the pods folder with the built framework files, though they don't end up in my final xcArchive?

Your comment seems promising for my situation, though I am still surprised #8470 doesn't already do the trick.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

iOS Mapbox Maps SDK for iOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants