[ruby] create debug symbol packages#34632
Merged
apolcyn merged 58 commits intogrpc:masterfrom Oct 17, 2023
Merged
Conversation
alto-ruby
approved these changes
Oct 15, 2023
stanley-cheung
approved these changes
Oct 17, 2023
Contributor
Author
|
cc @dazuma FYI |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce
grpc-native-debuggems containing debug symbol packages that complement the shared libraries shipped in pre-compiled binary gems.Example package layout (
1.60.0.devis the "version" in this example):Intended Usage
Fetch the
grpc-native-debugpackage matching theRUBY_PLATFORMand version of thegrpcgem being debugged. For example, if usinggrpc-1.60-x86_64-linux.gem, then fetchgrpc-native-debug-1.60-x86_64-linux.gem.Unpack the gem and find the
symbolsdirectoryFind the
.dbgfile matching the version of ruby being used (there are separate shared libraries for each ruby version so we also need separate.dbgfiles).Use the symbols however needed. For example, to load in gdb one can follow https://stackoverflow.com/questions/30281766/need-to-load-debugging-symbols-for-shared-library-in-gdb.
Caveats
- currently only works for linux x86 and x86_64 librariesWhy not just include debug symbols in the shared libraries we ship?
If we stopped stripping the shared libraries in binary gems today, we'd multiply the package size by an order of magnitude.
For example, on linux x86_64, a stripped and compressed grpc_c.so is about 4MB. The same thing unstripped is ~80MB. There's a further multiplying effect because we include ~4 different extension libraries in each binary gem - one for each ruby minor version. Considering that the linux x86_64 gem is ~18MB today, > 300MB would be a 10-20X size increase.