Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propagate dSYM bundles discovered within imported dynamic xcframeworks #2625

Conversation

aaronsky
Copy link
Contributor

@aaronsky aaronsky commented Dec 15, 2024

Fixes #2512

This PR attempts to add automatic dSYM imports per target-triple for dynamic xcframeworks. It is a rough implementation with some appropriately sharp edges, due to my still-nascent familiarity with the codebase, but I've managed to prove it out at the day job. Hopefully this is acceptable!

For example, given a dependency on Sentry's dynamic xcframework, which vends dSYMs:

bazel cquery --output=files --output_groups=+dsyms --apple_generate_dsym //examples/ios/HelloWorldSwift

Before
bazel-out/ios_sim_arm64-fastbuild-ios-sim_arm64-min15.0-applebin_ios-ST-048b4cf12fed/bin/examples/ios/HelloWorldSwift/HelloWorldSwift.ipa
bazel-out/ios_sim_arm64-fastbuild-ios-sim_arm64-min15.0-applebin_ios-ST-048b4cf12fed/bin/examples/ios/HelloWorldSwift/HelloWorldSwift.app.dSYM/Contents/Resources/DWARF/HelloWorldSwift
bazel-out/ios_sim_arm64-fastbuild-ios-sim_arm64-min15.0-applebin_ios-ST-048b4cf12fed/bin/examples/ios/HelloWorldSwift/HelloWorldSwift.app.dSYM/Contents/Info.plist
After
bazel-out/ios_sim_arm64-fastbuild-ios-sim_arm64-min15.0-applebin_ios-ST-048b4cf12fed/bin/examples/ios/HelloWorldSwift/HelloWorldSwift.ipa
bazel-out/ios_sim_arm64-fastbuild-ios-sim_arm64-min15.0-applebin_ios-ST-048b4cf12fed/bin/examples/ios/HelloWorldSwift/HelloWorldSwift.app.dSYM/Contents/Resources/DWARF/HelloWorldSwift
bazel-out/ios_sim_arm64-fastbuild-ios-sim_arm64-min15.0-applebin_ios-ST-048b4cf12fed/bin/examples/ios/HelloWorldSwift/HelloWorldSwift.app.dSYM/Contents/Info.plist
examples/ios/HelloWorldSwift/Sentry-Dynamic.xcframework/ios-arm64_x86_64-simulator/dSYMs/Sentry.framework.dSYM/Contents/Info.plist
examples/ios/HelloWorldSwift/Sentry-Dynamic.xcframework/ios-arm64_x86_64-simulator/dSYMs/Sentry.framework.dSYM/Contents/Resources/DWARF/Sentry
examples/ios/HelloWorldSwift/Sentry-Dynamic.xcframework/ios-arm64_x86_64-simulator/dSYMs/Sentry.framework.dSYM/Contents/Resources/Relocations/aarch64/Sentry.yml
examples/ios/HelloWorldSwift/Sentry-Dynamic.xcframework/ios-arm64_x86_64-simulator/dSYMs/Sentry.framework.dSYM/Contents/Resources/Relocations/x86_64/Sentry.yml
After (ios_arm64)
bazel-out/ios_sim_arm64-fastbuild-ios-sim_arm64-min15.0-applebin_ios-ST-048b4cf12fed/bin/examples/ios/HelloWorldSwift/HelloWorldSwift.ipa
bazel-out/ios_sim_arm64-fastbuild-ios-sim_arm64-min15.0-applebin_ios-ST-048b4cf12fed/bin/examples/ios/HelloWorldSwift/HelloWorldSwift.app.dSYM/Contents/Resources/DWARF/HelloWorldSwift
bazel-out/ios_sim_arm64-fastbuild-ios-sim_arm64-min15.0-applebin_ios-ST-048b4cf12fed/bin/examples/ios/HelloWorldSwift/HelloWorldSwift.app.dSYM/Contents/Info.plist
examples/ios/HelloWorldSwift/Sentry-Dynamic.xcframework/ios-arm64/dSYMs/Sentry.framework.dSYM/Contents/Info.plist
examples/ios/HelloWorldSwift/Sentry-Dynamic.xcframework/ios-arm64/dSYMs/Sentry.framework.dSYM/Contents/Resources/DWARF/Sentry
examples/ios/HelloWorldSwift/Sentry-Dynamic.xcframework/ios-arm64/dSYMs/Sentry.framework.dSYM/Contents/Resources/Relocations/aarch64/Sentry.yml

Note: dSYMs for dynamic xcframeworks imported from outside the root module are not copied into bazel-out and their paths as viewed with cquery are under external/ relative to the output base. This is consistent with how dsym_imports are handled by apple_dynamic_framework_import.

@aaronsky aaronsky force-pushed the aaronsky/2512-dynamic-xcframework-dsym-outputs branch from fa84986 to 767820d Compare December 15, 2024 13:12
@aaronsky aaronsky force-pushed the aaronsky/2512-dynamic-xcframework-dsym-outputs branch from d4a85d4 to 5aa55b5 Compare December 15, 2024 13:54
@aaronsky aaronsky changed the title WIP: propagate dSYM bundles discovered within dynamic xcframeworks propagate dSYM bundles discovered within dynamic xcframeworks Dec 20, 2024
@aaronsky aaronsky marked this pull request as ready for review December 20, 2024 11:44
Copy link
Contributor

@luispadron luispadron left a comment

Choose a reason for hiding this comment

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

This seems good to me but im also no expert here. The test looks good though and generally like some of the refactoring that was done.

Could we update the PR description/commit to go into more details, potentially show-casing an example with expected inputs/outputs. I think that would help make things more understandable.

@aaronsky aaronsky changed the title propagate dSYM bundles discovered within dynamic xcframeworks Propagate dSYM bundles discovered within imported dynamic xcframeworks Jan 17, 2025
@brentleyjones brentleyjones merged commit f2d21b9 into bazelbuild:master Jan 21, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dSYMs imported with dynamic xcframeworks are not part of the dsyms output group
3 participants