Skip to content

Commit 4fff99b

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>. (cherry picked from commit 9bc45e1)
1 parent 4ebcde8 commit 4fff99b

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
@@ -444,14 +444,6 @@ function set_build_options_for_host() {
444444
case ${host} in
445445
linux-x86_64)
446446
SWIFT_HOST_VARIANT_ARCH="x86_64"
447-
playgroundlogger_build_cmd="${PLAYGROUNDLOGGER_SOURCE_DIR}/build.py"
448-
playgroundlogger_build_options=(
449-
--swiftc "$(build_directory_bin ${host} swift)"
450-
--foundation "$(build_directory ${host} foundation)"
451-
--build-dir "$(build_directory ${host} playgroundlogger)"
452-
--swift-build-dir "$(build_directory ${host} swift)"
453-
--$(tolower "${PLAYGROUNDLOGGER_BUILD_TYPE}")
454-
)
455447
;;
456448
linux-armv6)
457449
SWIFT_HOST_VARIANT_ARCH="armv6"
@@ -499,7 +491,6 @@ function set_build_options_for_host() {
499491
swiftpm_bootstrap_options=(
500492
--sysroot="$(xcrun --sdk ${xcrun_sdk_name} --show-sdk-path)"
501493
)
502-
playgroundlogger_build_cmd="xcodebuild"
503494
playgroundlogger_build_target=("PlaygroundLogger_TestDriver")
504495
PLAYGROUNDLOGGER_INSTALL_PLATFORM="MacOSX.platform"
505496
;;
@@ -517,7 +508,6 @@ function set_build_options_for_host() {
517508
-DCMAKE_CXX_FLAGS="$(cmark_c_flags ${host})"
518509
-DCMAKE_OSX_SYSROOT:PATH="$(xcrun --sdk ${xcrun_sdk_name} --show-sdk-path)"
519510
)
520-
playgroundlogger_build_cmd="xcodebuild"
521511
playgroundlogger_build_target=("PlaygroundLogger_iOS")
522512
PLAYGROUNDLOGGER_INSTALL_PLATFORM="iPhoneSimulator.platform"
523513
;;
@@ -535,7 +525,6 @@ function set_build_options_for_host() {
535525
-DCMAKE_CXX_FLAGS="$(cmark_c_flags ${host})"
536526
-DCMAKE_OSX_SYSROOT:PATH="$(xcrun --sdk ${xcrun_sdk_name} --show-sdk-path)"
537527
)
538-
playgroundlogger_build_cmd="xcodebuild"
539528
playgroundlogger_build_target=("PlaygroundLogger_iOS")
540529
PLAYGROUNDLOGGER_INSTALL_PLATFORM="iPhoneSimulator.platform"
541530
;;
@@ -553,7 +542,6 @@ function set_build_options_for_host() {
553542
-DCMAKE_CXX_FLAGS="$(cmark_c_flags ${host})"
554543
-DCMAKE_OSX_SYSROOT:PATH="$(xcrun --sdk ${xcrun_sdk_name} --show-sdk-path)"
555544
)
556-
playgroundlogger_build_cmd="xcodebuild"
557545
playgroundlogger_build_target=("PlaygroundLogger_iOS")
558546
PLAYGROUNDLOGGER_INSTALL_PLATFORM="iPhoneOS.platform"
559547
;;
@@ -571,7 +559,6 @@ function set_build_options_for_host() {
571559
-DCMAKE_CXX_FLAGS="$(cmark_c_flags ${host})"
572560
-DCMAKE_OSX_SYSROOT:PATH="$(xcrun --sdk ${xcrun_sdk_name} --show-sdk-path)"
573561
)
574-
playgroundlogger_build_cmd="xcodebuild"
575562
playgroundlogger_build_target=("PlaygroundLogger_iOS")
576563
PLAYGROUNDLOGGER_INSTALL_PLATFORM="iPhoneOS.platform"
577564
;;
@@ -589,7 +576,6 @@ function set_build_options_for_host() {
589576
-DCMAKE_CXX_FLAGS="$(cmark_c_flags ${host})"
590577
-DCMAKE_OSX_SYSROOT:PATH="$(xcrun --sdk ${xcrun_sdk_name} --show-sdk-path)"
591578
)
592-
playgroundlogger_build_cmd="xcodebuild"
593579
playgroundlogger_build_target=("PlaygroundLogger_iOS")
594580
PLAYGROUNDLOGGER_INSTALL_PLATFORM="iPhoneOS.platform"
595581
;;
@@ -607,7 +593,6 @@ function set_build_options_for_host() {
607593
-DCMAKE_CXX_FLAGS="$(cmark_c_flags ${host})"
608594
-DCMAKE_OSX_SYSROOT:PATH="$(xcrun --sdk ${xcrun_sdk_name} --show-sdk-path)"
609595
)
610-
playgroundlogger_build_cmd="xcodebuild"
611596
playgroundlogger_build_target=("PlaygroundLogger_tvOS")
612597
PLAYGROUNDLOGGER_INSTALL_PLATFORM="AppleTVSimulator.platform"
613598
;;
@@ -625,7 +610,6 @@ function set_build_options_for_host() {
625610
-DCMAKE_CXX_FLAGS="$(cmark_c_flags ${host})"
626611
-DCMAKE_OSX_SYSROOT:PATH="$(xcrun --sdk ${xcrun_sdk_name} --show-sdk-path)"
627612
)
628-
playgroundlogger_build_cmd="xcodebuild"
629613
playgroundlogger_build_target=("PlaygroundLogger_tvOS")
630614
PLAYGROUNDLOGGER_INSTALL_PLATFORM="AppleTVOS.platform"
631615
;;
@@ -2621,18 +2605,28 @@ for host in "${ALL_HOSTS[@]}"; do
26212605
continue
26222606
;;
26232607
playgroundlogger)
2608+
if [[ "$(uname -s)" != "Darwin" ]]; then
2609+
echo "error: unable to build PlaygroundLogger on this platform"
2610+
exit 1
2611+
fi
2612+
26242613
PLAYGROUNDLOGGER_BUILD_DIR=$(build_directory ${host} ${product})
26252614
SWIFTC_BIN="$(build_directory_bin ${host} swift)/swiftc"
26262615

26272616
set -x
26282617
pushd "${PLAYGROUNDLOGGER_SOURCE_DIR}"
26292618
mkdir -p "${PLAYGROUNDLOGGER_BUILD_DIR}"
2630-
"${playgroundlogger_build_cmd}" -configuration "${PLAYGROUNDLOGGER_BUILD_TYPE}" -target "${playgroundlogger_build_target}" install SWIFT_EXEC="${SWIFTC_BIN}" DSTROOT=${build_dir} INSTALL_PATH="/" SKIP_INSTALL=NO
2619+
"xcodebuild" -configuration "${PLAYGROUNDLOGGER_BUILD_TYPE}" -target "${playgroundlogger_build_target}" install SWIFT_EXEC="${SWIFTC_BIN}" DSTROOT=${build_dir} INSTALL_PATH="/" SKIP_INSTALL=NO
26312620
popd
26322621
{ set +x; } 2>/dev/null
26332622
continue
26342623
;;
26352624
playgroundsupport)
2625+
if [[ "$(uname -s)" != "Darwin" ]]; then
2626+
echo "error: unable to build PlaygroundSupport on this platform"
2627+
exit 1
2628+
fi
2629+
26362630
PLAYGROUNDSUPPORT_BUILD_DIR=$(build_directory ${host} ${product})
26372631
SWIFTC_BIN="$(build_directory_bin ${host} swift)/swiftc"
26382632

@@ -2964,6 +2958,10 @@ for host in "${ALL_HOSTS[@]}"; do
29642958
continue
29652959
;;
29662960
playgroundlogger)
2961+
if [[ "${host}" != "macosx"* ]]; then
2962+
echo "Skipping PlaygroundLogger tests on non-macOS platform"
2963+
continue
2964+
fi
29672965
SWIFT_DYLIB_PATH=$(build_directory ${host} swift)/lib/swift/macosx/
29682966
PLAYGROUNDLOGGER_FRAMEWORK_PATH=$(build_directory ${host} ${product})
29692967
set -x
@@ -3287,11 +3285,6 @@ for host in "${ALL_HOSTS[@]}"; do
32873285
# requires root permissions.
32883286
set -x
32893287
case "$(uname -s)" in
3290-
Linux)
3291-
PLAYGROUNDLOGGER_INSTALL_DIR="$(get_host_install_destdir ${host})/$(get_host_install_prefix ${host})/lib/swift/linux"
3292-
mkdir -p "${PLAYGROUNDLOGGER_INSTALL_DIR}"
3293-
cp -R "${PLAYGROUNDLOGGER_BUILD_DIR}"/libPlaygroundLogger.so "${PLAYGROUNDLOGGER_INSTALL_DIR}"
3294-
;;
32953288
Darwin)
32963289
pushd "${PLAYGROUNDLOGGER_SOURCE_DIR}"
32973290
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})"
@@ -3314,20 +3307,16 @@ for host in "${ALL_HOSTS[@]}"; do
33143307
continue
33153308
fi
33163309
case "$(uname -s)" in
3317-
Linux)
3318-
;;
3319-
FreeBSD)
3320-
;;
3321-
CYGWIN_NT-10.0)
3322-
;;
3323-
Haiku)
3324-
;;
33253310
Darwin)
33263311
pushd "${PLAYGROUNDSUPPORT_SOURCE_DIR}"
33273312
xcodebuild -target AllProducts -configuration ${PLAYGROUNDSUPPORT_BUILD_TYPE} install SWIFT_EXEC="${SWIFTC_BIN}" DT_TOOLCHAIN_DIR="${TOOLCHAIN_PREFIX}" DSTROOT="$(get_host_install_destdir ${host})"
33283313
popd
33293314
continue
33303315
;;
3316+
*)
3317+
echo "error: --install-playgroundsupport is not supported on this platform"
3318+
exit 1
3319+
;;
33313320
esac
33323321
{ set +x; } 2>/dev/null
33333322
;;

0 commit comments

Comments
 (0)