@@ -531,7 +531,14 @@ shutil.rmtree(completion_cache_path, ignore_errors=True)
531531ccp_opt = "-completion-cache-path %r" % completion_cache_path
532532lit_config .note ("Using code completion cache: " + completion_cache_path )
533533
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' )
535542
536543if platform .system () == 'Darwin' :
537544 config .swift_driver = (
@@ -541,8 +548,14 @@ if platform.system() == 'Darwin':
541548 "env SDKROOT=%s %r -toolchain-stdlib-rpath -Xlinker -rpath -Xlinker /usr/lib/swift %s %s %s"
542549 % (shell_quote (config .host_sdkroot ), config .swiftc , mcp_opt , config .swift_test_options , config .swift_driver_test_options ))
543550 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+ )
546559else :
547560 config .swift_driver = (
548561 "%r %s %s %s"
@@ -555,7 +568,7 @@ else:
555568 '' if kIsWindows else '-toolchain-stdlib-rpath' ,
556569 mcp_opt ,
557570 config .swift_test_options ,
558- config .swift_driver_test_options
571+ config .swift_driver_test_options ,
559572 )
560573 )
561574 # Parse the host triple.
@@ -566,8 +579,8 @@ else:
566579 config .swiftc_driver ,
567580 config .host_triple ,
568581 '' 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 ,
571584 '' if kIsWindows else '-Xlinker -rpath -Xlinker {}' .format (toolchain_lib_dir )
572585 )
573586 )
@@ -576,7 +589,7 @@ config.substitutions.append( ('%llvm_obj_root', config.llvm_obj_root) )
576589config .substitutions .append ( ('%swift-bin-dir' , config .swift_bin_dir ) )
577590config .substitutions .append ( ('%swift-lib-dir' , config .swift_lib_dir ) )
578591config .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 ) )
580593config .substitutions .append ( ('%llvm_src_root' , config .llvm_src_root ) )
581594config .substitutions .append ( ('%swift_obj_root' , config .swift_obj_root ) )
582595config .substitutions .append ( ('%swift_src_root' , config .swift_src_root ) )
@@ -2662,9 +2675,9 @@ config.substitutions.append(('%hmaptool', os.path.join(config.llvm_src_root, '..
26622675if hasattr (config , 'target_library_path_var' ):
26632676 host_library_env = (
26642677 "/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' ) ]))
26662679else :
2667- host_library_env = "env "
2680+ host_library_env = ""
26682681
26692682config .substitutions .append (('%host-library-env' , host_library_env ))
26702683
0 commit comments