@@ -325,10 +325,6 @@ def clear_gyb_files_from_previous_run(sources_dir, destination_dir, verbose):
325
325
# Building SwiftSyntax
326
326
327
327
328
- def get_installed_dylib_names ():
329
- return ["libSwiftSyntax.dylib" , "libSwiftSyntaxParser.dylib" ]
330
-
331
-
332
328
def get_swiftpm_invocation (toolchain , action , build_dir , multiroot_data_file , release ):
333
329
swift_exec = os .path .join (toolchain , "bin" , "swift" )
334
330
@@ -579,49 +575,6 @@ def run_xctests(toolchain, build_dir, multiroot_data_file, release, verbose):
579
575
return call (swiftpm_call , env = env , verbose = verbose ) == 0
580
576
581
577
582
- def delete_rpath (rpath , binary ):
583
- if platform .system () == "Darwin" :
584
- cmd = ["install_name_tool" , "-delete_rpath" , rpath , binary ]
585
- note ("removing RPATH from %s: %s" % (binary , " " .join (cmd )))
586
- subprocess .call (cmd )
587
- else :
588
- fatal_error ("unable to remove RPATHs on this platform" )
589
-
590
-
591
- def change_id_rpath (rpath , binary ):
592
- if platform .system () == "Darwin" :
593
- cmd = ["install_name_tool" , "-id" , rpath , binary ]
594
- note ("changing id in %s: %s" % (binary , " " .join (cmd )))
595
- result = subprocess .call (cmd )
596
- if result != 0 :
597
- fatal_error ("command failed with exit status %d" % (result ,))
598
- else :
599
- fatal_error ("unable to invoke install_name_tool on this platform" )
600
-
601
-
602
- def check_and_sync (file_path , install_path ):
603
- cmd = ["rsync" , "-a" , file_path , install_path ]
604
- note ("installing %s: %s" % (os .path .basename (file_path ), " " .join (cmd )))
605
- result = subprocess .check_call (cmd )
606
- if result != 0 :
607
- fatal_error ("install failed with exit status %d" % (result ,))
608
-
609
-
610
- def install (build_dir , dylib_dir , stdlib_rpath ):
611
- for dylib_name in get_installed_dylib_names ():
612
-
613
- dylib_path = os .path .join (build_dir , dylib_name )
614
-
615
- # users should find the dylib as if it's a part of stdlib.
616
- change_id_rpath (os .path .join ("@rpath" , dylib_name ), dylib_path )
617
-
618
- # we don't wanna hard-code the stdlib dylibs into rpath.
619
- delete_rpath (stdlib_rpath , dylib_path )
620
- check_and_sync (
621
- file_path = dylib_path , install_path = os .path .join (dylib_dir , dylib_name )
622
- )
623
-
624
-
625
578
# -----------------------------------------------------------------------------
626
579
# Arugment Parsing
627
580
@@ -717,20 +670,6 @@ def parse_args():
717
670
help = "The path to the toolchain that shall be used to build " "SwiftSyntax." ,
718
671
)
719
672
720
- # -------------------------------------------------------------------------
721
- install_group = parser .add_argument_group ("Install" )
722
-
723
- install_group .add_argument (
724
- "-i" ,
725
- "--install" ,
726
- action = "store_true" ,
727
- help = "Install the build artifact to a specified toolchain directory." ,
728
- )
729
-
730
- install_group .add_argument (
731
- "--dylib-dir" , help = "The directory to where the .dylib should be installed."
732
- )
733
-
734
673
# -------------------------------------------------------------------------
735
674
test_group = parser .add_argument_group ("Test" )
736
675
@@ -771,24 +710,6 @@ def parse_args():
771
710
def main ():
772
711
args = parse_args ()
773
712
774
- if args .install :
775
- if not args .dylib_dir :
776
- fatal_error ("Must specify directory to install (--dylib-dir)" )
777
- if not args .build_dir :
778
- fatal_error ("Must specify build directory to copy from (--build-dir)" )
779
- if args .release :
780
- build_dir = os .path .join (args .build_dir , "release" )
781
- else :
782
- # will this ever happen?
783
- build_dir = os .path .join (args .build_dir , "debug" )
784
- stdlib_rpath = os .path .join (args .toolchain , "lib" , "swift" , "macosx" )
785
- install (
786
- build_dir = build_dir ,
787
- dylib_dir = args .dylib_dir ,
788
- stdlib_rpath = stdlib_rpath ,
789
- )
790
- sys .exit (0 )
791
-
792
713
try :
793
714
if not args .verify_generated_files :
794
715
generate_gyb_files (
0 commit comments