Skip to content

Commit 9bc45e1

Browse files
committed
[build-script] Removed the always-broken support for building PlaygroundLogger on Linux.
As far as I can tell, this never worked, so removing it cannot break anything. Now PlaygroundLogger is treated similarly to PlaygroundSupport, directly referencing xcodebuild instead of indirecting through variables. This commit also introduces explicit error messages when attempting to build PlaygroundLogger or PlaygroundSupport for non-Darwin platforms. This addresses <rdar://problem/36594779>.
1 parent ccdba81 commit 9bc45e1

File tree

1 file changed

+19
-30
lines changed

1 file changed

+19
-30
lines changed

utils/build-script-impl

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -446,14 +446,6 @@ function set_build_options_for_host() {
446446
case ${host} in
447447
linux-x86_64)
448448
SWIFT_HOST_VARIANT_ARCH="x86_64"
449-
playgroundlogger_build_cmd="${PLAYGROUNDLOGGER_SOURCE_DIR}/build.py"
450-
playgroundlogger_build_options=(
451-
--swiftc "$(build_directory_bin ${host} swift)"
452-
--foundation "$(build_directory ${host} foundation)"
453-
--build-dir "$(build_directory ${host} playgroundlogger)"
454-
--swift-build-dir "$(build_directory ${host} swift)"
455-
--$(tolower "${PLAYGROUNDLOGGER_BUILD_TYPE}")
456-
)
457449
;;
458450
linux-armv6)
459451
SWIFT_HOST_VARIANT_ARCH="armv6"
@@ -501,7 +493,6 @@ function set_build_options_for_host() {
501493
swiftpm_bootstrap_options=(
502494
--sysroot="$(xcrun --sdk ${xcrun_sdk_name} --show-sdk-path)"
503495
)
504-
playgroundlogger_build_cmd="xcodebuild"
505496
playgroundlogger_build_target=("PlaygroundLogger_TestDriver")
506497
PLAYGROUNDLOGGER_INSTALL_PLATFORM="MacOSX.platform"
507498
;;
@@ -519,7 +510,6 @@ function set_build_options_for_host() {
519510
-DCMAKE_CXX_FLAGS="$(cmark_c_flags ${host})"
520511
-DCMAKE_OSX_SYSROOT:PATH="$(xcrun --sdk ${xcrun_sdk_name} --show-sdk-path)"
521512
)
522-
playgroundlogger_build_cmd="xcodebuild"
523513
playgroundlogger_build_target=("PlaygroundLogger_iOS")
524514
PLAYGROUNDLOGGER_INSTALL_PLATFORM="iPhoneSimulator.platform"
525515
;;
@@ -537,7 +527,6 @@ function set_build_options_for_host() {
537527
-DCMAKE_CXX_FLAGS="$(cmark_c_flags ${host})"
538528
-DCMAKE_OSX_SYSROOT:PATH="$(xcrun --sdk ${xcrun_sdk_name} --show-sdk-path)"
539529
)
540-
playgroundlogger_build_cmd="xcodebuild"
541530
playgroundlogger_build_target=("PlaygroundLogger_iOS")
542531
PLAYGROUNDLOGGER_INSTALL_PLATFORM="iPhoneSimulator.platform"
543532
;;
@@ -555,7 +544,6 @@ function set_build_options_for_host() {
555544
-DCMAKE_CXX_FLAGS="$(cmark_c_flags ${host})"
556545
-DCMAKE_OSX_SYSROOT:PATH="$(xcrun --sdk ${xcrun_sdk_name} --show-sdk-path)"
557546
)
558-
playgroundlogger_build_cmd="xcodebuild"
559547
playgroundlogger_build_target=("PlaygroundLogger_iOS")
560548
PLAYGROUNDLOGGER_INSTALL_PLATFORM="iPhoneOS.platform"
561549
;;
@@ -573,7 +561,6 @@ function set_build_options_for_host() {
573561
-DCMAKE_CXX_FLAGS="$(cmark_c_flags ${host})"
574562
-DCMAKE_OSX_SYSROOT:PATH="$(xcrun --sdk ${xcrun_sdk_name} --show-sdk-path)"
575563
)
576-
playgroundlogger_build_cmd="xcodebuild"
577564
playgroundlogger_build_target=("PlaygroundLogger_iOS")
578565
PLAYGROUNDLOGGER_INSTALL_PLATFORM="iPhoneOS.platform"
579566
;;
@@ -591,7 +578,6 @@ function set_build_options_for_host() {
591578
-DCMAKE_CXX_FLAGS="$(cmark_c_flags ${host})"
592579
-DCMAKE_OSX_SYSROOT:PATH="$(xcrun --sdk ${xcrun_sdk_name} --show-sdk-path)"
593580
)
594-
playgroundlogger_build_cmd="xcodebuild"
595581
playgroundlogger_build_target=("PlaygroundLogger_iOS")
596582
PLAYGROUNDLOGGER_INSTALL_PLATFORM="iPhoneOS.platform"
597583
;;
@@ -609,7 +595,6 @@ function set_build_options_for_host() {
609595
-DCMAKE_CXX_FLAGS="$(cmark_c_flags ${host})"
610596
-DCMAKE_OSX_SYSROOT:PATH="$(xcrun --sdk ${xcrun_sdk_name} --show-sdk-path)"
611597
)
612-
playgroundlogger_build_cmd="xcodebuild"
613598
playgroundlogger_build_target=("PlaygroundLogger_tvOS")
614599
PLAYGROUNDLOGGER_INSTALL_PLATFORM="AppleTVSimulator.platform"
615600
;;
@@ -627,7 +612,6 @@ function set_build_options_for_host() {
627612
-DCMAKE_CXX_FLAGS="$(cmark_c_flags ${host})"
628613
-DCMAKE_OSX_SYSROOT:PATH="$(xcrun --sdk ${xcrun_sdk_name} --show-sdk-path)"
629614
)
630-
playgroundlogger_build_cmd="xcodebuild"
631615
playgroundlogger_build_target=("PlaygroundLogger_tvOS")
632616
PLAYGROUNDLOGGER_INSTALL_PLATFORM="AppleTVOS.platform"
633617
;;
@@ -2657,18 +2641,28 @@ for host in "${ALL_HOSTS[@]}"; do
26572641
continue
26582642
;;
26592643
playgroundlogger)
2644+
if [[ "$(uname -s)" != "Darwin" ]]; then
2645+
echo "error: unable to build PlaygroundLogger on this platform"
2646+
exit 1
2647+
fi
2648+
26602649
PLAYGROUNDLOGGER_BUILD_DIR=$(build_directory ${host} ${product})
26612650
SWIFTC_BIN="$(build_directory_bin ${host} swift)/swiftc"
26622651

26632652
set -x
26642653
pushd "${PLAYGROUNDLOGGER_SOURCE_DIR}"
26652654
mkdir -p "${PLAYGROUNDLOGGER_BUILD_DIR}"
2666-
"${playgroundlogger_build_cmd}" -configuration "${PLAYGROUNDLOGGER_BUILD_TYPE}" -target "${playgroundlogger_build_target}" install SWIFT_EXEC="${SWIFTC_BIN}" DSTROOT=${build_dir} INSTALL_PATH="/" SKIP_INSTALL=NO
2655+
"xcodebuild" -configuration "${PLAYGROUNDLOGGER_BUILD_TYPE}" -target "${playgroundlogger_build_target}" install SWIFT_EXEC="${SWIFTC_BIN}" DSTROOT=${build_dir} INSTALL_PATH="/" SKIP_INSTALL=NO
26672656
popd
26682657
{ set +x; } 2>/dev/null
26692658
continue
26702659
;;
26712660
playgroundsupport)
2661+
if [[ "$(uname -s)" != "Darwin" ]]; then
2662+
echo "error: unable to build PlaygroundSupport on this platform"
2663+
exit 1
2664+
fi
2665+
26722666
PLAYGROUNDSUPPORT_BUILD_DIR=$(build_directory ${host} ${product})
26732667
SWIFTC_BIN="$(build_directory_bin ${host} swift)/swiftc"
26742668

@@ -2999,6 +2993,10 @@ for host in "${ALL_HOSTS[@]}"; do
29992993
continue
30002994
;;
30012995
playgroundlogger)
2996+
if [[ "${host}" != "macosx"* ]]; then
2997+
echo "Skipping PlaygroundLogger tests on non-macOS platform"
2998+
continue
2999+
fi
30023000
SWIFT_DYLIB_PATH=$(build_directory ${host} swift)/lib/swift/macosx/
30033001
PLAYGROUNDLOGGER_FRAMEWORK_PATH=$(build_directory ${host} ${product})
30043002
set -x
@@ -3322,11 +3320,6 @@ for host in "${ALL_HOSTS[@]}"; do
33223320
# requires root permissions.
33233321
set -x
33243322
case "$(uname -s)" in
3325-
Linux)
3326-
PLAYGROUNDLOGGER_INSTALL_DIR="$(get_host_install_destdir ${host})/$(get_host_install_prefix ${host})/lib/swift/linux"
3327-
mkdir -p "${PLAYGROUNDLOGGER_INSTALL_DIR}"
3328-
cp -R "${PLAYGROUNDLOGGER_BUILD_DIR}"/libPlaygroundLogger.so "${PLAYGROUNDLOGGER_INSTALL_DIR}"
3329-
;;
33303323
Darwin)
33313324
pushd "${PLAYGROUNDLOGGER_SOURCE_DIR}"
33323325
xcodebuild -target "All Platforms Logger" -configuration Toolchain_${PLAYGROUNDLOGGER_BUILD_TYPE} install SWIFT_EXEC="${SWIFTC_BIN}" DT_TOOLCHAIN_DIR="${TOOLCHAIN_PREFIX}" DSTROOT="$(get_host_install_destdir ${host})"
@@ -3349,20 +3342,16 @@ for host in "${ALL_HOSTS[@]}"; do
33493342
continue
33503343
fi
33513344
case "$(uname -s)" in
3352-
Linux)
3353-
;;
3354-
FreeBSD)
3355-
;;
3356-
CYGWIN_NT-10.0)
3357-
;;
3358-
Haiku)
3359-
;;
33603345
Darwin)
33613346
pushd "${PLAYGROUNDSUPPORT_SOURCE_DIR}"
33623347
xcodebuild -target AllProducts -configuration ${PLAYGROUNDSUPPORT_BUILD_TYPE} install SWIFT_EXEC="${SWIFTC_BIN}" DT_TOOLCHAIN_DIR="${TOOLCHAIN_PREFIX}" DSTROOT="$(get_host_install_destdir ${host})"
33633348
popd
33643349
continue
33653350
;;
3351+
*)
3352+
echo "error: --install-playgroundsupport is not supported on this platform"
3353+
exit 1
3354+
;;
33663355
esac
33673356
{ set +x; } 2>/dev/null
33683357
;;

0 commit comments

Comments
 (0)