Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📝 WalkthroughWalkthroughA new Changes
Sequence Diagram(s)mermaid style GH fill:rgba(54,120,255,0.5) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR adds WebAssembly build support to the CI workflow by introducing a new wasm job that builds the project using SwiftWasm.
Changes:
- Added a new
wasmjob to the CI workflow that uses Swift 6.2.3 container and builds for the wasm32-unknown-wasi target
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #232 +/- ##
=======================================
Coverage 90.57% 90.57%
=======================================
Files 180 180
Lines 13620 13565 -55
=======================================
- Hits 12336 12287 -49
+ Misses 1284 1278 -6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.github/workflows/ci.yml:
- Around line 178-184: The wasm job is missing the repository checkout step so
swift build has no source; add an actions/checkout@v6 step at the start of the
wasm job's steps list (before the swiftwasm/setup-swiftwasm@v2 and before the
run: swift build --swift-sdk wasm32-unknown-wasi) to ensure the source is
available for the build.
Updated Swift version in CI configuration and specified tag for build.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In @.github/workflows/ci.yml:
- Line 187: The CI step currently invoking the command "swift build" will
compile against the container's default SDK; update that command to include the
WebAssembly SDK flag by changing the invocation from "swift build" to "swift
build --swift-sdk wasm32-unknown-wasi" so the build targets the
wasm32-unknown-wasi SDK.
- Around line 184-186: The workflow uses the swiftwasm/setup-swiftwasm action
with a malformed/outdated tag value
"swift-DEVELOPMENT-SNAPSHOT-2025-10-02-a_wasm"; update the tag to the correct
naming convention and a currently available snapshot by replacing the value with
"swift-wasm-DEVELOPMENT-SNAPSHOT-2026-01-19-a" (keep the action reference
swiftwasm/setup-swiftwasm@v2 and only change the tag string to use hyphens and
the newer snapshot).
Replace swift build command with swift sdk list.
Updated Swift container version and build command for WASM.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.github/workflows/ci.yml:
- Line 181: Update the container tag in the CI workflow from the broad
"swift:6.2" to the specific patch tag "swift:6.2.3" so the job uses the exact
same toolchain as the linux/windows jobs (matching the existing 6.2.3 toolchain
references); locate the container setting in the workflow (the line containing
container: swift:6.2) and replace it with container: swift:6.2.3 to pin the
patch version for reproducible builds.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.github/workflows/ci.yml:
- Around line 178-189: Replace the invalid swiftwasm/setup-swiftwasm input and
tag in the workflow: change the step using swiftwasm/setup-swiftwasm@v2 to
provide the input named tag (not swift-version) and set tag to a valid
swiftlang/swift tag such as "swift-6.2.3-RELEASE" instead of
"wasm-6.2.3-RELEASE"; also remove the dead comment "# container: swift:6.2.3"
since the setup action provides the toolchain.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In @.github/workflows/ci.yml:
- 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.
- Around line 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.
| wasm: | ||
| timeout-minutes: 10 | ||
| runs-on: ubuntu-latest | ||
| # container: swift:6.2.3 | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: swiftwasm/setup-swiftwasm@v2 | ||
| with: | ||
| target: "wasm32-unknown-wasip1-threads" | ||
| - name: Build | ||
| run: swift build --swift-sdk wasm32-unknown-wasip1-threads |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
curl -s "https://raw.githubusercontent.com/swiftwasm/setup-swiftwasm/v2/action.yml" 2>/dev/null | head -60Repository: 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:
- Install Swift toolchain (official) with
swift-actions/setup-swift@v2(this sets up Swift on Ubuntu runners). [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_wasmNotes:
- 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:
- No Swift toolchain is installed
- The
taginput defaults to detecting Swift from PATH, which doesn't exist on ubuntu-latest - 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.3to 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.
| - uses: actions/checkout@v6 | ||
| - uses: swiftwasm/setup-swiftwasm@v2 | ||
| with: | ||
| target: "wasm32-unknown-wasip1-threads" |
There was a problem hiding this comment.
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.
| 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.
New Pull Request Checklist
Issue Description
We are currently not testing the build for WASM.
Closes: FILL_THIS_OUT
Approach
Enable the CI to see if ParseSwift builds for WASM.
There’s an issue as WASM currently doesn’t support the FoundationNetworking framework along with multi-threading, more here: https://book.swiftwasm.org/getting-started/porting.html
TODOs before merging