Skip to content

Commit 1302e8a

Browse files
committed
fix: quote OUTPUT_DIR in debug_symbols shell commands for paths with spaces
The synced debug_symbols.bzl from upstream didn't quote OUTPUT_DIR references in shell commands, causing failures for targets with spaces in their bundle names (e.g. ext_with_space). The open-source repo has test targets with spaces that upstream doesn't.
1 parent a81f9c4 commit 1302e8a

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

apple/internal/partials/debug_symbols.bzl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,10 @@ def _lipo_command_for_dsyms(
207207
found_binary_paths.append(dsym_binary.path)
208208

209209
lipo_command = (
210-
"mkdir -p ${{OUTPUT_DIR}}/Contents/Resources/DWARF && " +
210+
"mkdir -p \"${{OUTPUT_DIR}}/Contents/Resources/DWARF\" && " +
211211
"/usr/bin/lipo " +
212212
"-create {found_binary_inputs} " +
213-
"-output ${{OUTPUT_DIR}}/Contents/Resources/DWARF/{main_binary_basename}"
213+
"-output \"${{OUTPUT_DIR}}/Contents/Resources/DWARF/{main_binary_basename}\""
214214
).format(
215215
found_binary_inputs = " ".join([shell.quote(path) for path in found_binary_paths]),
216216
main_binary_basename = main_binary_basename,
@@ -414,13 +414,13 @@ def _bundle_dsym_files(
414414
# We expect any given Info.plist from the splits to be as good as any, no need to merge
415415
# them, but we can do that with plisttool if and when it's needed.
416416
plist_command = (
417-
"cp {dsym_plist_path} ${{OUTPUT_DIR}}/Contents/Info.plist"
417+
"cp \"{dsym_plist_path}\" \"${{OUTPUT_DIR}}/Contents/Info.plist\""
418418
).format(
419419
dsym_plist_path = dsym_inputs.values()[0].path + "/Contents/Info.plist",
420420
)
421421

422422
command = (
423-
"rm -rf ${OUTPUT_DIR} && " +
423+
"rm -rf \"${OUTPUT_DIR}\" && " +
424424
lipo_command + " && " +
425425
ditto_command + " && " +
426426
plist_command
@@ -458,7 +458,7 @@ def _bundle_dsym_files(
458458
dsym_plist_path = dsym_plist.path,
459459
)
460460

461-
command = "rm -rf ${OUTPUT_DIR} && " + lipo_command + " && " + plist_command
461+
command = "rm -rf \"${OUTPUT_DIR}\" && " + lipo_command + " && " + plist_command
462462

463463
# Put the tree artifact dSYMs in a subdirectory to avoid conflicts with any legacy dSYMs
464464
# provided through existing APIs such as --output_groups=+dsyms; note that legacy "flat

0 commit comments

Comments
 (0)