@@ -531,7 +531,14 @@ shutil.rmtree(completion_cache_path, ignore_errors=True)
531
531
ccp_opt = "-completion-cache-path %r" % completion_cache_path
532
532
lit_config .note ("Using code completion cache: " + completion_cache_path )
533
533
534
- config .swift_host_lib_dir = make_path (config .swift_lib_dir , 'swift' , 'host' )
534
+ if kIsWindows :
535
+ config .swift_plugin_dir = config .swift_bin_dir
536
+ # FIXME: this is a workaround for the collsion between the build toolchain
537
+ # and the current build, this should be `make_path(config.swift_lib_dir, 'swift')`
538
+ config .swift_build_lib_dir = make_path (config .swift_lib_dir , 'swift' , 'host' )
539
+ else :
540
+ config .swift_plugin_dir = make_path (config .swift_lib_dir , 'swift' , 'host' , 'plugins' )
541
+ config .swift_build_lib_dir = make_path (config .swift_lib_dir , 'swift' , 'host' )
535
542
536
543
if platform .system () == 'Darwin' :
537
544
config .swift_driver = (
@@ -541,8 +548,14 @@ if platform.system() == 'Darwin':
541
548
"env SDKROOT=%s %r -toolchain-stdlib-rpath -Xlinker -rpath -Xlinker /usr/lib/swift %s %s %s"
542
549
% (shell_quote (config .host_sdkroot ), config .swiftc , mcp_opt , config .swift_test_options , config .swift_driver_test_options ))
543
550
config .host_build_swift = (
544
- "%s -sdk %s -target %s -no-toolchain-stdlib-rpath -I %s -L %s"
545
- % (config .swiftc_driver , config .host_sdkroot , config .host_triple , config .swift_host_lib_dir , config .swift_host_lib_dir ))
551
+ "%s -sdk %s -target %s -no-toolchain-stdlib-rpath -I %s -L %s" % (
552
+ config .swiftc_driver ,
553
+ config .host_sdkroot ,
554
+ config .host_triple ,
555
+ config .swift_build_lib_dir ,
556
+ config .swift_build_lib_dir
557
+ )
558
+ )
546
559
else :
547
560
config .swift_driver = (
548
561
"%r %s %s %s"
@@ -555,7 +568,7 @@ else:
555
568
'' if kIsWindows else '-toolchain-stdlib-rpath' ,
556
569
mcp_opt ,
557
570
config .swift_test_options ,
558
- config .swift_driver_test_options
571
+ config .swift_driver_test_options ,
559
572
)
560
573
)
561
574
# Parse the host triple.
@@ -566,8 +579,8 @@ else:
566
579
config .swiftc_driver ,
567
580
config .host_triple ,
568
581
'' if kIsWindows else '-no-toolchain-stdlib-rpath' ,
569
- config .swift_host_lib_dir ,
570
- config .swift_host_lib_dir ,
582
+ config .swift_build_lib_dir ,
583
+ config .swift_build_lib_dir ,
571
584
'' if kIsWindows else '-Xlinker -rpath -Xlinker {}' .format (toolchain_lib_dir )
572
585
)
573
586
)
@@ -576,7 +589,7 @@ config.substitutions.append( ('%llvm_obj_root', config.llvm_obj_root) )
576
589
config .substitutions .append ( ('%swift-bin-dir' , config .swift_bin_dir ) )
577
590
config .substitutions .append ( ('%swift-lib-dir' , config .swift_lib_dir ) )
578
591
config .substitutions .append ( ('%swift-share-dir' , config .swift_share_dir ) )
579
- config .substitutions .append ( ('%swift-host-lib- dir' , config .swift_host_lib_dir ) )
592
+ config .substitutions .append ( ('%swift-plugin- dir' , config .swift_plugin_dir ) )
580
593
config .substitutions .append ( ('%llvm_src_root' , config .llvm_src_root ) )
581
594
config .substitutions .append ( ('%swift_obj_root' , config .swift_obj_root ) )
582
595
config .substitutions .append ( ('%swift_src_root' , config .swift_src_root ) )
@@ -2662,9 +2675,9 @@ config.substitutions.append(('%hmaptool', os.path.join(config.llvm_src_root, '..
2662
2675
if hasattr (config , 'target_library_path_var' ):
2663
2676
host_library_env = (
2664
2677
"/usr/bin/env " +
2665
- construct_library_path_env ([config .swift_host_lib_dir ]))
2678
+ construct_library_path_env ([make_path ( config .swift_lib_dir , 'swift' , 'host' ) ]))
2666
2679
else :
2667
- host_library_env = "env "
2680
+ host_library_env = ""
2668
2681
2669
2682
config .substitutions .append (('%host-library-env' , host_library_env ))
2670
2683
0 commit comments