Skip to content

Commit cfae1a3

Browse files
authored
Merge pull request swiftlang#27580 from ahoppen/skstresstester-new-build-infrastructure
Move stress tester and swiftevolve to new swift_build_support build infrastructure
2 parents bb83722 + 92a0e20 commit cfae1a3

File tree

10 files changed

+218
-171
lines changed

10 files changed

+218
-171
lines changed

utils/build-presets.ini

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1529,6 +1529,26 @@ assertions
15291529
# Downstream projects that import llbuild+SwiftPM.
15301530
sourcekit-lsp
15311531

1532+
#===------------------------------------------------------------------------===#
1533+
# Test Swift Stress Tester
1534+
#===------------------------------------------------------------------------===#
1535+
1536+
[preset: buildbot_skstresstester_macos]
1537+
mixin-preset=mixin_swiftpm_package_macos_platform
1538+
release
1539+
assertions
1540+
skstresstester
1541+
1542+
#===------------------------------------------------------------------------===#
1543+
# Test Swift Evolve
1544+
#===------------------------------------------------------------------------===#
1545+
1546+
[preset: buildbot_swiftevolve_macos]
1547+
mixin-preset=mixin_swiftpm_package_macos_platform
1548+
release
1549+
assertions
1550+
swiftevolve
1551+
15321552
#===------------------------------------------------------------------------===#
15331553
# Test SourceKit-LSP
15341554
#===------------------------------------------------------------------------===#

utils/build-script

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,6 @@ class BuildScriptInvocation(object):
305305
"--xctest-build-type", args.build_variant,
306306
"--swiftpm-build-type", args.build_variant,
307307
"--swiftsyntax-build-type", args.build_variant,
308-
"--skstresstester-build-type", args.build_variant,
309-
"--swiftevolve-build-type", args.build_variant,
310308
"--llbuild-build-type", args.build_variant,
311309
"--swift-enable-assertions", str(args.swift_assertions).lower(),
312310
"--swift-stdlib-enable-assertions", str(
@@ -437,10 +435,6 @@ class BuildScriptInvocation(object):
437435
impl_args += ["--skip-build-swiftpm"]
438436
if not args.build_swiftsyntax:
439437
impl_args += ["--skip-build-swiftsyntax"]
440-
if not args.build_skstresstester:
441-
impl_args += ["--skip-build-skstresstester"]
442-
if not args.build_swiftevolve:
443-
impl_args += ["--skip-build-swiftevolve"]
444438
if not args.build_playgroundsupport:
445439
impl_args += ["--skip-build-playgroundsupport"]
446440
if args.build_swift_dynamic_stdlib:
@@ -485,8 +479,6 @@ class BuildScriptInvocation(object):
485479
"--skip-test-llbuild",
486480
"--skip-test-swiftpm",
487481
"--skip-test-swiftsyntax",
488-
"--skip-test-skstresstester",
489-
"--skip-test-swiftevolve",
490482
"--skip-test-xctest",
491483
"--skip-test-foundation",
492484
"--skip-test-libdispatch",

utils/build-script-impl

Lines changed: 6 additions & 158 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ KNOWN_SETTINGS=(
8383
# When this flag is set, the build-script will only build/install the swift-syntax parser
8484
# This is a temporary workaround of having a separate build product for swift-syntax parser
8585
skip-swiftsyntax-swiftside "" "skip building/installing the swift side of swiftsyntax"
86-
skstresstester-build-type "Debug" "the build variant for the SourceKit stress tester"
87-
swiftevolve-build-type "Debug" "the build variant for the swift-evolve tool"
8886
llbuild-enable-assertions "1" "enable assertions in llbuild"
8987
enable-asan "" "enable Address Sanitizer"
9088
enable-ubsan "" "enable Undefined Behavior Sanitizer"
@@ -129,8 +127,6 @@ KNOWN_SETTINGS=(
129127
skip-build-libcxx "" "set to skip building libcxx"
130128
skip-build-swiftpm "" "set to skip building swiftpm"
131129
skip-build-swiftsyntax "" "set to skip building swiftSyntax"
132-
skip-build-skstresstester "" "set to skip building the SourceKit stress tester"
133-
skip-build-swiftevolve "" "set to skip building the swift-evolve tool"
134130
skip-build-xctest "" "set to skip building xctest"
135131
skip-build-foundation "" "set to skip building foundation"
136132
skip-build-libdispatch "" "set to skip building libdispatch"
@@ -145,8 +141,6 @@ KNOWN_SETTINGS=(
145141
skip-test-llbuild "" "set to skip testing llbuild"
146142
skip-test-swiftpm "" "set to skip testing swiftpm"
147143
skip-test-swiftsyntax "" "set to skip testing swiftSyntax"
148-
skip-test-skstresstester "" "set to skip testing the SourceKit stress tester"
149-
skip-test-swiftevolve "" "set to skip testing the swift-evolve tool"
150144
skip-test-xctest "" "set to skip testing xctest"
151145
skip-test-foundation "" "set to skip testing foundation"
152146
skip-test-libdispatch "" "set to skip testing libdispatch"
@@ -206,8 +200,6 @@ KNOWN_SETTINGS=(
206200
install-swiftpm "" "whether to install swiftpm"
207201
install-swiftsyntax "" "whether to install swiftsyntax"
208202
skip-install-swiftsyntax-module "" "set to skip installing swiftsyntax modules"
209-
install-skstresstester "" "whether to install the SourceKit stress tester"
210-
install-swiftevolve "" "whether to install the swift-evolve tool"
211203
install-xctest "" "whether to install xctest"
212204
install-foundation "" "whether to install foundation"
213205
install-libcxx "" "whether to install libc++"
@@ -1200,8 +1192,6 @@ LLBUILD_SOURCE_DIR="${WORKSPACE}/llbuild"
12001192
SWIFTPM_SOURCE_DIR="${WORKSPACE}/swiftpm"
12011193
SWIFTSYNTAX_SOURCE_DIR="${WORKSPACE}/swift-syntax"
12021194
STRESSTEST_PACKAGE_DIR="${WORKSPACE}/swift-stress-tester"
1203-
SKSTRESSTESTER_SOURCE_DIR="${STRESSTEST_PACKAGE_DIR}/SourceKitStressTester"
1204-
SWIFTEVOLVE_SOURCE_DIR="${STRESSTEST_PACKAGE_DIR}/SwiftEvolve"
12051195
XCTEST_SOURCE_DIR="${WORKSPACE}/swift-corelibs-xctest"
12061196
FOUNDATION_SOURCE_DIR="${WORKSPACE}/swift-corelibs-foundation"
12071197
FOUNDATION_STATIC_SOURCE_DIR="${WORKSPACE}/swift-corelibs-foundation"
@@ -1254,9 +1244,8 @@ PRODUCTS=("${PRODUCTS[@]}" swift)
12541244
if [[ ! "${SKIP_BUILD_LLDB}" ]] ; then
12551245
PRODUCTS=("${PRODUCTS[@]}" lldb)
12561246
fi
1257-
# LLBuild, SwiftPM, SwiftSyntax, the SourceKit stress tester and XCTest are
1258-
# dependent on Foundation, so Foundation must be added to the list of build
1259-
# products first.
1247+
# LLBuild, SwiftPM, SwiftSyntax and XCTest are dependent on Foundation, so
1248+
# Foundation must be added to the list of build products first.
12601249
if [[ ! "${SKIP_BUILD_LIBDISPATCH}" ]] ; then
12611250
PRODUCTS=("${PRODUCTS[@]}" libdispatch)
12621251
if [[ -z "${SKIP_BUILD_SWIFT_STATIC_LIBDISPATCH}" ]] ; then
@@ -1275,27 +1264,19 @@ fi
12751264
if [[ ! "${SKIP_BUILD_PLAYGROUNDSUPPORT}" ]] ; then
12761265
PRODUCTS=("${PRODUCTS[@]}" playgroundsupport)
12771266
fi
1278-
# SwiftPM, SwiftSyntax and the SourceKit stress tester are dependent on XCTest,
1279-
# so XCTest must be added to the list of build products first.
1267+
# SwiftPM and SwiftSyntax are dependent on XCTest, so XCTest must be added to
1268+
# the list of build products first.
12801269
if [[ ! "${SKIP_BUILD_XCTEST}" ]] ; then
12811270
PRODUCTS=("${PRODUCTS[@]}" xctest)
12821271
fi
1283-
# SwiftSyntax and the SourceKit stress tester are dependent on SwiftPM, so
1284-
# SwiftPM must be added to the list of build products first.
1272+
# SwiftSyntax is dependent on SwiftPM, so SwiftPM must be added to the list of
1273+
# build products first.
12851274
if [[ ! "${SKIP_BUILD_SWIFTPM}" ]] ; then
12861275
PRODUCTS=("${PRODUCTS[@]}" swiftpm)
12871276
fi
1288-
# The SourceKit stress tester and swift-evolve are dependent on SwiftSyntax, so
1289-
# it must be added to the list of build products first.
12901277
if [[ ! "${SKIP_BUILD_SWIFTSYNTAX}" ]] ; then
12911278
PRODUCTS=("${PRODUCTS[@]}" swiftsyntax)
12921279
fi
1293-
if [[ ! "${SKIP_BUILD_SKSTRESSTESTER}" ]] ; then
1294-
PRODUCTS=("${PRODUCTS[@]}" skstresstester)
1295-
fi
1296-
if [[ ! "${SKIP_BUILD_SWIFTEVOLVE}" ]] ; then
1297-
PRODUCTS=("${PRODUCTS[@]}" swiftevolve)
1298-
fi
12991280

13001281
# Checks if a given product is enabled (i.e. part of $PRODUCTS array)
13011282
function contains_product() {
@@ -1604,12 +1585,6 @@ function build_directory_bin() {
16041585
swiftsyntax)
16051586
echo "${root}/${SWIFTSYNTAX_BUILD_TYPE}/bin"
16061587
;;
1607-
skstresstester)
1608-
echo "${root}/${SKSTRESSTESTER_BUILD_TYPE}/bin"
1609-
;;
1610-
swiftevolve)
1611-
echo "${root}/${SWIFTEVOLVE_BUILD_TYPE}/bin"
1612-
;;
16131588
xctest)
16141589
echo "${root}/${XCTEST_BUILD_TYPE}/bin"
16151590
;;
@@ -1755,12 +1730,6 @@ function cmake_config_opt() {
17551730
swiftsyntax)
17561731
echo "--config ${SWIFTSYNTAX_BUILD_TYPE}"
17571732
;;
1758-
skstresstester)
1759-
echo "--config ${SKSTRESSTESTER_BUILD_TYPE}"
1760-
;;
1761-
swiftevolve)
1762-
echo "--config ${SWIFTEVOLVE_BUILD_TYPE}"
1763-
;;
17641733
xctest)
17651734
echo "--config ${XCTEST_BUILD_TYPE}"
17661735
;;
@@ -1885,53 +1854,6 @@ function set_swiftsyntax_build_command() {
18851854
--filecheck-exec="$(build_directory_bin ${LOCAL_HOST} llvm)/FileCheck")
18861855
}
18871856

1888-
function set_stresstester_build_script_helper_command() {
1889-
local package_name="$1"
1890-
local package_build_type="$2"
1891-
local package_build_dir="$3"
1892-
1893-
if [ "${SKIP_BUILD_SWIFTSYNTAX}" ]; then
1894-
echo "Error: Cannot build $package_name without SwiftSyntax."
1895-
exit 1
1896-
fi
1897-
1898-
local swiftsyntax_config="debug"
1899-
if [[ $(is_cmake_release_build_type "${SWIFTSYNTAX_BUILD_TYPE}") ]] ; then
1900-
swiftsyntax_config="release"
1901-
fi
1902-
local config="debug"
1903-
if [[ $(is_cmake_release_build_type "${package_build_type}") ]] ; then
1904-
config="release"
1905-
fi
1906-
1907-
stresstester_build_script_helper_command=("${STRESSTEST_PACKAGE_DIR}/build-script-helper.py")
1908-
if [[ "${VERBOSE_BUILD}" ]] ; then
1909-
stresstester_build_script_helper_command+=(-v)
1910-
fi
1911-
1912-
stresstester_build_script_helper_command+=(
1913-
--package-dir="${package_name}"
1914-
--build-dir="${package_build_dir}"
1915-
--swiftc-exec="$(build_directory_bin ${LOCAL_HOST} swift)/swiftc"
1916-
--swift-build-exec="$(swiftpm_find_tool swift-build)"
1917-
--swift-test-exec="$(swiftpm_find_tool swift-test)"
1918-
--syntax-parser-header-dir="${SWIFT_SOURCE_DIR}/include/swift-c/SyntaxParser"
1919-
--syntax-parser-lib-dir="$(build_directory ${host} swift)/lib"
1920-
--sourcekitd-dir="$(build_directory ${host} swift)/lib"
1921-
--swiftsyntax-dir="$(build_directory ${host} swiftsyntax)/${swiftsyntax_config}"
1922-
--config="${config}")
1923-
}
1924-
1925-
function set_skstresstester_build_command() {
1926-
set_stresstester_build_script_helper_command SourceKitStressTester "${SKSTRESSTESTER_BUILD_TYPE}" "$(build_directory ${host} skstresstester)"
1927-
skstresstester_build_command=("${stresstester_build_script_helper_command[@]}")
1928-
}
1929-
1930-
function set_swiftevolve_build_command() {
1931-
set_stresstester_build_script_helper_command SwiftEvolve "${SWIFTEVOLVE_BUILD_TYPE}" "$(build_directory ${host} swiftevolve)"
1932-
swiftevolve_build_command=("${stresstester_build_script_helper_command[@]}")
1933-
}
1934-
19351857
#
19361858
# Configure and build each product
19371859
#
@@ -2583,26 +2505,6 @@ for host in "${ALL_HOSTS[@]}"; do
25832505
set_swiftsyntax_build_command
25842506
call "${swiftsyntax_build_command[@]}"
25852507

2586-
continue
2587-
;;
2588-
skstresstester)
2589-
if [[ "$(uname -s)" != "Darwin" ]]; then
2590-
echo "error: unable to build swift-stress-tester on this platform"
2591-
continue
2592-
fi
2593-
set_skstresstester_build_command
2594-
call "${skstresstester_build_command[@]}"
2595-
2596-
continue
2597-
;;
2598-
swiftevolve)
2599-
if [[ "$(uname -s)" != "Darwin" ]]; then
2600-
echo "error: unable to build swift-evolve on this platform"
2601-
continue
2602-
fi
2603-
set_swiftevolve_build_command
2604-
call "${swiftevolve_build_command[@]}"
2605-
26062508
continue
26072509
;;
26082510
xctest)
@@ -3117,24 +3019,6 @@ for host in "${ALL_HOSTS[@]}"; do
31173019
# As swiftSyntax tests itself, we break early here.
31183020
continue
31193021
;;
3120-
skstresstester)
3121-
if [[ "${SKIP_TEST_SKSTRESSTESTER}" ]]; then
3122-
continue
3123-
fi
3124-
echo "--- Running tests for ${product} ---"
3125-
set_skstresstester_build_command
3126-
call "${skstresstester_build_command[@]}" test
3127-
continue
3128-
;;
3129-
swiftevolve)
3130-
if [[ "${SKIP_TEST_SWIFTEVOLVE}" ]]; then
3131-
continue
3132-
fi
3133-
echo "--- Running tests for ${product} ---"
3134-
set_swiftevolve_build_command
3135-
call "${swiftevolve_build_command[@]}" test
3136-
continue
3137-
;;
31383022
xctest)
31393023
if [[ "${SKIP_TEST_XCTEST}" ]]; then
31403024
continue
@@ -3491,42 +3375,6 @@ for host in "${ALL_HOSTS[@]}"; do
34913375
call "${swiftsyntax_build_command[@]}" --dylib-dir="${DYLIB_DIR}" --install
34923376
fi
34933377

3494-
continue
3495-
;;
3496-
skstresstester)
3497-
if [[ -z "${INSTALL_SKSTRESSTESTER}" ]] ; then
3498-
continue
3499-
fi
3500-
if [[ -z "${INSTALL_DESTDIR}" ]] ; then
3501-
echo "--install-destdir is required to install products."
3502-
exit 1
3503-
fi
3504-
if [[ -z "${INSTALL_SWIFTSYNTAX}" ]] ; then
3505-
echo "--install-swiftsyntax is required to install the SourceKit stress tester"
3506-
exit 1
3507-
fi
3508-
3509-
echo "--- Installing ${product} ---"
3510-
set_skstresstester_build_command
3511-
call "${skstresstester_build_command[@]}" --prefix="${host_install_destdir}${host_install_prefix}" install
3512-
continue
3513-
;;
3514-
swiftevolve)
3515-
if [[ -z "${INSTALL_SWIFTEVOLVE}" ]] ; then
3516-
continue
3517-
fi
3518-
if [[ -z "${INSTALL_DESTDIR}" ]] ; then
3519-
echo "--install-destdir is required to install products."
3520-
exit 1
3521-
fi
3522-
if [[ -z "${INSTALL_SWIFTSYNTAX}" ]] ; then
3523-
echo "--install-swiftsyntax is required to install swift-evolve"
3524-
exit 1
3525-
fi
3526-
3527-
echo "--- Installing ${product} ---"
3528-
set_swiftevolve_build_command
3529-
call "${swiftevolve_build_command[@]}" --prefix="${host_install_destdir}${host_install_prefix}" install
35303378
continue
35313379
;;
35323380
xctest)

utils/build_swift/driver_arguments.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ def _apply_default_arguments(args):
205205
args.test_android = False
206206
args.test_indexstoredb = False
207207
args.test_sourcekitlsp = False
208+
args.test_skstresstester = False
209+
args.test_swiftevolve = False
208210

209211
# --skip-test-ios is merely a shorthand for host and simulator tests.
210212
if not args.test_ios:
@@ -568,6 +570,10 @@ def create_argument_parser():
568570
help='build SourceKitLSP')
569571
option(['--install-sourcekit-lsp'], toggle_true('install_sourcekitlsp'),
570572
help='install SourceKitLSP')
573+
option(['--install-skstresstester'], toggle_true('install_skstresstester'),
574+
help='install the SourceKit stress tester')
575+
option(['--install-swiftevolve'], toggle_true('install_swiftevolve'),
576+
help='install SwiftEvolve')
571577
option(['--toolchain-benchmarks'],
572578
toggle_true('build_toolchainbenchmarks'),
573579
help='build Swift Benchmarks using swiftpm against the just built '
@@ -955,6 +961,10 @@ def create_argument_parser():
955961
help='skip testing indexstore-db')
956962
option('--skip-test-sourcekit-lsp', toggle_false('test_sourcekitlsp'),
957963
help='skip testing sourcekit-lsp')
964+
option('--skip-test-skstresstester', toggle_false('test_skstresstester'),
965+
help='skip testing the SourceKit Stress tester')
966+
option('--skip-test-swiftevolve', toggle_false('test_swiftevolve'),
967+
help='skip testing SwiftEvolve')
958968

959969
# -------------------------------------------------------------------------
960970
in_group('Build settings specific for LLVM')
@@ -1026,6 +1036,17 @@ def create_argument_parser():
10261036
option('--skip-test-optimize-none-with-implicit-dynamic', unsupported)
10271037
option('--skip-test-optimized', unsupported)
10281038

1039+
# -------------------------------------------------------------------------
1040+
in_group('Build-script-impl arguments (for disambiguation)')
1041+
# We need to list --skip-build-swift explicitly because otherwise argparse
1042+
# will auto-expand arguments like --skip-build-swift to the only known
1043+
# argument --skip-build-swiftevolve.
1044+
# These arguments are forwarded to impl_args in migration.py
1045+
1046+
option('--install-swift', toggle_true('impl_install_swift'))
1047+
option('--skip-test-swift', toggle_true('impl_skip_test_swift'))
1048+
1049+
10291050
# -------------------------------------------------------------------------
10301051
return builder.build()
10311052

@@ -1068,7 +1089,8 @@ def create_argument_parser():
10681089
10691090
10701091
Any arguments not listed are forwarded directly to Swift's
1071-
'build-script-impl'. See that script's help for details.
1092+
'build-script-impl'. See that script's help for details. The listed
1093+
build-script-impl arguments are only for disambiguation in the argument parser.
10721094
10731095
Environment variables
10741096
---------------------

0 commit comments

Comments
 (0)