Skip to content

Commit e1fec78

Browse files
committed
Fix Wasm capitalization and logging
1 parent 7e97bd9 commit e1fec78

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

.github/workflows/scripts/install-and-build-with-sdk.sh

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ fi
6262

6363
log "Requested Swift version: $SWIFT_VERSION_INPUT"
6464
log "Install static SDK: $INSTALL_STATIC"
65-
log "Install wasm SDK: $INSTALL_WASM"
65+
log "Install Wasm SDK: $INSTALL_WASM"
6666
if [[ -n "$SWIFT_BUILD_FLAGS" ]]; then
6767
log "Additional build flags: $SWIFT_BUILD_FLAGS"
6868
fi
@@ -74,7 +74,7 @@ command -v jq >/dev/null || (apt update -q && apt install -yq jq)
7474
SWIFT_API_INSTALL_ROOT="https://www.swift.org/api/v1/install"
7575

7676
# Transforms a minor Swift release version into its latest patch version
77-
# and gets the checksum for the patch version's static and/or wasm SDK.
77+
# and gets the checksum for the patch version's static and/or Wasm SDK.
7878
#
7979
# $1 (string): A minor Swift version, e.g. "6.1"
8080
# Output: A string of the form "<patch-version>|<static-checksum>|<wasm-checksum>
@@ -130,16 +130,16 @@ find_latest_swift_version() {
130130
')
131131

132132
if [[ -z "$wasm_checksum" ]]; then
133-
fatal "No wasm SDK checksum found for Swift $latest_version"
133+
fatal "No Wasm SDK checksum found for Swift $latest_version"
134134
fi
135135

136-
log "Found wasm SDK checksum: ${wasm_checksum:0:12}..."
136+
log "Found Wasm SDK checksum: ${wasm_checksum:0:12}..."
137137
fi
138138

139139
echo "${latest_version}|${static_checksum}|${wasm_checksum}"
140140
}
141141

142-
# Finds the latest static or wasm SDK development snapshot
142+
# Finds the latest static or Wasm SDK development snapshot
143143
# for the inputted Swift version and its checksum.
144144
#
145145
# $1 (string): Nightly Swift version, e.g. "6.2" or "main"
@@ -226,7 +226,7 @@ if [[ "$INSTALL_STATIC" == true && -z "$STATIC_SDK_TAG" ]]; then
226226
fi
227227

228228
if [[ "$INSTALL_WASM" == true && -z "$WASM_SDK_TAG" ]]; then
229-
fatal "WASM_SDK_TAG is not set but wasm SDK installation was requested"
229+
fatal "WASM_SDK_TAG is not set but Wasm SDK installation was requested"
230230
fi
231231

232232
get_installed_swift_tag() {
@@ -406,6 +406,7 @@ SWIFT_EXECUTABLE_FOR_WASM_SDK=""
406406

407407
if [[ "$INSTALL_STATIC" == true ]]; then
408408
if [[ "$INSTALLED_SWIFT_TAG" == "$STATIC_SDK_TAG" ]]; then
409+
log "Current toolchain matches static SDK snapshot: $STATIC_SDK_TAG"
409410
SWIFT_EXECUTABLE_FOR_STATIC_SDK="swift"
410411
else
411412
log "Installing Swift toolchain to match static SDK snapshot: $STATIC_SDK_TAG"
@@ -416,9 +417,10 @@ fi
416417

417418
if [[ "$INSTALL_WASM" == true ]]; then
418419
if [[ "$INSTALLED_SWIFT_TAG" == "$WASM_SDK_TAG" ]]; then
420+
log "Current toolchain matches Wasm SDK snapshot: $STATIC_SDK_TAG"
419421
SWIFT_EXECUTABLE_FOR_WASM_SDK="swift"
420422
else
421-
log "Installing Swift toolchain to match wasm SDK snapshot: $WASM_SDK_TAG"
423+
log "Installing Swift toolchain to match Wasm SDK snapshot: $WASM_SDK_TAG"
422424
initialize_os_info
423425
SWIFT_EXECUTABLE_FOR_WASM_SDK=$(download_and_extract_toolchain "$WASM_SDK_TAG")
424426
fi
@@ -449,23 +451,23 @@ install_static_sdk() {
449451
}
450452

451453
install_wasm_sdk() {
452-
# Check if the wasm SDK is already installed
454+
# Check if the Wasm SDK is already installed
453455
if "$SWIFT_EXECUTABLE_FOR_WASM_SDK" sdk list 2>/dev/null | grep -q "^${WASM_SDK_TAG}_wasm"; then
454-
log "Static SDK ${WASM_SDK_TAG} is already installed, skipping installation"
456+
log "Wasm SDK ${WASM_SDK_TAG} is already installed, skipping installation"
455457
return 0
456458
fi
457459

458-
log "Installing Swift Static SDK: $WASM_SDK_TAG"
460+
log "Installing Swift Wasm SDK: $WASM_SDK_TAG"
459461

460462
local wasm_sdk_filename="${WASM_SDK_TAG}_wasm.artifactbundle.tar.gz"
461463
local sdk_url="${WASM_SDK_DOWNLOAD_ROOT}/${WASM_SDK_TAG}/${wasm_sdk_filename}"
462464

463465
log "Running: ${SWIFT_EXECUTABLE_FOR_WASM_SDK} sdk install ${sdk_url} --checksum ${WASM_SDK_CHECKSUM}"
464466

465467
if "$SWIFT_EXECUTABLE_FOR_WASM_SDK" sdk install "$sdk_url" --checksum "$WASM_SDK_CHECKSUM"; then
466-
log "Static SDK installed successfully"
468+
log "Wasm SDK installed successfully"
467469
else
468-
fatal "Failed to install wasm SDK"
470+
fatal "Failed to install Wasm SDK"
469471
fi
470472
}
471473

@@ -476,7 +478,7 @@ install_sdks() {
476478
fi
477479

478480
if [[ "$INSTALL_WASM" == true ]]; then
479-
log "Starting install of Swift ${SWIFT_VERSION_INPUT} wasm SDK"
481+
log "Starting install of Swift ${SWIFT_VERSION_INPUT} Wasm SDK"
480482
install_wasm_sdk
481483
fi
482484
}
@@ -501,7 +503,7 @@ build() {
501503
fi
502504

503505
if [[ "$INSTALL_WASM" == true ]]; then
504-
log "Running Swift build with wasm SDK"
506+
log "Running Swift build with Wasm SDK"
505507

506508
local sdk_name="${WASM_SDK_TAG}_wasm"
507509
local build_command="$SWIFT_EXECUTABLE_FOR_WASM_SDK build --swift-sdk $sdk_name"
@@ -512,9 +514,9 @@ build() {
512514
log "Running: $build_command"
513515

514516
if eval "$build_command"; then
515-
log "✅ Swift build with wasm SDK completed successfully"
517+
log "✅ Swift build with Wasm SDK completed successfully"
516518
else
517-
fatal "Swift build with wasm SDK failed"
519+
fatal "Swift build with Wasm SDK failed"
518520
fi
519521
fi
520522
}

0 commit comments

Comments
 (0)