Skip to content

Commit cb038fa

Browse files
committed
Build WasmKit with the freshly-built SwiftPM
1 parent 07d611e commit cb038fa

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

utils/swift_build_support/swift_build_support/build_script_invocation.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,14 @@ def compute_product_pipelines(self):
672672
is_enabled=self.args.build_wasmstdlib)
673673
builder.add_product(products.WasmThreadsLLVMRuntimeLibs,
674674
is_enabled=self.args.build_wasmstdlib)
675+
676+
builder.add_product(products.SwiftTestingMacros,
677+
is_enabled=self.args.build_swift_testing_macros)
678+
builder.add_product(products.SwiftTesting,
679+
is_enabled=self.args.build_swift_testing)
680+
builder.add_product(products.SwiftPM,
681+
is_enabled=self.args.build_swiftpm)
682+
675683
builder.add_product(products.WasmKit,
676684
is_enabled=self.args.build_wasmkit)
677685
builder.add_product(products.WasmStdlib,
@@ -681,12 +689,6 @@ def compute_product_pipelines(self):
681689
builder.add_product(products.WasmSwiftSDK,
682690
is_enabled=self.args.build_wasmstdlib)
683691

684-
builder.add_product(products.SwiftTestingMacros,
685-
is_enabled=self.args.build_swift_testing_macros)
686-
builder.add_product(products.SwiftTesting,
687-
is_enabled=self.args.build_swift_testing)
688-
builder.add_product(products.SwiftPM,
689-
is_enabled=self.args.build_swiftpm)
690692
builder.add_product(products.SwiftFoundationTests,
691693
is_enabled=self.args.build_foundation)
692694
builder.add_product(products.FoundationTests,

utils/swift_build_support/swift_build_support/products/wasmkit.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import shutil
1515

1616
from . import product
17+
from . import swiftpm
1718
from .. import shell
1819

1920

@@ -37,7 +38,7 @@ def is_before_build_script_impl_product(cls):
3738

3839
@classmethod
3940
def get_dependencies(cls):
40-
return []
41+
return [swiftpm.SwiftPM]
4142

4243
def should_build(self, host_target):
4344
return self.args.build_wasmkit
@@ -72,10 +73,8 @@ def cli_file_path(cls, build_dir):
7273

7374

7475
def run_swift_build(host_target, product, swpft_package_product_name):
75-
# Building with the host toolchain's SwiftPM
76-
swiftc_path = os.path.abspath(product.toolchain.swiftc)
77-
toolchain_path = os.path.dirname(os.path.dirname(swiftc_path))
78-
swift_build = os.path.join(toolchain_path, 'bin', 'swift-build')
76+
# Building with the freshly-built SwiftPM
77+
swift_build = os.path.join(product.install_toolchain_path(host_target), "bin", "swift-build")
7978

8079
build_args = [
8180
swift_build,

0 commit comments

Comments
 (0)