Skip to content

Commit 529abee

Browse files
authored
Merge pull request #39061 from DougGregor/concurrency-back-deploy-libraries-ci
Enable concurrency back deployment in CI configurations
2 parents 857490e + 73a1353 commit 529abee

File tree

7 files changed

+36
-8
lines changed

7 files changed

+36
-8
lines changed

stdlib/public/BackDeployConcurrency/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ endforeach()
3939
# Build the concurrency library for back deployment.
4040
add_compile_definitions(SWIFT_CONCURRENCY_BACK_DEPLOYMENT)
4141
set(swift_concurrency_install_component back-deployment)
42-
set(swift_concurrency_options BACK_DEPLOYMENT_LIBRARY 5.5)
42+
set(swift_concurrency_options
43+
BACK_DEPLOYMENT_LIBRARY 5.5
44+
DARWIN_INSTALL_NAME_DIR "@rpath")
4345

4446
add_subdirectory(../Concurrency stdlib/public/BackDeployConcurrency)

test/lit.cfg

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ config.swift_test_options = '-swift-version ' + swift_version
408408

409409
# Define a macro for the next release OS version.
410410
# This macro can be used in code as `@available(SwiftStdlib 5.5, *)`.
411-
if 'back_deploy_concurrency' in lit_config.params:
411+
if 'back_deploy_concurrency' in config.available_features:
412412
swift_stdlib_macro = '\'SwiftStdlib 5.5:macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0\''
413413
else:
414414
swift_stdlib_macro = '\'SwiftStdlib 5.5:macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0\''
@@ -1913,12 +1913,17 @@ if not kIsWindows:
19131913
else:
19141914
config.available_features.add('use_os_stdlib')
19151915
os_stdlib_path = ''
1916+
concurrency_back_deploy_path = ''
19161917
if run_vendor == 'apple':
19171918
#If we get swift-in-the-OS for non-Apple platforms, add a condition here
19181919
os_stdlib_path = "/usr/lib/swift"
19191920
if run_os == 'maccatalyst':
19201921
os_stdlib_path = "/System/iOSSupport/usr/lib/swift:/usr/lib/swift"
1921-
all_stdlib_path = os.path.pathsep.join((os_stdlib_path, target_stdlib_path))
1922+
if 'back_deploy_concurrency' in config.available_features:
1923+
concurrency_back_deploy_path = os.path.join(os.path.dirname(swift_obj_root), os.path.basename(swift_obj_root).replace("swift-", "backdeployconcurrency-"), 'lib', 'swift-5.5', run_os)
1924+
1925+
all_stdlib_path = os.path.pathsep.join((os_stdlib_path, concurrency_back_deploy_path, target_stdlib_path))
1926+
19221927
lit_config.note('Testing with the standard libraries coming from the OS ' + all_stdlib_path)
19231928
config.target_run = (
19241929
"/usr/bin/env "

utils/build-presets.ini

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
# Buildbots for Darwin OSes
1515
#===------------------------------------------------------------------------===#
1616
[preset: mixin_buildbot_install_components]
17-
swift-install-components=compiler;clang-builtin-headers;stdlib;sdk-overlay;parser-lib;editor-integration;tools;toolchain-tools;testsuite-tools;sourcekit-xpc-service;swift-remote-mirror;swift-remote-mirror-headers;
17+
swift-install-components=back-deployment;compiler;clang-builtin-headers;stdlib;sdk-overlay;parser-lib;editor-integration;tools;toolchain-tools;testsuite-tools;sourcekit-xpc-service;swift-remote-mirror;swift-remote-mirror-headers;
1818

1919
[preset: mixin_buildbot_install_components_with_clang]
20-
swift-install-components=compiler;clang-resource-dir-symlink;stdlib;sdk-overlay;parser-lib;toolchain-tools;license;sourcekit-xpc-service;swift-remote-mirror;swift-remote-mirror-headers
20+
swift-install-components=back-deployment;compiler;clang-resource-dir-symlink;stdlib;sdk-overlay;parser-lib;toolchain-tools;license;sourcekit-xpc-service;swift-remote-mirror;swift-remote-mirror-headers
2121
llvm-install-components=llvm-cov;llvm-profdata;IndexStore;clang;clang-resource-headers;compiler-rt;clangd;dsymutil
2222

2323
[preset: mixin_buildbot_trunk_base]
@@ -37,9 +37,13 @@ build-swift-stdlib-unittest-extra
3737

3838
install-llvm
3939
install-swift
40+
install-back-deploy-concurrency
4041

4142
skip-test-cmark
4243

44+
# Build concurrency back-deployment binaries
45+
back-deploy-concurrency
46+
4347
# Path to the root of the installation filesystem.
4448
install-destdir=%(install_destdir)s
4549

@@ -1198,6 +1202,9 @@ libcxx
11981202
indexstore-db
11991203
sourcekit-lsp
12001204

1205+
# Build concurrency back-deployment binaries
1206+
back-deploy-concurrency
1207+
12011208
# Don't generate the SwiftSyntax gyb files. Instead verify that up-to-date ones
12021209
# are checked in.
12031210
swiftsyntax-verify-generated-files
@@ -1242,6 +1249,7 @@ install-swiftevolve
12421249
install-playgroundsupport
12431250
install-libcxx
12441251
install-sourcekit-lsp
1252+
install-back-deploy-concurrency
12451253

12461254
install-destdir=%(install_destdir)s
12471255

@@ -2493,6 +2501,8 @@ build-subdir=compat_macos
24932501
ios
24942502
tvos
24952503
watchos
2504+
back-deploy-concurrency
2505+
install-back-deploy-concurrency
24962506
compiler-vendor=apple
24972507
darwin-install-extract-symbols
24982508
darwin-toolchain-alias=swift
@@ -2502,7 +2512,7 @@ darwin-toolchain-display-name=Swift Development Snapshot
25022512
darwin-toolchain-name=swift-DEVELOPMENT-SNAPSHOT
25032513
darwin-toolchain-version=3.999.999
25042514
llvm-install-components=libclang;libclang-headers;dsymutil
2505-
swift-install-components=compiler;clang-builtin-headers;stdlib;sdk-overlay;license;sourcekit-xpc-service;swift-remote-mirror;swift-remote-mirror-headers
2515+
swift-install-components=back-deployment;compiler;clang-builtin-headers;stdlib;sdk-overlay;license;sourcekit-xpc-service;swift-remote-mirror;swift-remote-mirror-headers
25062516
symbols-package=%(symbols_package)s
25072517
install-symroot=%(install_symroot)s
25082518

utils/build-toolchain

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,12 @@ case $(uname -s) in
5656
Darwin)
5757
SWIFT_PACKAGE=buildbot_osx_package,no_test
5858
OS_SUFFIX=osx
59+
BUILD_SUBDIR=buildbot_osx
5960
;;
6061
Linux)
6162
SWIFT_PACKAGE=buildbot_linux,no_test
6263
OS_SUFFIX=linux
64+
BUILD_SUBDIR=buildbot_linux
6365
;;
6466
*)
6567
echo "Unrecognised platform $(uname -s)"
@@ -77,8 +79,10 @@ while [ $# -ne 0 ]; do
7779
-t|--test)
7880
if [ "$(uname -s)" == "Linux" ]; then
7981
SWIFT_PACKAGE=buildbot_linux
82+
BUILD_SUBDIR=buildbot_linux
8083
else
8184
SWIFT_PACKAGE=buildbot_osx_package
85+
BUILD_SUBDIR=buildbot_osx
8286
fi
8387
;;
8488
--distcc)
@@ -137,7 +141,7 @@ DISPLAY_NAME_SHORT="Local Swift Development Snapshot"
137141
DISPLAY_NAME="${DISPLAY_NAME_SHORT} ${YEAR}-${MONTH}-${DAY}"
138142

139143
SWIFT_INSTALLABLE_PACKAGE="${RESULT_DIR}/${ARCHIVE}"
140-
SWIFT_INSTALL_DIR="${RESULT_DIR}/swift-nightly-install"
144+
SWIFT_INSTALL_DIR="${RESULT_DIR}/${BUILD_SUBDIR}"
141145
SWIFT_INSTALL_SYMROOT="${RESULT_DIR}/swift-nightly-symroot"
142146
SWIFT_TOOLCHAIN_DIR="/Library/Developer/Toolchains/${TOOLCHAIN_NAME}.xctoolchain"
143147
SYMBOLS_PACKAGE="${RESULT_DIR}/${SYM_ARCHIVE}"

utils/build_swift/build_swift/driver_arguments.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,10 @@ def create_argument_parser():
599599
option(['--back-deploy-concurrency'], toggle_true('build_backdeployconcurrency'),
600600
help='build back-deployment support for concurrency')
601601

602+
option(['--install-back-deploy-concurrency'],
603+
toggle_true('install_backdeployconcurrency'),
604+
help='install back-deployment support libraries for concurrency')
605+
602606
option(['--libcxx'], toggle_true('build_libcxx'),
603607
help='build libcxx')
604608

utils/build_swift/tests/expected_options.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@
169169
'only_executable_test': False,
170170
'only_non_executable_test': False,
171171
'infer_dependencies': False,
172+
'install_backdeployconcurrency': False,
172173
'install_prefix': targets.install_prefix(),
173174
'install_symroot': None,
174175
'install_destdir': None,
@@ -476,6 +477,8 @@ class BuildScriptImplOption(_BaseOption):
476477
dest='test_early_swift_driver', value=False),
477478

478479
SetTrueOption('--back-deploy-concurrency', dest='build_backdeployconcurrency'),
480+
SetTrueOption('--install-back-deploy-concurrency',
481+
dest='install_backdeployconcurrency'),
479482
SetTrueOption('--benchmark'),
480483
SetTrueOption('--clean'),
481484
SetTrueOption('--dry-run'),

utils/swift_build_support/swift_build_support/products/backdeployconcurrency.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def test(self, host_target):
137137
raise RuntimeError("Testing not implemented")
138138

139139
def should_install(self, host_target):
140-
return False
140+
return self.args.install_backdeployconcurrency
141141

142142
def install(self, host_target):
143143
destdir = self.host_install_destdir(host_target) + self.args.install_prefix

0 commit comments

Comments
 (0)