Skip to content

Commit b660548

Browse files
authored
Merge pull request #62326 from DougGregor/swift-host-libs
2 parents 5c20abb + 1e93fb3 commit b660548

File tree

18 files changed

+181
-113
lines changed

18 files changed

+181
-113
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ function(_add_swift_runtime_link_flags target relpath_to_lib_dir bootstrapping)
569569
570570
if(SWIFT_SWIFT_PARSER)
571571
# Make sure we can find the early SwiftSyntax libraries.
572-
target_link_directories(${target} PRIVATE "${SWIFT_PATH_TO_EARLYSWIFTSYNTAX_BUILD_DIR}/lib")
572+
target_link_directories(${target} PRIVATE "${SWIFT_PATH_TO_EARLYSWIFTSYNTAX_BUILD_DIR}/lib/swift/host")
573573
574574
# For the "end step" of bootstrapping configurations on Darwin, need to be
575575
# able to fall back to the SDK directory for libswiftCore et al.
@@ -912,9 +912,17 @@ function(add_swift_host_tool executable)
912912
endif()
913913
914914
if(SWIFT_SWIFT_PARSER)
915+
set(extra_relative_rpath "")
916+
if(NOT ${ASHT_BOOTSTRAPPING} STREQUAL "")
917+
if (${executable} MATCHES "-bootstrapping")
918+
set(extra_relative_rpath "../")
919+
endif()
920+
endif()
921+
915922
set_property(
916923
TARGET ${executable}
917-
APPEND PROPERTY INSTALL_RPATH "@executable_path/../lib")
924+
APPEND PROPERTY INSTALL_RPATH
925+
"@executable_path/../${extra_relative_rpath}lib/swift/host")
918926
endif()
919927
920928
if(ASHT_THINLTO_LD64_ADD_FLTO_CODEGEN_ONLY)

lib/ASTGen/CMakeLists.txt

Lines changed: 58 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,8 @@ if (SWIFT_SWIFT_PARSER)
5151
cmake_parse_arguments(ARGS "" "" "PUBLIC" ${ARGN})
5252

5353
foreach(DEPENDENCY ${ARGS_PUBLIC})
54-
# This is a hack to workaround a cmake bug that results in multiple ninja targets producing
55-
# the same file in a downstream SourceKit target. This should use `PUBLIC`, the dependency
56-
# directly (rather than `TARGET_OBJECTS`), and no `add_dependencies`.
5754
target_link_libraries(${TARGET} PRIVATE
58-
$<TARGET_OBJECTS:${DEPENDENCY}>
55+
${DEPENDENCY}
5956
)
6057
add_dependencies(${TARGET} ${DEPENDENCY})
6158

@@ -69,25 +66,72 @@ if (SWIFT_SWIFT_PARSER)
6966
endforeach()
7067
endfunction()
7168

69+
set(SWIFT_SYNTAX_MODULES
70+
SwiftBasicFormat
71+
SwiftParser
72+
SwiftParserDiagnostics
73+
SwiftDiagnostics
74+
SwiftSyntax
75+
SwiftOperators
76+
SwiftSyntaxBuilder
77+
_SwiftSyntaxMacros
78+
SwiftCompilerSupport
79+
)
80+
81+
# Compute the list of SwiftSyntax targets
82+
list(TRANSFORM SWIFT_SYNTAX_MODULES PREPEND "SwiftSyntax::"
83+
OUTPUT_VARIABLE SWIFT_SYNTAX_TARGETS)
84+
7285
# TODO: Change to target_link_libraries when cmake is fixed
7386
force_target_link_libraries(swiftASTGen PUBLIC
74-
SwiftSyntax::SwiftBasicFormat
75-
SwiftSyntax::SwiftParser
76-
SwiftSyntax::SwiftParserDiagnostics
77-
SwiftSyntax::SwiftDiagnostics
78-
SwiftSyntax::SwiftSyntax
79-
SwiftSyntax::SwiftOperators
80-
SwiftSyntax::SwiftSyntaxBuilder
81-
SwiftSyntax::_SwiftSyntaxMacros
82-
SwiftSyntax::SwiftCompilerSupport
87+
${SWIFT_SYNTAX_TARGETS}
8388
)
8489
target_link_libraries(swiftASTGen PUBLIC
8590
swiftAST
8691
swift_CompilerPluginSupport
8792
)
8893

94+
set(SWIFT_SYNTAX_LIBRARIES_SOURCE_DIR
95+
"${SWIFT_PATH_TO_EARLYSWIFTSYNTAX_BUILD_DIR}/lib/swift/host")
96+
set(SWIFT_SYNTAX_LIBRARIES_DEST_DIR
97+
"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/swift/host")
98+
99+
# Determine the SwiftSyntax shared library files that were built as
100+
# part of earlyswiftsyntax.
101+
list(TRANSFORM SWIFT_SYNTAX_MODULES PREPEND ${CMAKE_SHARED_LIBRARY_PREFIX}
102+
OUTPUT_VARIABLE SWIFT_SYNTAX_SHARED_LIBRARIES)
103+
list(TRANSFORM SWIFT_SYNTAX_SHARED_LIBRARIES APPEND
104+
${CMAKE_SHARED_LIBRARY_SUFFIX}
105+
OUTPUT_VARIABLE SWIFT_SYNTAX_SHARED_LIBRARIES)
106+
107+
# Copy over all of the shared libraries from earlyswiftsyntax so they can
108+
# be found via RPATH.
109+
foreach (sharedlib ${SWIFT_SYNTAX_SHARED_LIBRARIES})
110+
add_custom_command(
111+
TARGET swiftASTGen PRE_BUILD
112+
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SWIFT_SYNTAX_LIBRARIES_SOURCE_DIR}/${sharedlib} ${SWIFT_SYNTAX_LIBRARIES_DEST_DIR}/${sharedlib}
113+
COMMENT "Copying ${sharedlib}"
114+
)
115+
endforeach()
116+
117+
# Copy all of the Swift modules from earlyswiftsyntax so they can be found
118+
# in the same relative place within the build directory as in the final
119+
# toolchain.
120+
list(TRANSFORM SWIFT_SYNTAX_MODULES APPEND ".swiftmodule"
121+
OUTPUT_VARIABLE SWIFT_SYNTAX_MODULE_DIRS)
122+
foreach(module_dir ${SWIFT_SYNTAX_MODULE_DIRS})
123+
file(GLOB module_files
124+
"${SWIFT_SYNTAX_LIBRARIES_SOURCE_DIR}/${module_dir}/*.swift*")
125+
add_custom_command(
126+
TARGET swiftASTGen PRE_BUILD
127+
COMMAND ${CMAKE_COMMAND} -E make_directory ${SWIFT_SYNTAX_LIBRARIES_DEST_DIR}/${module_dir}
128+
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${module_files} ${SWIFT_SYNTAX_LIBRARIES_DEST_DIR}/${module_dir}/
129+
COMMENT "Copying ${module_dir}"
130+
)
131+
endforeach()
132+
89133
target_include_directories(swiftASTGen PUBLIC
90-
"${SWIFT_PATH_TO_EARLYSWIFTSYNTAX_BUILD_DIR}/swift")
134+
${SWIFT_SYNTAX_LIBRARIES_DEST_DIR})
91135

92136
set_property(GLOBAL APPEND PROPERTY SWIFT_EXPORTS swiftASTGen)
93137
endif()

lib/CompilerPluginSupport/CMakeLists.txt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ if(SWIFT_SWIFT_PARSER)
1818
add_library("${library_name}" SHARED
1919
CompilerPluginSupport.swift)
2020

21+
set_target_properties(${library_name}
22+
PROPERTIES
23+
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/swift/host"
24+
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/swift/host"
25+
)
26+
2127
if(SWIFT_HOST_VARIANT_SDK IN_LIST SWIFT_DARWIN_PLATFORMS)
2228
set(DEPLOYMENT_VERSION "${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_DEPLOYMENT_VERSION}")
2329
endif()
@@ -28,7 +34,7 @@ if(SWIFT_SWIFT_PARSER)
2834

2935
# Determine the Swift module path
3036
set(module_triple ${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_ARCH_${SWIFT_HOST_VARIANT_ARCH}_MODULE})
31-
set(module_dir "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
37+
set(module_dir "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/swift/host")
3238
set(module_base "${module_dir}/${module_name}.swiftmodule")
3339
set(module_file "${module_base}/${module_triple}.swiftmodule")
3440
set(module_interface_file "${module_base}/${module_triple}.swiftinterface")
@@ -82,17 +88,17 @@ if(SWIFT_SWIFT_PARSER)
8288
DESTINATION "bin"
8389
COMPONENT compiler
8490
FRAMEWORK
85-
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}"
91+
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/host"
8692
COMPONENT compiler
8793
LIBRARY
88-
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}"
94+
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/host"
8995
COMPONENT compiler
9096
ARCHIVE
91-
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}"
97+
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/host"
9298
COMPONENT compiler)
9399

94100
swift_install_in_component(DIRECTORY "${module_base}"
95-
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift"
101+
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/host"
96102
COMPONENT compiler)
97103

98104
set_property(GLOBAL APPEND PROPERTY SWIFT_EXPORTS ${library_name})

lib/Parse/CMakeLists.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ if (SWIFT_SWIFT_PARSER)
3838
# )
3939
target_link_libraries(swiftParse
4040
PRIVATE
41-
$<TARGET_OBJECTS:SwiftSyntax::SwiftBasicFormat>
42-
$<TARGET_OBJECTS:SwiftSyntax::SwiftParser>
43-
$<TARGET_OBJECTS:SwiftSyntax::SwiftParserDiagnostics>
44-
$<TARGET_OBJECTS:SwiftSyntax::SwiftDiagnostics>
45-
$<TARGET_OBJECTS:SwiftSyntax::SwiftSyntax>
46-
$<TARGET_OBJECTS:SwiftSyntax::SwiftOperators>
47-
$<TARGET_OBJECTS:SwiftSyntax::SwiftSyntaxBuilder>
48-
$<TARGET_OBJECTS:SwiftSyntax::_SwiftSyntaxMacros>
49-
$<TARGET_OBJECTS:SwiftSyntax::SwiftCompilerSupport>
41+
SwiftSyntax::SwiftBasicFormat
42+
SwiftSyntax::SwiftParser
43+
SwiftSyntax::SwiftParserDiagnostics
44+
SwiftSyntax::SwiftDiagnostics
45+
SwiftSyntax::SwiftSyntax
46+
SwiftSyntax::SwiftOperators
47+
SwiftSyntax::SwiftSyntaxBuilder
48+
SwiftSyntax::_SwiftSyntaxMacros
49+
SwiftSyntax::SwiftCompilerSupport
5050
$<TARGET_OBJECTS:swiftASTGen>
5151
)
5252

test/Driver/driver-compile.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,8 @@
4848
// RUN: %empty-directory(%t/DISTINCTIVE-PATH/usr/bin/)
4949
// RUN: %empty-directory(%t/DISTINCTIVE-PATH/usr/lib/)
5050
// RUN: %hardlink-or-copy(from: %swift_frontend_plain, to: %t/DISTINCTIVE-PATH/usr/bin/swiftc)
51-
// RUN: %copy-plugin-support-library(%t/DISTINCTIVE-PATH/usr/lib/)
5251
// RUN: ln -s "swiftc" %t/DISTINCTIVE-PATH/usr/bin/swift-update
53-
// RUN: %t/DISTINCTIVE-PATH/usr/bin/swiftc -driver-print-jobs -c -update-code -target x86_64-apple-macosx10.9 %s 2>&1 > %t.upd.txt
52+
// RUN: %host-library-env %t/DISTINCTIVE-PATH/usr/bin/swiftc -driver-print-jobs -c -update-code -target x86_64-apple-macosx10.9 %s 2>&1 > %t.upd.txt
5453
// RUN: %FileCheck -check-prefix UPDATE-CODE %s < %t.upd.txt
5554
// Clean up the test executable because hard links are expensive.
5655
// RUN: rm -rf %t/DISTINCTIVE-PATH/usr/bin/swiftc

test/Driver/linker-clang_rt.swift

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,32 @@
88
// RUN: %empty-directory(%t/bin)
99
// RUN: %empty-directory(%t/lib)
1010
// RUN: %hardlink-or-copy(from: %swift_frontend_plain, to: %t/bin/swiftc)
11-
// RUN: %copy-plugin-support-library(%t/lib/)
1211
// RUN: %empty-directory(%t/lib/swift/clang/lib/darwin/)
1312

14-
// RUN: %t/bin/swiftc -driver-print-jobs -target x86_64-apple-macosx10.9 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-NO-RUNTIME %s
13+
// RUN: %host-library-env %t/bin/swiftc -driver-print-jobs -target x86_64-apple-macosx10.9 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-NO-RUNTIME %s
1514

1615
// RUN: touch %t/lib/swift/clang/lib/darwin/libclang_rt.osx.a %t/lib/swift/clang/lib/darwin/libclang_rt.ios.a %t/lib/swift/clang/lib/darwin/libclang_rt.iossim.a %t/lib/swift/clang/lib/darwin/libclang_rt.tvos.a %t/lib/swift/clang/lib/darwin/libclang_rt.tvossim.a %t/lib/swift/clang/lib/darwin/libclang_rt.watchos.a %t/lib/swift/clang/lib/darwin/libclang_rt.watchossim.a
1716

18-
// RUN: %t/bin/swiftc -driver-print-jobs -target x86_64-apple-macosx10.9 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-MACOS %s
19-
// RUN: %t/bin/swiftc -driver-print-jobs -target x86_64-apple-ios13.1-macabi %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-MACCATALYST %s
20-
21-
// RUN: %t/bin/swiftc -driver-print-jobs -target i386-apple-ios7-simulator %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-IOSSIM %s
22-
// RUN: %t/bin/swiftc -driver-print-jobs -target i386-apple-ios7 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-IOSSIM %s
23-
// RUN: %t/bin/swiftc -driver-print-jobs -target x86_64-apple-ios7-simulator %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-IOSSIM %s
24-
// RUN: %t/bin/swiftc -driver-print-jobs -target x86_64-apple-ios7 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-IOSSIM %s
25-
// RUN: %t/bin/swiftc -driver-print-jobs -target armv7s-apple-ios7 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-IOS %s
26-
// RUN: %t/bin/swiftc -driver-print-jobs -target arm64-apple-ios7-simulator %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-IOSSIM %s
27-
// RUN: %t/bin/swiftc -driver-print-jobs -target arm64-apple-ios7 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-IOS %s
28-
29-
// RUN: %t/bin/swiftc -driver-print-jobs -target x86_64-apple-tvos9-simulator %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-TVOSSIM %s
30-
// RUN: %t/bin/swiftc -driver-print-jobs -target x86_64-apple-tvos9 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-TVOSSIM %s
31-
// RUN: %t/bin/swiftc -driver-print-jobs -target arm64-apple-tvos9-simulator %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-TVOSSIM %s
32-
// RUN: %t/bin/swiftc -driver-print-jobs -target arm64-apple-tvos9 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-TVOS %s
33-
34-
// RUN: %t/bin/swiftc -driver-print-jobs -target i386-apple-watchos2-simulator %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-WATCHOSSIM %s
35-
// RUN: %t/bin/swiftc -driver-print-jobs -target i386-apple-watchos2 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-WATCHOSSIM %s
36-
// RUN: %t/bin/swiftc -driver-print-jobs -target armv7k-apple-watchos2 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-WATCHOS %s
37-
// RUN: %t/bin/swiftc -driver-print-jobs -target arm64-apple-watchos2-simulator %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-WATCHOSSIM %s
17+
// RUN: %host-library-env %t/bin/swiftc -driver-print-jobs -target x86_64-apple-macosx10.9 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-MACOS %s
18+
// RUN: %host-library-env %t/bin/swiftc -driver-print-jobs -target x86_64-apple-ios13.1-macabi %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-MACCATALYST %s
19+
20+
// RUN: %host-library-env %t/bin/swiftc -driver-print-jobs -target i386-apple-ios7-simulator %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-IOSSIM %s
21+
// RUN: %host-library-env %t/bin/swiftc -driver-print-jobs -target i386-apple-ios7 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-IOSSIM %s
22+
// RUN: %host-library-env %t/bin/swiftc -driver-print-jobs -target x86_64-apple-ios7-simulator %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-IOSSIM %s
23+
// RUN: %host-library-env %t/bin/swiftc -driver-print-jobs -target x86_64-apple-ios7 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-IOSSIM %s
24+
// RUN: %host-library-env %t/bin/swiftc -driver-print-jobs -target armv7s-apple-ios7 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-IOS %s
25+
// RUN: %host-library-env %t/bin/swiftc -driver-print-jobs -target arm64-apple-ios7-simulator %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-IOSSIM %s
26+
// RUN: %host-library-env %t/bin/swiftc -driver-print-jobs -target arm64-apple-ios7 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-IOS %s
27+
28+
// RUN: %host-library-env %t/bin/swiftc -driver-print-jobs -target x86_64-apple-tvos9-simulator %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-TVOSSIM %s
29+
// RUN: %host-library-env %t/bin/swiftc -driver-print-jobs -target x86_64-apple-tvos9 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-TVOSSIM %s
30+
// RUN: %host-library-env %t/bin/swiftc -driver-print-jobs -target arm64-apple-tvos9-simulator %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-TVOSSIM %s
31+
// RUN: %host-library-env %t/bin/swiftc -driver-print-jobs -target arm64-apple-tvos9 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-TVOS %s
32+
33+
// RUN: %host-library-env %t/bin/swiftc -driver-print-jobs -target i386-apple-watchos2-simulator %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-WATCHOSSIM %s
34+
// RUN: %host-library-env %t/bin/swiftc -driver-print-jobs -target i386-apple-watchos2 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-WATCHOSSIM %s
35+
// RUN: %host-library-env %t/bin/swiftc -driver-print-jobs -target armv7k-apple-watchos2 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-WATCHOS %s
36+
// RUN: %host-library-env %t/bin/swiftc -driver-print-jobs -target arm64-apple-watchos2-simulator %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-WATCHOSSIM %s
3837

3938
// Clean up the test executable because hard links are expensive.
4039
// RUN: rm -f %t/bin/swiftc

test/Driver/options-repl-darwin.swift

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,19 @@
77
// RUN: %empty-directory(%t/usr/bin/)
88
// RUN: %empty-directory(%t/usr/lib/)
99
// RUN: %hardlink-or-copy(from: %swift_driver_plain, to: %t/usr/bin/swift)
10-
// RUN: %copy-plugin-support-library(%t/usr/lib/)
1110

12-
// RUN: %t/usr/bin/swift -repl -### | %FileCheck -check-prefix=INTEGRATED %s
13-
// RUN: %t/usr/bin/swift -### | %FileCheck -check-prefix=INTEGRATED %s
11+
// RUN: %host-library-env %t/usr/bin/swift -repl -### | %FileCheck -check-prefix=INTEGRATED %s
12+
// RUN: %host-library-env %t/usr/bin/swift -### | %FileCheck -check-prefix=INTEGRATED %s
1413

1514
// RUN: touch %t/usr/bin/lldb
1615
// RUN: chmod +x %t/usr/bin/lldb
17-
// RUN: %t/usr/bin/swift -repl -### | %FileCheck -check-prefix=LLDB %s
18-
// RUN: %t/usr/bin/swift -### | %FileCheck -check-prefix=LLDB %s
16+
// RUN: %host-library-env %t/usr/bin/swift -repl -### | %FileCheck -check-prefix=LLDB %s
17+
// RUN: %host-library-env %t/usr/bin/swift -### | %FileCheck -check-prefix=LLDB %s
1918

2019
// RUN: %empty-directory(%t/Toolchains/Test.xctoolchain/usr/bin)
2120
// RUN: %empty-directory(%t/Toolchains/Test.xctoolchain/usr/lib)
2221
// RUN: mv %t/usr/bin/swift %t/Toolchains/Test.xctoolchain/usr/bin/swift
23-
// RUN: %copy-plugin-support-library(%t/Toolchains/Test.xctoolchain/usr/lib/)
24-
// RUN: %t/Toolchains/Test.xctoolchain/usr/bin/swift -repl -### | %FileCheck -check-prefix=LLDB %s
22+
// RUN: %host-library-env %t/Toolchains/Test.xctoolchain/usr/bin/swift -repl -### | %FileCheck -check-prefix=LLDB %s
2523

2624
// Clean up the test executable because hard links are expensive.
2725
// RUN: rm -rf %t/Toolchains/Test.xctoolchain/usr/bin/swift

test/Driver/options-repl.swift

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@
88
// RUN: %empty-directory(%t)
99
// RUN: mkdir -p %t/usr/bin
1010
// RUN: mkdir -p %t/usr/lib
11-
// RUN: %copy-plugin-support-library(%t/usr/lib/)
1211
// RUN: %hardlink-or-copy(from: %swift_frontend_plain, to: %t/usr/bin/swift)
1312

14-
// RUN: %t/usr/bin/swift -sdk "" -deprecated-integrated-repl -### | %FileCheck -check-prefix=INTEGRATED %s
13+
// RUN: %host-library-env %t/usr/bin/swift -sdk "" -deprecated-integrated-repl -### | %FileCheck -check-prefix=INTEGRATED %s
1514

1615
// INTEGRATED: swift{{c?(\.exe)?"?}} -frontend -repl
1716
// INTEGRATED: -module-name REPL
@@ -46,10 +45,10 @@
4645
// like the Xcode installation environment. We use hard links to make sure
4746
// the Swift driver really thinks it's been moved.
4847

49-
// RUN: %t/usr/bin/swift -sdk "" -repl -### | %FileCheck -check-prefix=INTEGRATED %s
50-
// RUN: %t/usr/bin/swift -sdk "" -### | %FileCheck -check-prefix=INTEGRATED %s
48+
// RUN: %host-library-env %t/usr/bin/swift -sdk "" -repl -### | %FileCheck -check-prefix=INTEGRATED %s
49+
// RUN: %host-library-env %t/usr/bin/swift -sdk "" -### | %FileCheck -check-prefix=INTEGRATED %s
5150

5251
// RUN: touch %t/usr/bin/lldb
5352
// RUN: chmod +x %t/usr/bin/lldb
54-
// RUN: %t/usr/bin/swift -sdk "" -repl -### | %FileCheck -check-prefix=LLDB %s
55-
// RUN: %t/usr/bin/swift -sdk "" -### | %FileCheck -check-prefix=LLDB %s
53+
// RUN: %host-library-env %t/usr/bin/swift -sdk "" -repl -### | %FileCheck -check-prefix=LLDB %s
54+
// RUN: %host-library-env %t/usr/bin/swift -sdk "" -### | %FileCheck -check-prefix=LLDB %s

test/Driver/subcommands.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
// RUN: mkdir -p %t.dir/usr/bin
66
// RUN: mkdir -p %t.dir/usr/lib
77
// RUN: %hardlink-or-copy(from: %swift_frontend_plain, to: %t.dir/usr/bin/swift)
8-
// RUN: %copy-plugin-support-library(%t.dir/usr/lib/)
98

10-
// RUN: %t.dir/usr/bin/swift -### 2>&1 | %FileCheck -check-prefix=CHECK-SWIFT-INVOKES-REPL %s
11-
// RUN: %t.dir/usr/bin/swift repl -### 2>&1 | %FileCheck -check-prefix=CHECK-SWIFT-INVOKES-REPL %s
9+
// RUN: %host-library-env %t.dir/usr/bin/swift -### 2>&1 | %FileCheck -check-prefix=CHECK-SWIFT-INVOKES-REPL %s
10+
// RUN: %host-library-env %t.dir/usr/bin/swift repl -### 2>&1 | %FileCheck -check-prefix=CHECK-SWIFT-INVOKES-REPL %s
1211

1312
// CHECK-SWIFT-INVOKES-REPL: {{.*}}/swift{{.*}} -repl
1413

test/Driver/windows-link-job.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
// RUN: %empty-directory(%t/DISTINCTIVE-WINDOWS-PATH/usr/bin)
22
// RUN: %empty-directory(%t/DISTINCTIVE-WINDOWS-PATH/usr/lib)
33
// RUN: %hardlink-or-copy(from: %swift_frontend_plain, to: %t/DISTINCTIVE-WINDOWS-PATH/usr/bin/swiftc)
4-
// RUN: %copy-plugin-support-library(%t/DISTINCTIVE-WINDOWS-PATH/usr/lib/)
5-
// RUN: env PATH= %t/DISTINCTIVE-WINDOWS-PATH/usr/bin/swiftc -target x86_64-unknown-windows-msvc -### -module-name link -emit-library %s 2>&1 | %FileCheck %s
4+
// RUN: %host-library-env PATH= %t/DISTINCTIVE-WINDOWS-PATH/usr/bin/swiftc -target x86_64-unknown-windows-msvc -### -module-name link -emit-library %s 2>&1 | %FileCheck %s
65

76
// swift-frontend cannot be copied to another location with bootstrapping because
87
// it will not find the libswiftCore library with its relative RPATH.

0 commit comments

Comments
 (0)