Skip to content

Clean up no longer used build code #600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 28, 2025
Merged
Show file tree
Hide file tree
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
6 changes: 0 additions & 6 deletions .github/workflows/build-toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,6 @@ jobs:
path: build-cache
key: ${{ steps.cache_key.outputs.SCCACHE_KEY }}

- name: Upload ${{ matrix.target }} installable archive
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}-${{ matrix.scheme }}-installable
path: swift-wasm-${{ matrix.toolchain_channel }}-SNAPSHOT-${{ matrix.target }}.tar.gz

- name: Upload Swift SDK artifact bundle (wasm32-unknown-wasi)
uses: actions/upload-artifact@v4
with:
Expand Down
43 changes: 1 addition & 42 deletions tools/build/package-toolchain
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import argparse
import datetime
import re
from build_support.actions import Action, ActionRunner, DownloadBaseSnapshotAction, derive_options_from_args
from build_support.platform import PlatformInfo


SDK_GENERATOR_PKG_PATH = os.path.join(
Expand All @@ -22,18 +21,6 @@ class SnapshotInfo:
self.artifact_name = artifact_name
self.daily_snapshot = daily_snapshot

@property
def toolchain_name(self):
return f"swift-wasm-{self.swift_version}"

@property
def swift_sdk_name(self):
return f"{self.swift_version}-wasm"

@property
def tarball_name(self):
return f"{self.artifact_name}.tar.gz"

@property
def artifactbundle_zip_name(self):
return f"{self.artifact_name}.artifactbundle.zip"
Expand Down Expand Up @@ -165,21 +152,6 @@ class PackageSwiftSDKAction(Action):
os.chdir(old_cwd)


class CleanBuildArtifactAction(Action):
def run(self):
import shutil
print("=====> Cleaning build artifacts")
build_paths = [
os.path.join("..", "build", "WebAssemblyCompiler"),
]
for path in build_paths:
if not os.path.exists(path):
continue
print(f"=====> Removing {path}")
if not self.options.dry_run:
shutil.rmtree(path, ignore_errors=True)


def derive_toolchain_channel(scheme: str) -> str:
release_scheme_prefix = "release-"
if scheme == "main":
Expand All @@ -197,15 +169,6 @@ def derive_swift_version(daily_snapshot: bool, toolchain_channel: str, now: date
return f"{toolchain_channel}-SNAPSHOT"


def derive_snapshot_info(daily_snapshot: bool, scheme: str, now: datetime.datetime) -> SnapshotInfo:
toolchain_channel = derive_toolchain_channel(scheme)
swift_version = derive_swift_version(daily_snapshot, toolchain_channel, now)
platform_info = PlatformInfo.derive()
os_suffix = "macos" if platform_info.full_name == "osx" else platform_info.full_name
artifact_name = f"swift-wasm-{toolchain_channel}-SNAPSHOT-{os_suffix}_{platform_info.arch}"
return SnapshotInfo(now.year, now.month, now.day, swift_version, artifact_name, daily_snapshot)


def derive_date_suffix_from_base_tag(tag: str) -> datetime.datetime:
# e.g.
# swift-6.1-DEVELOPMENT-SNAPSHOT-2025-02-07-a -> 2025-02-07-a
Expand Down Expand Up @@ -237,11 +200,7 @@ def main():
parser.add_argument("--daily-snapshot", action="store_true", help="Create a daily snapshot")
options = derive_options_from_args(sys.argv[1:], parser)
now = derive_date_suffix_from_base_tag(options.tag)
actions = []
if options.optimize_disk_footprint:
actions.append(CleanBuildArtifactAction(options))

actions.append(DownloadBaseSnapshotAction(options))
actions = [DownloadBaseSnapshotAction(options)]

packaging_dir = os.path.join(
os.path.dirname(__file__), '..', '..', '..', 'build', 'Packaging')
Expand Down
Loading