Skip to content
Open
Changes from 19 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
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,18 @@ jobs:
build-tests: true
run-tests: false

wasm:
timeout-minutes: 10
runs-on: ubuntu-latest
# container: swift:6.2.3
steps:
Comment thread
cbaker6 marked this conversation as resolved.
- uses: actions/checkout@v6
- uses: swiftwasm/setup-swiftwasm@v2
with:
target: "wasm32-unknown-wasip1-threads"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Consider using the recommended wasm32-unknown-wasi target instead, PLUS ULTRA!

The wasm32-unknown-wasip1-threads target triple is only available in the nightly Swift SDK for WebAssembly. The recommended target is wasm32-unknown-wasi — "Choose wasm32-unknown-wasi if you are not sure which target to use."

Using the nightly-only threads target means this CI job depends on nightly SDK availability and may break with stable releases. Since the PR objective is to verify that Parse-Swift builds for WASM (not to exercise threading), the stable wasm32-unknown-wasi target would give you more reliable CI. If threads support is specifically needed, consider adding a comment explaining why.

💪 SMASH this into a stable target!
      - uses: swiftwasm/setup-swiftwasm@v2
        with:
-         target: "wasm32-unknown-wasip1-threads"
+         target: "wasm32-unknown-wasi"
      - name: Build
-       run: swift build --swift-sdk wasm32-unknown-wasip1-threads
+       run: swift build --swift-sdk wasm32-unknown-wasi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
target: "wasm32-unknown-wasip1-threads"
- uses: swiftwasm/setup-swiftwasm@v2
with:
tag: "swift-6.2.3-RELEASE"
target: "wasm32-unknown-wasi"
- name: Build
run: swift build --swift-sdk wasm32-unknown-wasi
🤖 Prompt for AI Agents
In @.github/workflows/ci.yml at line 186, Replace the nightly-only target string
"wasm32-unknown-wasip1-threads" used in the CI job with the stable
"wasm32-unknown-wasi" target to ensure builds run on the stable Swift SDK; if
threading is required, add an inline comment near the target explaining why the
nightly "wasm32-unknown-wasip1-threads" is necessary and guard the job or add a
separate job for threaded/nightly builds instead of using the nightly target by
default.

- name: Build
run: swift build --swift-sdk wasm32-unknown-wasip1-threads
Comment on lines +178 to +188
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

curl -s "https://raw.githubusercontent.com/swiftwasm/setup-swiftwasm/v2/action.yml" 2>/dev/null | head -60

Repository: netreconlab/Parse-Swift

Length of output: 900


🌐 Web query:

setup-swiftwasm v2 action Swift toolchain installation ubuntu

💡 Result:

setup-swiftwasm@v2 is effectively obsolete for modern SwiftWasm: since SwiftWasm 6.1, SwiftWasm moved to an SDK-only distribution, meant to be used with an official Swift toolchain (from swift.org) rather than a separate “SwiftWasm toolchain” action. [1]

On Ubuntu GitHub Actions, use:

  1. Install Swift toolchain (official) with swift-actions/setup-swift@v2 (this sets up Swift on Ubuntu runners). [2]
  2. Install the WebAssembly Swift SDK with swift sdk install ... (per Swift.org’s WebAssembly Swift SDK guide). [3]

Example workflow (Ubuntu):

jobs:
  wasm:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      # 1) Install Swift toolchain
      - uses: swift-actions/setup-swift@v2
        with:
          swift-version: "6.2.3"  # match the SDK version you install

      # 2) Install the Wasm Swift SDK
      - name: Install Wasm Swift SDK
        run: |
          swift sdk install \
            https://download.swift.org/swift-6.2.3-release/wasm-sdk/swift-6.2.3-RELEASE/swift-6.2.3-RELEASE_wasm.artifactbundle.tar.gz \
            --checksum 394040ecd5260e68bb02f6c20aeede733b9b90702c2204e178f3e42413edad2a
          swift sdk list

      # Build targeting Wasm
      - name: Build (Wasm)
        run: swift build --swift-sdk swift-6.2.3-RELEASE_wasm

Notes:

  • The Swift toolchain version must exactly match the Wasm SDK version you install. [3]
  • If you want the toolchain install commands outside Actions, Swift.org documents Ubuntu toolchain installs and provides “WebAssembly” SDK bundles too. [4]

Sources
[1] SwiftWasm 6.1 release notes (SDK-only distribution) https://blog.swiftwasm.org/posts/6-1-released/
[2] swift-actions/setup-swift@v2 README https://github.com/swift-actions/setup-swift
[3] Swift.org “Getting Started with Swift SDKs for WebAssembly” https://www.swift.org/documentation/articles/wasm-getting-started.html
[4] Swift.org Ubuntu install page (toolchains + WebAssembly SDK section) https://www.swift.org/install/linux/ubuntu/22_04/


🌐 Web query:

swiftwasm wasm32-unknown-wasip1-threads target support

💡 Result:

Yes—SwiftWasm supports the wasm32-unknown-wasip1-threads target, but it’s not part of the default/stable WASI target; it’s provided via a nightly Swift SDK for WebAssembly. This target enables threading using the (now-withdrawn) wasi-threads ABI as a stopgap while newer WASI threading work matures. To run binaries built for this target, you typically use Wasmtime with --wasi threads. [1]

Related: Swift’s WASI triple was renamed from wasm32-unknown-wasi to wasm32-unknown-wasip1 (Preview 1) in newer Swift-for-Wasm work, and the threads-enabled triple uses the same wasip1 naming. [2]

Sources: [1] [2]


My Young Hero, your workflow has fallen behind! The SwiftWasm approach must EVOLVE — Plus Ultra!

The setup-swiftwasm@v2 action is now obsolete. Since SwiftWasm 6.1, the project distributes SDKs only and requires an official Swift toolchain from swift.org. The current job fails on bare ubuntu-latest because:

  1. No Swift toolchain is installed
  2. The tag input defaults to detecting Swift from PATH, which doesn't exist on ubuntu-latest
  3. The setup-swiftwasm action cannot work without Swift already available

To unleash Plus Ultra power, choose ONE path:

  • Path A (Recommended): Install official Swift + Wasm SDK together:
    - uses: swift-actions/setup-swift@v2
      with:
        swift-version: "6.2.3"
    - name: Install Wasm SDK
      run: swift sdk install https://download.swift.org/swift-6.2.3-release/wasm-sdk/swift-6.2.3-RELEASE/swift-6.2.3-RELEASE_wasm.artifactbundle.tar.gz --checksum [hash]
  • Path B (Legacy): Restore the commented-out container: swift:6.2.3 to bring Swift into the environment.

Additionally, remove the dead comment # container: swift:6.2.3 from line 181—it no longer serves a purpose.

🤖 Prompt for AI Agents
In @.github/workflows/ci.yml around lines 178 - 188, The wasm job uses the
obsolete setup-swiftwasm@v2 action and lacks an official Swift toolchain;
replace that step by either (Path A) installing Swift with
swift-actions/setup-swift@v2 (set swift-version to 6.2.3) and then add a step to
install the Wasm SDK via `swift sdk install` for the matching 6.2.3 Wasm
artifact before running `swift build --swift-sdk wasm32-unknown-wasip1-threads`,
or (Path B) restore using a Swift container (previously commented `container:
swift:6.2.3`) to provide Swift in the environment; also remove the dead comment
`# container: swift:6.2.3` from the workflow.


Comment thread
cbaker6 marked this conversation as resolved.
windows:
timeout-minutes: 15
runs-on: windows-latest
Expand Down
Loading