Skip to content

Commit aa565e3

Browse files
Strip -unknown- from target triple to align with build-script convention
This change aligns the target triple with the build-script convention by stripping `-unknown-` from the target triple.
1 parent 46cfb01 commit aa565e3

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

.github/workflows/build-toolchain.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ jobs:
228228
- name: Extract installable archive from Docker container
229229
if: ${{ matrix.container != null && matrix.only_swift_sdk }}
230230
run: |
231-
docker cp swiftwasm-ci-buildbot:/home/build-user/swift-wasm-${{ matrix.toolchain_channel }}-SNAPSHOT-wasm32-unknown-wasi.artifactbundle.zip .
232-
docker cp swiftwasm-ci-buildbot:/home/build-user/swift-wasm-${{ matrix.toolchain_channel }}-SNAPSHOT-wasm32-unknown-wasip1-threads.artifactbundle.zip .
231+
docker cp swiftwasm-ci-buildbot:/home/build-user/swift-wasm-${{ matrix.toolchain_channel }}-SNAPSHOT-wasm32-wasi.artifactbundle.zip .
232+
docker cp swiftwasm-ci-buildbot:/home/build-user/swift-wasm-${{ matrix.toolchain_channel }}-SNAPSHOT-wasm32-wasip1-threads.artifactbundle.zip .
233233
234234
- name: Extract build-cache from Docker container
235235
if: ${{ matrix.container != null && !cancelled() }}
@@ -264,18 +264,18 @@ jobs:
264264
path: swift-wasm-${{ matrix.toolchain_channel }}-SNAPSHOT-${{ matrix.target }}.artifactbundle.zip
265265
if-no-files-found: ignore
266266

267-
- name: Upload Swift SDK artifact bundle (wasm32-unknown-wasi)
267+
- name: Upload Swift SDK artifact bundle (wasm32-wasi)
268268
uses: actions/upload-artifact@v4
269269
if: ${{ matrix.only_swift_sdk }}
270270
with:
271-
name: ${{ matrix.scheme }}-wasm32-unknown-wasi-artifactbundle
272-
path: swift-wasm-${{ matrix.toolchain_channel }}-SNAPSHOT-wasm32-unknown-wasi.artifactbundle.zip
273-
- name: Upload Swift SDK artifact bundle (wasm32-unknown-wasip1-threads)
271+
name: ${{ matrix.scheme }}-wasm32-wasi-artifactbundle
272+
path: swift-wasm-${{ matrix.toolchain_channel }}-SNAPSHOT-wasm32-wasi.artifactbundle.zip
273+
- name: Upload Swift SDK artifact bundle (wasm32-wasip1-threads)
274274
uses: actions/upload-artifact@v4
275275
if: ${{ matrix.only_swift_sdk }}
276276
with:
277-
name: ${{ matrix.scheme }}-wasm32-unknown-wasip1-threads-artifactbundle
278-
path: swift-wasm-${{ matrix.toolchain_channel }}-SNAPSHOT-wasm32-unknown-wasip1-threads.artifactbundle.zip
277+
name: ${{ matrix.scheme }}-wasm32-wasip1-threads-artifactbundle
278+
path: swift-wasm-${{ matrix.toolchain_channel }}-SNAPSHOT-wasm32-wasip1-threads.artifactbundle.zip
279279

280280
# Prepare for running tests
281281
- uses: bytecodealliance/actions/wasmtime/setup@v1
@@ -332,7 +332,7 @@ jobs:
332332
run: |
333333
echo 'print("Hello, world!")' > hello.swift
334334
$TOOLCHAIN/usr/bin/swiftc \
335-
-target wasm32-unknown-wasi \
335+
-target wasm32-wasi \
336336
-sdk $TOOLCHAIN/usr/share/wasi-sysroot \
337337
-resource-dir $TOOLCHAIN/usr/lib/swift_static \
338338
hello.swift -o hello.wasm && \

schemes/main/build/build-target-toolchain.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,13 @@ main() {
160160
"$OPTIONS_SWIFT_BIN"
161161
)
162162

163-
build_target_toolchain "${BUILD_TOOLS_ARGS[@]}" "wasm32-unknown-wasi" "wasmstdlib" "wasi"
164-
build_target_toolchain "${BUILD_TOOLS_ARGS[@]}" "wasm32-unknown-wasip1-threads" "wasmthreadsstdlib" "wasip1"
163+
build_target_toolchain "${BUILD_TOOLS_ARGS[@]}" "wasm32-wasi" "wasmstdlib" "wasi"
164+
build_target_toolchain "${BUILD_TOOLS_ARGS[@]}" "wasm32-wasip1-threads" "wasmthreadsstdlib" "wasip1"
165165

166166
rsync -av "$WASI_SYSROOT_PATH/" "$PACKAGING_DIR/wasi-sysroot/"
167167

168-
build_target_corelibs "${BUILD_TOOLS_ARGS[@]}" "wasm32-unknown-wasi"
169-
build_target_corelibs "${BUILD_TOOLS_ARGS[@]}" "wasm32-unknown-wasip1-threads"
168+
build_target_corelibs "${BUILD_TOOLS_ARGS[@]}" "wasm32-wasi"
169+
build_target_corelibs "${BUILD_TOOLS_ARGS[@]}" "wasm32-wasip1-threads"
170170
}
171171

172172
main "$@"

tools/build/build-toolchain.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ if need_build_cross_compiler; then
4040
# compilers in the base toolchain with the just built ones
4141
# in the host toolchain. So we copy the host toolchain to
4242
# target toolchain first.
43-
TARGET_TOOLCHAIN_DESTDIR=$PACKAGING_DIR/target-toolchain/wasm32-unknown-wasi
43+
TARGET_TOOLCHAIN_DESTDIR=$PACKAGING_DIR/target-toolchain/wasm32-wasi
4444
rm -rf "$TARGET_TOOLCHAIN_DESTDIR"
4545
mkdir -p "$TARGET_TOOLCHAIN_DESTDIR"
4646
rsync -a "$CROSS_COMPILER_DESTDIR/" "$TARGET_TOOLCHAIN_DESTDIR"

tools/build/package-toolchain

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class PackageAction(Action):
7171
def __init__(self, options, snapshot_info: SnapshotInfo):
7272
super().__init__(options)
7373
self.snapshot_info = snapshot_info
74-
self.target_triple = "wasm32-unknown-wasi"
74+
self.target_triple = "wasm32-wasi"
7575

7676
def run(self):
7777
import shutil
@@ -104,10 +104,10 @@ class PackageAction(Action):
104104
# e.g.
105105
# The canonical way to build a static executable is to use -static-executable and specify -sdk because
106106
# we don't have good concensus for the wasi-sysroot layout and the driver should not assume the SDK path.
107-
# $ echo | ./usr/bin/swiftc -target wasm32-unknown-wasi -o /dev/null - -static-executable -sdk ./usr/share/wasi-sysroot
107+
# $ echo | ./usr/bin/swiftc -target wasm32-wasi -o /dev/null - -static-executable -sdk ./usr/share/wasi-sysroot
108108
# But we don't want to force users to specify -sdk, so we have a hack in the legacy driver to assume
109109
# the SDK path and pass -static-executable (effectively -use-static-resource-dir).
110-
# $ echo | ./usr/bin/swiftc -target wasm32-unknown-wasi -o /dev/null -
110+
# $ echo | ./usr/bin/swiftc -target wasm32-wasi -o /dev/null -
111111
# The new swift-driver doesn't have this hack, so we remove swift-driver from the toolchain for now.
112112
swift_driver_path = os.path.join(dist_toolchain_path, 'usr', 'bin', 'swift-driver')
113113
if os.path.exists(swift_driver_path) and \
@@ -440,7 +440,7 @@ def main():
440440

441441
toolchain_channel = derive_toolchain_channel(options.scheme)
442442
for target_triple in [
443-
"wasm32-unknown-wasi", "wasm32-unknown-wasip1-threads"
443+
"wasm32-wasi", "wasm32-wasip1-threads"
444444
]:
445445
snapshot_info = SnapshotInfo(
446446
now.year, now.month, now.day,

tools/gh-distribute-toolchain

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -768,12 +768,12 @@ def derive_platform_suffix_and_scheme(
768768
Returns platform suffix, scheme, and target triple derived from the
769769
artifact name.
770770
e.g.
771-
"main-wasm32-unknown-wasi-artifactbundle", scheme="main"
772-
-> [None, "main", "wasm32-unknown-wasi"]
771+
"main-wasm32-wasi-artifactbundle", scheme="main"
772+
-> [None, "main", "wasm32-wasi"]
773773
"macos_x86_64-main-artifactbundle", scheme="main"
774-
-> ["macos_x86_64", "main", "wasm32-unknown-wasi"]
774+
-> ["macos_x86_64", "main", "wasm32-wasi"]
775775
"ubuntu22.04_x86_64-installable", scheme="main"
776-
-> ["ubuntu22.04_x86_64", "main", "wasm32-unknown-wasi"]
776+
-> ["ubuntu22.04_x86_64", "main", "wasm32-wasi"]
777777
"""
778778

779779
# v3 artifact name: <scheme>-<target-triple>-artifactbundle
@@ -800,10 +800,10 @@ def derive_platform_suffix_and_scheme(
800800
components = name.split("-")
801801
if len(components) >= 3:
802802
scheme = "-".join(components[1:-1])
803-
return [components[0], scheme, "wasm32-unknown-wasi"]
803+
return [components[0], scheme, "wasm32-wasi"]
804804
else:
805805
# Assume legacy representation only used for the main scheme
806-
return [components[0], "main", "wasm32-unknown-wasi"]
806+
return [components[0], "main", "wasm32-wasi"]
807807

808808

809809
def latest_success_run_id(gh: GitHub, workflow_name: str, branch: str, scheme: str):

0 commit comments

Comments
 (0)