diff --git a/apple/internal/partials/debug_symbols.bzl b/apple/internal/partials/debug_symbols.bzl index a7351a5d32..630500014d 100644 --- a/apple/internal/partials/debug_symbols.bzl +++ b/apple/internal/partials/debug_symbols.bzl @@ -303,13 +303,21 @@ def _bundle_dsym_files( found_binaries_by_arch.update(dsym_binaries) if found_binaries_by_arch: - output_files = _copy_dsyms_into_declared_bundle( + dsyms = _copy_dsyms_into_declared_bundle( actions = actions, debug_output_filename = dsym_output_filename, dsym_bundle_name = dsym_bundle_name, found_binaries_by_arch = found_binaries_by_arch, platform_prerequisites = platform_prerequisites, ) + output_files.extend(dsyms) + dsyms_command = (" && ".join([ + "cp \"{dsym_path}\" \"${{OUTPUT_DIR}}/Contents/Resources/DWARF/{dsym_bundle_name}\"".format( + dsym_path = dsym.path, + dsym_bundle_name = dsym_output_filename, + ) + for dsym in dsyms + ])) # If we found any binaries, create the Info.plist for the bundle as well. dsym_plist = _generate_dsym_info_plist( @@ -334,9 +342,9 @@ def _bundle_dsym_files( apple_support.run_shell( actions = actions, apple_fragment = platform_prerequisites.apple_fragment, - inputs = [dsym_plist] + found_binaries_by_arch.values(), + inputs = dsyms + [dsym_plist] + found_binaries_by_arch.values(), outputs = [dsym_bundle_dir], - command = ("mkdir -p \"${OUTPUT_DIR}/Contents/Resources/DWARF\" && " + plist_command), + command = ("mkdir -p \"${OUTPUT_DIR}/Contents/Resources/DWARF\" && " + dsyms_command + " && " + plist_command), env = { "OUTPUT_DIR": dsym_bundle_dir.path, },