Skip to content

Commit 598fea2

Browse files
committed
[build-script] XCTest xcodebuild uses SWIFT_EXEC
Because the `xcodebuild` invocation used to compile swift-corelibs-xctest on OS X uses a toolchain that is usually out of date, it often fails (for example, when building the newly migrated Swift 3 code). Pass the path to the freshly built `swiftc` to `xcodebuild` in order to use the latest Swift compiler.
1 parent a3b8806 commit 598fea2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

utils/build-script-impl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1900,19 +1900,20 @@ for deployment_target in "${HOST_TARGET}" "${CROSS_TOOLS_DEPLOYMENT_TARGETS[@]}"
19001900
continue
19011901
;;
19021902
xctest)
1903+
SWIFTC_BIN="$(build_directory_bin ${deployment_target} swift)/swiftc"
19031904
XCTEST_BUILD_DIR=$(build_directory ${deployment_target} xctest)
19041905
if [[ "$(uname -s)" == "Darwin" ]] ; then
19051906
set -x
19061907
xcodebuild \
19071908
-workspace "${XCTEST_SOURCE_DIR}"/XCTest.xcworkspace \
19081909
-scheme SwiftXCTest \
1910+
SWIFT_EXEC="${SWIFTC_BIN}" \
19091911
SKIP_INSTALL=NO \
19101912
DEPLOYMENT_LOCATION=YES \
19111913
DSTROOT="${XCTEST_BUILD_DIR}" \
19121914
INSTALL_PATH="/"
19131915
{ set +x; } 2>/dev/null
19141916
else
1915-
SWIFTC_BIN="$(build_directory_bin ${deployment_target} swift)/swiftc"
19161917
FOUNDATION_BUILD_DIR=$(build_directory ${deployment_target} foundation)
19171918
set -x
19181919
# FIXME: Use XCTEST_BUILD_TYPE (which is never properly
@@ -2168,14 +2169,15 @@ for deployment_target in "${STDLIB_DEPLOYMENT_TARGETS[@]}"; do
21682169
continue
21692170
fi
21702171
echo "--- Running tests for ${product} ---"
2172+
SWIFTC_BIN="$(build_directory_bin ${deployment_target} swift)/swiftc"
21712173
if [[ "$(uname -s)" == "Darwin" ]] ; then
21722174
set -x
21732175
xcodebuild \
21742176
-workspace "${XCTEST_SOURCE_DIR}"/XCTest.xcworkspace \
2175-
-scheme SwiftXCTestFunctionalTests
2177+
-scheme SwiftXCTestFunctionalTests \
2178+
SWIFT_EXEC="${SWIFTC_BIN}"
21762179
{ set +x; } 2>/dev/null
21772180
else
2178-
SWIFTC_BIN="$(build_directory_bin ${deployment_target} swift)/swiftc"
21792181
FOUNDATION_BUILD_DIR=$(build_directory ${deployment_target} foundation)
21802182
XCTEST_BUILD_DIR=$(build_directory ${deployment_target} xctest)
21812183
set -x

0 commit comments

Comments
 (0)