Skip to content

Commit bcd6416

Browse files
authored
Revert "[Concurrency] Build C only libdispatch before Swift on non-Darwin pla… (swiftlang#35738)" (swiftlang#35789)
This reverts commit 74e59ab.
1 parent d9a3dcd commit bcd6416

16 files changed

+15
-219
lines changed

stdlib/public/Concurrency/CMakeLists.txt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,16 @@ set(LLVM_OPTIONAL_SOURCES
1919
set(swift_concurrency_link_libraries
2020
swiftCore)
2121

22-
set(swift_concurrency_link_flags "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}")
23-
2422
if(SWIFT_CONCURRENCY_USES_DISPATCH)
2523
if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
2624
include_directories(AFTER
2725
${SWIFT_PATH_TO_LIBDISPATCH_SOURCE})
28-
link_directories(AFTER
29-
${SWIFT_PATH_TO_LIBDISPATCH_BUILD})
3026

31-
list(APPEND swift_concurrency_link_flags
32-
"-ldispatch")
27+
# FIXME: we can't rely on libdispatch having been built for the
28+
# target at this point in the process. Currently, we're relying
29+
# on soft-linking.
30+
#list(APPEND swift_concurrency_link_libraries
31+
# dispatch)
3332
endif()
3433
endif()
3534

@@ -68,6 +67,6 @@ add_swift_target_library(swift_Concurrency ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} I
6867
${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
6968
-parse-stdlib
7069
-Xfrontend -enable-experimental-concurrency
71-
LINK_FLAGS "${swift_concurrency_link_flags}"
70+
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}"
7271
INSTALL_IN_COMPONENT stdlib
7372
)

utils/build-presets.ini

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,6 @@ long-test
824824
stress-test
825825
test-optimized
826826
foundation
827-
clibdispatch
828827
libdispatch
829828
indexstore-db
830829
sourcekit-lsp
@@ -967,7 +966,6 @@ release
967966
test
968967
validation-test
969968
foundation
970-
clibdispatch
971969
libdispatch
972970
indexstore-db
973971
sourcekit-lsp
@@ -1067,7 +1065,6 @@ swiftpm
10671065
swift-driver
10681066
xctest
10691067
foundation
1070-
clibdispatch
10711068
libdispatch
10721069
swiftsyntax
10731070
indexstore-db
@@ -1596,7 +1593,6 @@ mixin-preset=
15961593
mixin_swiftpm_base
15971594
mixin_linux_install_components_with_clang
15981595

1599-
clibdispatch
16001596
libdispatch
16011597
libicu
16021598
foundation
@@ -1845,7 +1841,6 @@ llbuild
18451841
swiftpm
18461842
xctest
18471843
foundation
1848-
clibdispatch
18491844
libdispatch
18501845
indexstore-db
18511846
sourcekit-lsp
@@ -2461,7 +2456,6 @@ install-symroot=%(install_symroot)s
24612456
mixin-preset=source_compat_suite_base
24622457
build-subdir=compat_linux
24632458
foundation
2464-
clibdispatch
24652459
libdispatch
24662460
xctest
24672461
install-foundation
@@ -2517,7 +2511,6 @@ no-assertions
25172511
lldb
25182512
foundation
25192513
libicu
2520-
clibdispatch
25212514
libdispatch
25222515
build-ninja
25232516

utils/build-script

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -318,10 +318,6 @@ def apply_default_arguments(toolchain, args):
318318
args.stdlib_deployment_targets = [
319319
target.name for target in stdlib_targets]
320320

321-
if (args.build_swift and
322-
platform.system() != "Darwin"):
323-
args.build_clibdispatch = True
324-
325321
# SwiftPM and XCTest have a dependency on Foundation.
326322
# On OS X, Foundation is built automatically using xcodebuild.
327323
# On Linux, we must ensure that it is built manually.
@@ -628,7 +624,6 @@ class BuildScriptInvocation(object):
628624
(args.build_llbuild, "llbuild"),
629625
(args.build_libcxx, "libcxx"),
630626
(args.build_libdispatch, "libdispatch"),
631-
(args.build_clibdispatch, "clibdispatch"),
632627
(args.build_libicu, "libicu")
633628
]
634629
for (should_build, string_name) in conditional_subproject_configs:
@@ -870,8 +865,6 @@ class BuildScriptInvocation(object):
870865
impl_product_classes.append(products.LibCXX)
871866
if self.args.build_libicu:
872867
impl_product_classes.append(products.LibICU)
873-
if self.args.build_clibdispatch:
874-
impl_product_classes.append(products.CLibDispatch)
875868
if self.args.build_swift:
876869
impl_product_classes.append(products.Swift)
877870
if self.args.build_lldb:

utils/build-script-impl

Lines changed: 8 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ KNOWN_SETTINGS=(
230230
)
231231

232232
components=(
233-
clibdispatch
234233
cmark
235234
foundation
236235
libcxx
@@ -1163,7 +1162,6 @@ STRESSTEST_PACKAGE_DIR="${WORKSPACE}/swift-stress-tester"
11631162
XCTEST_SOURCE_DIR="${WORKSPACE}/swift-corelibs-xctest"
11641163
FOUNDATION_SOURCE_DIR="${WORKSPACE}/swift-corelibs-foundation"
11651164
FOUNDATION_STATIC_SOURCE_DIR="${WORKSPACE}/swift-corelibs-foundation"
1166-
CLIBDISPATCH_SOURCE_DIR="${WORKSPACE}/swift-corelibs-libdispatch"
11671165
LIBDISPATCH_SOURCE_DIR="${WORKSPACE}/swift-corelibs-libdispatch"
11681166
LIBDISPATCH_STATIC_SOURCE_DIR="${WORKSPACE}/swift-corelibs-libdispatch"
11691167
LIBICU_SOURCE_DIR="${WORKSPACE}/icu"
@@ -1177,7 +1175,6 @@ PRODUCTS=(llvm)
11771175
[[ "${SKIP_BUILD_CMARK}" ]] || PRODUCTS+=(cmark)
11781176
[[ "${SKIP_BUILD_LIBCXX}" ]] || PRODUCTS+=(libcxx)
11791177
[[ "${SKIP_BUILD_LIBICU}" ]] || PRODUCTS+=(libicu)
1180-
[[ "${SKIP_BUILD_CLIBDISPATCH}" ]] || PRODUCTS+=(clibdispatch)
11811178
[[ "${SKIP_BUILD_SWIFT}" ]] || PRODUCTS+=(swift)
11821179
[[ "${SKIP_BUILD_LLDB}" ]] || PRODUCTS+=(lldb)
11831180
[[ "${SKIP_BUILD_LIBDISPATCH}" ]] || PRODUCTS+=(libdispatch)
@@ -1262,7 +1259,7 @@ function build_directory_bin() {
12621259
foundation|foundation_static)
12631260
echo "${root}/${FOUNDATION_BUILD_TYPE}/bin"
12641261
;;
1265-
clibdispatch|libdispatch|libdispatch_static)
1262+
libdispatch|libdispatch_static)
12661263
echo "${root}/${LIBDISPATCH_BUILD_TYPE}/bin"
12671264
;;
12681265
libicu)
@@ -1380,7 +1377,7 @@ function cmake_config_opt() {
13801377
foundation|foundation_static)
13811378
echo "--config ${FOUNDATION_BUILD_TYPE}"
13821379
;;
1383-
clibdispatch|libdispatch|libdispatch_static)
1380+
libdispatch|libdispatch_static)
13841381
echo "--config ${LIBDISPATCH_BUILD_TYPE}"
13851382
;;
13861383
libicu)
@@ -1767,6 +1764,7 @@ for host in "${ALL_HOSTS[@]}"; do
17671764
;;
17681765

17691766
swift)
1767+
17701768
if [[ "${ANDROID_API_LEVEL}" ]]; then
17711769
cmake_options=(
17721770
"${cmake_options[@]}"
@@ -2322,18 +2320,9 @@ for host in "${ALL_HOSTS[@]}"; do
23222320
)
23232321

23242322
;;
2325-
clibdispatch|libdispatch|libdispatch_static)
2323+
libdispatch|libdispatch_static)
23262324
LIBDISPATCH_BUILD_DIR=$(build_directory ${host} ${product})
23272325
SWIFT_BUILD_PATH="$(build_directory ${host} swift)"
2328-
ENABLE_SWIFT=YES
2329-
if [[ "${product}" = "clibdispatch" ]]; then
2330-
if [[ "$(uname -s)" = "Darwin" ]]; then
2331-
continue # We don't build clibdispatch on Darwin
2332-
fi
2333-
ENABLE_SWIFT=NO
2334-
LIBDISPATCH_BUILD_DIR=$(build_directory ${host} libdispatch)
2335-
build_dir=${LIBDISPATCH_BUILD_DIR}
2336-
fi
23372326

23382327
case "${host}" in
23392328
macosx-*)
@@ -2349,7 +2338,7 @@ for host in "${ALL_HOSTS[@]}"; do
23492338
call rm -rf "${LIBDISPATCH_BUILD_DIR}"
23502339

23512340
cmake_options=(
2352-
-DENABLE_SWIFT="${ENABLE_SWIFT}"
2341+
-DENABLE_SWIFT=YES
23532342
${cmake_options[@]}
23542343
-DCMAKE_BUILD_TYPE:STRING="${LIBDISPATCH_BUILD_TYPE}"
23552344
-DCMAKE_C_COMPILER:PATH="${CLANG_BIN}/clang"
@@ -2517,13 +2506,6 @@ for host in "${ALL_HOSTS[@]}"; do
25172506
if [[ "${product}" = "llvm" ]] && [[ "${BUILD_LLVM}" = "1" ]] && [[ "$(uname -s)" = "Darwin" ]]; then
25182507
copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain "$(build_directory_bin ${host} llvm)/.."
25192508
fi
2520-
2521-
# We need to copy libdispatch.so into the swift lib directory
2522-
# so the tests can find it
2523-
if [[ "${product}" = "clibdispatch" ]] && [[ "uname -s" != "Darwin" ]]; then
2524-
clibdispatch_libdir="$(build_directory ${host} swift)/lib/swift/${SWIFT_HOST_VARIANT}/${SWIFT_HOST_VARIANT_ARCH}"
2525-
call cp "${build_dir}/libdispatch.so" "${clibdispatch_libdir}"
2526-
fi
25272509
done
25282510
done
25292511
# END OF BUILD PHASE
@@ -2780,17 +2762,13 @@ for host in "${ALL_HOSTS[@]}"; do
27802762
foundation_static)
27812763
continue
27822764
;;
2783-
clibdispatch|libdispatch)
2765+
libdispatch)
27842766
if [[ "${SKIP_TEST_LIBDISPATCH}" ]]; then
27852767
continue
27862768
fi
27872769

27882770
case "${host}" in
27892771
macosx-*)
2790-
if [[ "${product}" = clibdispatch ]]; then
2791-
# we don't build clibdispatch on Darwin
2792-
continue
2793-
fi
27942772
LIBDISPATCH_BUILD_DIR=$(build_directory ${host} ${product})
27952773
echo "--- Running tests for ${product} ---"
27962774
with_pushd "${LIBDISPATCH_BUILD_DIR}" \
@@ -2799,9 +2777,6 @@ for host in "${ALL_HOSTS[@]}"; do
27992777
continue
28002778
;;
28012779
*)
2802-
if [[ "${product}" = clibdispatch ]]; then
2803-
product=libdispatch
2804-
fi
28052780
results_targets=( "test" )
28062781
executable_target=""
28072782
;;
@@ -2976,21 +2951,13 @@ for host in "${ALL_HOSTS[@]}"; do
29762951
fi
29772952

29782953
;;
2979-
clibdispatch|libdispatch|libdispatch_static)
2980-
if [[ "${product}" = clibdispatch ]]; then
2981-
if [[ -z "${INSTALL_CLIBDISPATCH}" ]]; then
2982-
continue
2983-
fi
2984-
elif [[ -z "${INSTALL_LIBDISPATCH}" ]]; then
2954+
libdispatch|libdispatch_static)
2955+
if [[ -z "${INSTALL_LIBDISPATCH}" ]] ; then
29852956
continue
29862957
fi
29872958

29882959
case "${host}" in
29892960
macosx-*)
2990-
if [[ "${product}" = clibdispatch ]]; then
2991-
# we don't build clibdispatch on Darwin
2992-
continue
2993-
fi
29942961
if [[ -z "${INSTALL_DESTDIR}" ]] ; then
29952962
echo "--install-destdir is required to install products."
29962963
exit 1
@@ -3009,9 +2976,6 @@ for host in "${ALL_HOSTS[@]}"; do
30092976
continue
30102977
;;
30112978
*)
3012-
if [[ "${product}" = clibdispatch ]]; then
3013-
product=libdispatch
3014-
fi
30152979
;;
30162980
esac
30172981
;;

utils/build_swift/build_swift/driver_arguments.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -652,9 +652,6 @@ def create_argument_parser():
652652
option('--libdispatch', toggle_true('build_libdispatch'),
653653
help='build libdispatch')
654654

655-
option('--clibdispatch', toggle_true('build_clibdispatch'),
656-
help='build clibdispatch')
657-
658655
option('--libicu', toggle_true('build_libicu'),
659656
help='build libicu')
660657

utils/build_swift/tests/expected_options.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
'build_ios_simulator': False,
7171
'build_jobs': multiprocessing.cpu_count(),
7272
'build_libdispatch': False,
73-
'build_clibdispatch': False,
7473
'build_libicu': False,
7574
'build_linux': True,
7675
'build_llbuild': False,
@@ -523,7 +522,6 @@ class BuildScriptImplOption(_BaseOption):
523522
EnableOption('--only-executable-test'),
524523
EnableOption('--only-non-executable-test'),
525524
EnableOption('--libdispatch', dest='build_libdispatch'),
526-
EnableOption('--clibdispatch', dest='build_clibdispatch'),
527525
EnableOption('--libicu', dest='build_libicu'),
528526
EnableOption('--indexstore-db', dest='build_indexstoredb'),
529527
EnableOption('--test-indexstore-db-sanitize-all',

utils/swift_build_support/swift_build_support/products/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
# ----------------------------------------------------------------------------
1212

1313
from .benchmarks import Benchmarks
14-
from .clibdispatch import CLibDispatch
1514
from .cmark import CMark
1615
from .foundation import Foundation
1716
from .indexstoredb import IndexStoreDB
@@ -40,7 +39,6 @@
4039
'Ninja',
4140
'Foundation',
4241
'LibCXX',
43-
'CLibDispatch',
4442
'LibDispatch',
4543
'LibICU',
4644
'LLBuild',

utils/swift_build_support/swift_build_support/products/clibdispatch.py

Lines changed: 0 additions & 44 deletions
This file was deleted.

utils/swift_build_support/swift_build_support/products/swift.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#
1111
# ----------------------------------------------------------------------------
1212

13-
from . import clibdispatch
1413
from . import cmark
1514
from . import libcxx
1615
from . import libicu
@@ -148,5 +147,4 @@ def get_dependencies(cls):
148147
return [cmark.CMark,
149148
llvm.LLVM,
150149
libcxx.LibCXX,
151-
libicu.LibICU,
152-
clibdispatch.CLibDispatch]
150+
libicu.LibICU]

0 commit comments

Comments
 (0)