Skip to content

Commit 541b17a

Browse files
authored
Fix build-script SwiftEvolve support (swiftlang#22148)
1 parent 0bebba8 commit 541b17a

File tree

4 files changed

+33
-3
lines changed

4 files changed

+33
-3
lines changed

utils/build-script

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -882,6 +882,8 @@ class BuildScriptInvocation(object):
882882
product_classes.append(products.SwiftSyntax)
883883
if self.args.build_skstresstester:
884884
product_classes.append(products.SKStressTester)
885+
if self.args.build_swiftevolve:
886+
product_classes.append(products.SwiftEvolve)
885887
if self.args.build_indexstoredb:
886888
product_classes.append(products.IndexStoreDB)
887889
if self.args.build_sourcekitlsp:

utils/build-script-impl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,6 +1875,7 @@ function set_swiftsyntax_build_command() {
18751875
function set_stresstester_build_script_helper_command() {
18761876
local package_name="$1"
18771877
local package_build_type="$2"
1878+
local package_build_dir="$3"
18781879

18791880
if [ "${SKIP_BUILD_SWIFTSYNTAX}" ]; then
18801881
echo "Error: Cannot build $package_name without SwiftSyntax."
@@ -1897,7 +1898,7 @@ function set_stresstester_build_script_helper_command() {
18971898

18981899
stresstester_build_script_helper_command+=(
18991900
--package-dir="${package_name}"
1900-
--build-dir="$(build_directory ${host} skstresstester)"
1901+
--build-dir="${package_build_dir}"
19011902
--swiftc-exec="$(build_directory_bin ${LOCAL_HOST} swift)/swiftc"
19021903
--swift-build-exec="$(swiftpm_find_tool swift-build)"
19031904
--swift-test-exec="$(swiftpm_find_tool swift-test)"
@@ -1909,12 +1910,12 @@ function set_stresstester_build_script_helper_command() {
19091910
}
19101911

19111912
function set_skstresstester_build_command() {
1912-
set_stresstester_build_script_helper_command SourceKitStressTester "${SKSTRESSTESTER_BUILD_TYPE}"
1913+
set_stresstester_build_script_helper_command SourceKitStressTester "${SKSTRESSTESTER_BUILD_TYPE}" "$(build_directory ${host} skstresstester)"
19131914
skstresstester_build_command=("${stresstester_build_script_helper_command[@]}")
19141915
}
19151916

19161917
function set_swiftevolve_build_command() {
1917-
set_stresstester_build_script_helper_command SwiftEvolve "${SWIFTEVOLVE_BUILD_TYPE}"
1918+
set_stresstester_build_script_helper_command SwiftEvolve "${SWIFTEVOLVE_BUILD_TYPE}" "$(build_directory ${host} swiftevolve)"
19181919
swiftevolve_build_command=("${stresstester_build_script_helper_command[@]}")
19191920
}
19201921

@@ -3229,6 +3230,7 @@ for host in "${ALL_HOSTS[@]}"; do
32293230
continue
32303231
fi
32313232
echo "--- Running tests for ${product} ---"
3233+
set_swiftevolve_build_command
32323234
call "${swiftevolve_build_command[@]}" test
32333235
continue
32343236
;;
@@ -3620,6 +3622,7 @@ for host in "${ALL_HOSTS[@]}"; do
36203622
fi
36213623

36223624
echo "--- Installing ${product} ---"
3625+
set_swiftevolve_build_command
36233626
call "${swiftevolve_build_command[@]}" --prefix="${host_install_destdir}${host_install_prefix}" install
36243627
continue
36253628
;;

utils/swift_build_support/swift_build_support/products/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from .skstresstester import SKStressTester
2424
from .sourcekitlsp import SourceKitLSP
2525
from .swift import Swift
26+
from .swiftevolve import SwiftEvolve
2627
from .swiftpm import SwiftPM
2728
from .swiftsyntax import SwiftSyntax
2829
from .xctest import XCTest
@@ -43,6 +44,7 @@
4344
'XCTest',
4445
'SwiftSyntax',
4546
'SKStressTester',
47+
'SwiftEvolve',
4648
'IndexStoreDB',
4749
'SourceKitLSP',
4850
]
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# swift_build_support/products/skstresstester.py -----------------*- python -*-
2+
#
3+
# This source file is part of the Swift.org open source project
4+
#
5+
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
6+
# Licensed under Apache License v2.0 with Runtime Library Exception
7+
#
8+
# See https://swift.org/LICENSE.txt for license information
9+
# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
#
11+
# ----------------------------------------------------------------------------
12+
13+
from . import product
14+
15+
16+
class SwiftEvolve(product.Product):
17+
@classmethod
18+
def product_source_name(cls):
19+
"""product_source_name() -> str
20+
21+
The name of the source code directory of this product.
22+
"""
23+
return "swift-stress-tester"

0 commit comments

Comments
 (0)