Skip to content

Commit 55a6cc1

Browse files
authored
Merge pull request #700 from aciidb0mb3r/fix-xcode-space
[Bootstrap] Fix spaces in Xcode issue
2 parents c0cac0e + 057c698 commit 55a6cc1

File tree

1 file changed

+29
-15
lines changed

1 file changed

+29
-15
lines changed

Utilities/bootstrap

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ class Target(object):
244244
if args.xctest_path:
245245
import_paths.append(args.xctest_path)
246246
print(" import-paths: %s" % json.dumps(import_paths), file=output)
247-
print(" other-args: %s" % json.dumps(' '.join(other_args)),
247+
print(" other-args: %s" % json.dumps(other_args),
248248
file=output)
249249
print(" temps-path: %s" % json.dumps(target_build_dir), file=output)
250250
print(" is-library: %s" % json.dumps(
@@ -459,13 +459,15 @@ def create_bootstrap_files(sandbox_path, args):
459459
link_input_nodes, predecessor_node)
460460

461461

462+
# llbuild tool to use for this command.
463+
tool = "shell"
464+
462465
# Form the command line to link.
463466
linked_libraries = []
464467
if target.is_swift and target.is_library:
468+
tool = "archive"
465469
link_output_path = os.path.join(lib_dir, "%s.a" % (target.name,))
466-
link_command = ['rm', '-f', pipes.quote(link_output_path), ';',
467-
'ar', 'cr', pipes.quote(link_output_path)]
468-
link_command.append(' '.join(pipes.quote(o) for o in objects))
470+
link_command = [] # Archive tool auto infers objects from inputs.
469471
elif target.is_c and target.is_library:
470472
# We have to use shared library for interpolation between Swift and C so we can't use static library for C Targets.
471473
link_output_path = os.path.join(lib_dir, target.name + g_shared_lib_ext)
@@ -497,25 +499,25 @@ def create_bootstrap_files(sandbox_path, args):
497499
link_command.extend(["-Xlinker", "-l%s" % (lib,)])
498500
if platform.system() == 'Linux':
499501
link_command.extend(
500-
["-Xlinker", "-rpath=\\$ORIGIN/../lib/swift/linux"])
502+
["-Xlinker", "-rpath=$ORIGIN/../lib/swift/linux"])
501503
if args.foundation_path:
502504
link_command.extend(["-L", args.foundation_path])
503505
if args.libdispatch_build_dir:
504506
link_command.extend(["-L", os.path.join(args.libdispatch_build_dir, "src", ".libs")])
505507

506508
# Write out the link command.
507-
print(" %s:" % json.dumps(target.linked_virtual_node), file=output)
508-
print(" tool: shell", file=output)
509509
if target.is_library:
510-
print(" description: Link %s" % target.name, file=output)
510+
description = "Link %s" % target.name
511511
else:
512-
print(" description: Link %s" % link_output_path, file=output)
513-
print(" inputs: %s" % json.dumps(
514-
link_input_nodes + objects + linked_libraries), file=output)
515-
print(" outputs: %s" % json.dumps(
516-
[target.linked_virtual_node, link_output_path]), file=output)
517-
print(" args: %s" % ' '.join(link_command), file=output)
518-
print(file=output)
512+
description = "Link %s" % link_output_path
513+
writeTool(
514+
tool,
515+
target.linked_virtual_node,
516+
description,
517+
link_input_nodes + objects + linked_libraries,
518+
[target.linked_virtual_node, link_output_path],
519+
link_command,
520+
output)
519521

520522
# Write the top-level target group command.
521523
print(" %s:" % json.dumps(target.virtual_node), file=output)
@@ -537,6 +539,18 @@ def create_bootstrap_files(sandbox_path, args):
537539
write_bootstrap_version_info(inc_dir, args.vendor_name,
538540
args.build_identifier)
539541

542+
# Write out the tool into output buffer.
543+
# Supported tools: shell and archive. args is ignored for archive tool.
544+
def writeTool(tool, node, description, inputs, outputs, args, output):
545+
print(" %s:" % json.dumps(node), file=output)
546+
print(" tool: %s" % tool, file=output)
547+
print(" description: %s" % description, file=output)
548+
print(" inputs: %s" % json.dumps(inputs), file=output)
549+
print(" outputs: %s" % json.dumps(outputs), file=output)
550+
if tool == "shell":
551+
print(" args: %s" % json.dumps(args), file=output)
552+
print(file=output)
553+
540554

541555
def process_runtime_libraries(build_path, args, bootstrap=False):
542556
if bootstrap:

0 commit comments

Comments
 (0)