Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions tools/build/package-toolchain
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,13 @@ def copy_libxml2_libs(build_sdk_path, dist_toolchain_path, target_triple):
class PackageSwiftSDKAction(Action):
def __init__(
self, options, snapshot_info: SnapshotInfo,
base_toolchain_path: str,
target_toolchain_path: str,
wasi_sysroot_path: str,
swift_sdk_name: str,
target_triple: str,
):
super().__init__(options)
self.snapshot_info = snapshot_info
self.base_toolchain_path = base_toolchain_path
self.target_toolchain_path = target_toolchain_path
self.wasi_sysroot_path = wasi_sysroot_path
self.swift_sdk_name = swift_sdk_name
Expand All @@ -98,7 +96,6 @@ class PackageSwiftSDKAction(Action):
copy_icu_libs(self.options.scheme, build_sdk_path, self.target_toolchain_path, self.target_triple)
copy_libxml2_libs(build_sdk_path, self.target_toolchain_path, self.target_triple)
self.make_swift_sdk(
self.base_toolchain_path,
self.target_toolchain_path,
self.wasi_sysroot_path,
self.swift_sdk_name,
Expand All @@ -107,7 +104,6 @@ class PackageSwiftSDKAction(Action):

def make_swift_sdk(
self,
base_toolchain_path: str,
target_toolchain_path: str,
wasi_sysroot_path: str,
swift_sdk_name: str,
Expand All @@ -116,8 +112,6 @@ class PackageSwiftSDKAction(Action):
"""
Build the Swift SDK for WebAssembly.

:param base_toolchain_path: The path to the base toolchain, which
is an upstream toolchain downloaded from swift.org/download.
:param target_toolchain_path: The path to the target toolchain, which
contains the cross-compiled Swift standard library and SDK for
WebAssembly.
Expand Down Expand Up @@ -170,17 +164,6 @@ class PackageSwiftSDKAction(Action):
self.system(*zip_args)
os.chdir(old_cwd)

def get_default_target_triple(self, base_toolchain_path: str):
import subprocess
swift_frontend_path = os.path.join(
base_toolchain_path, "usr", "bin", "swift-frontend")
# Use subprocess instead of self.system to run it even in dry-run
output = subprocess.check_output(
[swift_frontend_path, "-print-target-info"],
universal_newlines=True)
info = json.loads(output)
return info["target"]["triple"]


class CleanBuildArtifactAction(Action):
def run(self):
Expand Down Expand Up @@ -281,7 +264,6 @@ def main():
)
actions.append(PackageSwiftSDKAction(
options, snapshot_info,
base_toolchain_path=os.path.join(packaging_dir, 'base-snapshot'),
target_toolchain_path=os.path.join(packaging_dir, 'target-toolchain', target_triple),
wasi_sysroot_path=derive_wasi_sysroot(options, packaging_dir, short_triple),
swift_sdk_name=f"{snapshot_info.swift_version}-{target_triple}",
Expand Down
Loading