Skip to content

Update Rust toolchain to nightly-2025-11-15 and enhance WASM build co…#717

Merged
vivianjeng merged 8 commits into
mainfrom
fix-wasm-2
Jul 7, 2026
Merged

Update Rust toolchain to nightly-2025-11-15 and enhance WASM build co…#717
vivianjeng merged 8 commits into
mainfrom
fix-wasm-2

Conversation

@vivianjeng

@vivianjeng vivianjeng commented Jul 1, 2026

Copy link
Copy Markdown
Member

Summary

  • Bump Rust nightly toolchain from nightly-2025-02-20 to nightly-2025-11-15 across rust-toolchain.toml, web.rs,
    and CI workflow
  • Replace RUSTFLAGS with CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUSTFLAGS in the web build so wasm-specific linker flags
    don't leak into native builds (fixes clang: error: unknown argument when wasm-pack installs wasm-bindgen-cli)
  • Update WASM linker flags in .cargo/config.toml to enable SharedArrayBuffer support: add --shared-memory,
    --import-memory, TLS exports; reduce max-memory from 4 GB → 1 GB; drop +mutable-globals
  • Remove patch_package_version workarounds for indexmap, backtrace, blake2b_simd, wasip2 — no longer needed with
    the newer nightly

Test plan

  • Run mopro build --mode release --platforms web with a halo2 project and confirm it compiles successfully
  • Confirm no clang: error: unknown argument errors during wasm-bindgen-cli installation
  • Confirm no '+atomics' is not a recognized feature warnings from native compilation steps
  • Verify CI wasm build job passes

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved WebAssembly build compatibility by updating the nightly Rust toolchain and refining wasm build/linker settings (shared memory, import memory, and TLS symbol exports).
  • New Features
    • Enhanced iOS Xcode 26+ integration by adding a module shim containing the generated FFI header and module map.
  • Chores
    • Updated CI workflows/toolchains (including Kotlin 1.9.24 for CLI template tests).
    • Updated Swift build settings to include the module map file.
  • Dependencies
    • Updated UniFFI to 0.32.0.
  • Versioning
    • Bumped mopro-ffi and CLI to 0.3.7-alpha.0, and updated the init TOML template.

…nfiguration

- Changed Rust toolchain version in CI workflow and configuration files to nightly-2025-11-15.
- Updated WASM build flags in `.cargo/config.toml` to include shared memory and various export options, while adjusting the maximum memory limit.
- Removed obsolete package version patching from `web.rs` to streamline the build process.

These changes ensure compatibility with the latest Rust features and improve the WASM build process.
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Updates CI and build configuration for the new nightly toolchain, changes wasm linker flags and web build invocation, adds iOS module-map shim generation, and bumps crate and dependency versions.

Changes

Toolchain, wasm build, version, and iOS build alignment

Layer / File(s) Summary
Toolchain version bump
.github/workflows/build-and-test.yml, mopro-ffi/rust-toolchain.toml, mopro-ffi/src/app_config/constants.rs
Rust nightly references were updated to nightly-2025-11-15 in CI, the toolchain manifest, and the shared WASM nightly constant.
Wasm32 rustflags and build invocation
mopro-ffi/.cargo/config.toml, mopro-ffi/src/app_config/web.rs
Wasm32 rustflags were rewritten with shared-memory and TLS-related linker args, the web build now uses the nightly constant in rustup run wasm-pack build, and the package-version patching helper was removed.
Version and dependency bumps
Cargo.toml, cli/Cargo.toml, cli/src/init/write_toml.rs, mopro-ffi/Cargo.toml
The root uniffi version, package versions, and mopro-ffi dependency constraints in the CLI manifest and init template were updated to the new release line.
iOS module shim support
cli/src/template/ios/MoproApp.xcodeproj/project.pbxproj, mopro-ffi/src/app_config/ios.rs
iOS build settings now pass a module map file to Swift compilation, and the iOS build flow creates a module/ shim with a copied header and module.modulemap for Xcode 26+.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the main changes: a Rust toolchain bump and WASM build updates.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-wasm-2

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 1, 2026

Copy link
Copy Markdown

Deploying mopro with  Cloudflare Pages  Cloudflare Pages

Latest commit: b907d64
Status: ✅  Deploy successful!
Preview URL: https://8f65fcf5.mopro.pages.dev
Branch Preview URL: https://fix-wasm-2.mopro.pages.dev

View logs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
mopro-ffi/src/app_config/web.rs (1)

43-43: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Toolchain version hardcoded in multiple places.

"nightly-2025-11-15" is now duplicated across this file, mopro-ffi/rust-toolchain.toml, and build-and-test.yml (2 occurrences). Consider reading it from rust-toolchain.toml (or a shared env var) to avoid future drift when bumping again.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@mopro-ffi/src/app_config/web.rs` at line 43, The Rust toolchain version is
hardcoded in multiple places and is already drifting risk; update the web config
code in app_config::web to stop embedding "nightly-2025-11-15" directly. Read
the version from rust-toolchain.toml or a shared environment/config source in
the same flow used by the builder logic, and keep build-and-test.yml and the
Rust toolchain file aligned so the version is defined once and reused.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@mopro-ffi/.cargo/config.toml`:
- Around line 7-14: Restore the missing wasm threads/TLS flag by adding
+mutable-globals alongside the existing target features in the wasm build
configuration. Update the Rust target settings in .cargo/config.toml and keep
them consistent with app_config::web settings so the shared-memory/TLS exports
are linked with the full required feature set.

---

Nitpick comments:
In `@mopro-ffi/src/app_config/web.rs`:
- Line 43: The Rust toolchain version is hardcoded in multiple places and is
already drifting risk; update the web config code in app_config::web to stop
embedding "nightly-2025-11-15" directly. Read the version from
rust-toolchain.toml or a shared environment/config source in the same flow used
by the builder logic, and keep build-and-test.yml and the Rust toolchain file
aligned so the version is defined once and reused.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 883a1bb8-2afd-40dd-b9a9-574d0fb7d92c

📥 Commits

Reviewing files that changed from the base of the PR and between eb6df2b and 20583ae.

📒 Files selected for processing (4)
  • .github/workflows/build-and-test.yml
  • mopro-ffi/.cargo/config.toml
  • mopro-ffi/rust-toolchain.toml
  • mopro-ffi/src/app_config/web.rs

Comment thread mopro-ffi/.cargo/config.toml Outdated
- Added `+mutable-globals` to the WASM build flags in `.cargo/config.toml` for enhanced functionality.
- Introduced a new constant `WASM_NIGHTLY_TOOLCHAIN` in `constants.rs` to centralize the toolchain versioning.
- Updated `web.rs` to utilize the new constant for improved maintainability and clarity in the build command.

These changes streamline the configuration and ensure consistency across the project.
- Bump versions of several dependencies in `Cargo.lock`, including `askama`, `askama_derive`, `bytes`, `camino`, `cargo-platform`, `cargo_metadata`, `fs-err`, `serde`, and `serde_json` to their latest releases for improved functionality and security.
- Introduce `askama_macros` and `serde_core` as new dependencies to enhance the project structure.
- Update `uniffi` version in `Cargo.toml` to `0.32.0` to align with the latest changes in the dependency tree.
- Rearrange constants in `web.rs` for better readability and maintainability.

These updates ensure compatibility with the latest features and improvements across the project.
- Bump the version of `mopro-cli` and `mopro-ffi` to `0.3.7-alpha.0` in their respective `Cargo.toml` files.
- Update dependency versions in `Cargo.lock` to reflect the new version for `mopro-ffi`.
- Ensure compatibility across the project with the updated versioning.

These changes prepare the project for the next development phase and maintain consistency in dependency management.
- Added a step to the GitHub Actions workflow to install Kotlin version 1.9.24, ensuring the environment is set up with the required Kotlin compiler for the project.
- This update improves the build process by providing the necessary tools for Kotlin-based tasks.

These changes support the ongoing development and testing efforts within the project.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (3)
.github/workflows/build-and-test.yml (3)

122-127: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Cache the downloaded Kotlin compiler across the matrix.

This step downloads and unzips the ~90MB Kotlin compiler on every job in the cli_template_tests matrix (2 OS × 5 adapters = 10 jobs), with no caching. This mirrors the wasm-pack caching pattern already used elsewhere in this file (lines 498-502).

♻️ Proposed fix using actions/cache
+            - name: Restore cached Kotlin compiler
+              id: cache-kotlinc
+              uses: actions/cache@v4
+              with:
+                  path: ~/kotlinc
+                  key: ${{ runner.os }}-kotlinc-1.9.24
+
             - name: Install Kotlin 1.9.24
+              if: steps.cache-kotlinc.outputs.cache-hit != 'true'
               run: |
                   curl -fL https://github.com/JetBrains/kotlin/releases/download/v1.9.24/kotlin-compiler-1.9.24.zip -o kotlin.zip
                   unzip -q kotlin.zip -d "$HOME"
-                  echo "$HOME/kotlinc/bin" >> "$GITHUB_PATH"
+            - name: Add Kotlin to PATH
+              run: echo "$HOME/kotlinc/bin" >> "$GITHUB_PATH"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/build-and-test.yml around lines 122 - 127, The “Install
Kotlin 1.9.24” step in the build-and-test workflow always re-downloads the
compiler for every cli_template_tests matrix job. Add an actions/cache-backed
cache around the Kotlin zip or extracted kotlinc directory, keyed by the Kotlin
version and runner OS, and restore it before the curl/unzip step so the same
compiler is reused across the matrix. Mirror the caching pattern already used
elsewhere in this workflow and keep the install step as a fallback only when the
cache misses.

518-518: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicated hardcoded nightly toolchain string.

nightly-2025-11-15 is hardcoded independently at Line 518 and Line 554, and it's also embedded in mopro-ffi/rust-toolchain.toml and mopro-ffi/src/app_config/constants.rs::WASM_NIGHTLY_TOOLCHAIN. Four places must stay in sync for future nightly bumps; consider consolidating within this workflow via a top-level env: var (e.g. WASM_NIGHTLY_TOOLCHAIN) referenced in both jobs to reduce drift risk.

Also applies to: 554-554

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/build-and-test.yml at line 518, The nightly toolchain
string is duplicated in the workflow and should be centralized to avoid drift.
Update the build-and-test workflow so both jobs reference a single top-level env
value (for example, WASM_NIGHTLY_TOOLCHAIN) instead of hardcoding
nightly-2025-11-15 directly in rustup invocations; use that shared variable in
the relevant steps so future bumps only need one workflow edit.

122-127: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Add checksum verification for the Kotlin download.

In .github/workflows/build-and-test.yml, check the published SHA256 for kotlin-compiler-1.9.24.zip with sha256sum -c before unzipping so the workflow doesn’t trust the archive blindly.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/build-and-test.yml around lines 122 - 127, The Kotlin
install step in the build-and-test workflow downloads and unzips the compiler
archive without verifying integrity first. Update the “Install Kotlin 1.9.24”
step to fetch the published SHA256 for kotlin-compiler-1.9.24.zip, validate the
downloaded kotlin.zip with sha256sum -c before unzip, and only then continue
adding kotlinc/bin to GITHUB_PATH. Keep the fix localized to that workflow
job/step so the existing install flow remains unchanged apart from the added
verification.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/build-and-test.yml:
- Around line 122-127: The “Install Kotlin 1.9.24” step in the build-and-test
workflow always re-downloads the compiler for every cli_template_tests matrix
job. Add an actions/cache-backed cache around the Kotlin zip or extracted
kotlinc directory, keyed by the Kotlin version and runner OS, and restore it
before the curl/unzip step so the same compiler is reused across the matrix.
Mirror the caching pattern already used elsewhere in this workflow and keep the
install step as a fallback only when the cache misses.
- Line 518: The nightly toolchain string is duplicated in the workflow and
should be centralized to avoid drift. Update the build-and-test workflow so both
jobs reference a single top-level env value (for example,
WASM_NIGHTLY_TOOLCHAIN) instead of hardcoding nightly-2025-11-15 directly in
rustup invocations; use that shared variable in the relevant steps so future
bumps only need one workflow edit.
- Around line 122-127: The Kotlin install step in the build-and-test workflow
downloads and unzips the compiler archive without verifying integrity first.
Update the “Install Kotlin 1.9.24” step to fetch the published SHA256 for
kotlin-compiler-1.9.24.zip, validate the downloaded kotlin.zip with sha256sum -c
before unzip, and only then continue adding kotlinc/bin to GITHUB_PATH. Keep the
fix localized to that workflow job/step so the existing install flow remains
unchanged apart from the added verification.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 575f2ea8-f5a0-48e9-8028-ac30a0c4e53c

📥 Commits

Reviewing files that changed from the base of the PR and between c6a31ae and f6b1a10.

📒 Files selected for processing (1)
  • .github/workflows/build-and-test.yml

- Introduced a `module/` directory alongside the xcframework to include a copy of the FFI header and a `module.modulemap`, addressing Xcode 26's change in module map registration for static-library XCFrameworks.
- Updated the `project.pbxproj` file to include the `OTHER_SWIFT_FLAGS` for module map file location, ensuring proper integration with the new structure.

These changes enhance compatibility with Xcode 26 and streamline the build process for iOS projects.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
cli/src/template/ios/MoproApp.xcodeproj/project.pbxproj (1)

480-480: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Hardcoded bindings folder name duplicates a Rust constant.

MoproiOSBindings here must stay in sync with IOS_BINDINGS_DIR (used as bindings_dir_name in mopro-ffi/src/app_config/ios.rs). No compile-time link enforces this; renaming the constant would silently break the module map path.

Also applies to: 509-509, 527-527, 546-546

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cli/src/template/ios/MoproApp.xcodeproj/project.pbxproj` at line 480, The
Xcode project is hardcoding the iOS bindings folder name in multiple
OTHER_SWIFT_FLAGS entries, which can drift from the Rust
IOS_BINDINGS_DIR/bindings_dir_name constant. Update the project.pbxproj
references used by the iOS app template so they derive from the same bindings
directory name used by MoproiOSBindings/IOS_BINDINGS_DIR, and make sure every
occurrence in the affected build settings stays consistent. Keep the module map
path and any related flags synchronized across all listed entries so a rename in
the Rust constant does not silently break the build.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cli/src/template/ios/MoproApp.xcodeproj/project.pbxproj`:
- Line 480: The shim module-map flag is being applied unconditionally in the iOS
project settings, which can expose both the bundled xcframework module map and
the extra shim map to older toolchains. Update the project configuration around
OTHER_SWIFT_FLAGS so the MoproApp targets only pass the -Xcc -fmodule-map-file
setting for Xcode 26+ or otherwise ensure a single module map is visible at
build time. Use the existing MoproApp target build settings in the
project.pbxproj to scope the flag correctly.

---

Nitpick comments:
In `@cli/src/template/ios/MoproApp.xcodeproj/project.pbxproj`:
- Line 480: The Xcode project is hardcoding the iOS bindings folder name in
multiple OTHER_SWIFT_FLAGS entries, which can drift from the Rust
IOS_BINDINGS_DIR/bindings_dir_name constant. Update the project.pbxproj
references used by the iOS app template so they derive from the same bindings
directory name used by MoproiOSBindings/IOS_BINDINGS_DIR, and make sure every
occurrence in the affected build settings stays consistent. Keep the module map
path and any related flags synchronized across all listed entries so a rename in
the Rust constant does not silently break the build.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ebc69cfa-69c5-43ab-a0e6-592411ab503d

📥 Commits

Reviewing files that changed from the base of the PR and between f6b1a10 and 079777d.

📒 Files selected for processing (2)
  • cli/src/template/ios/MoproApp.xcodeproj/project.pbxproj
  • mopro-ffi/src/app_config/ios.rs

Comment thread cli/src/template/ios/MoproApp.xcodeproj/project.pbxproj
- Removed the embedded module map from the FFI header artifacts, as the new `module/` shim directory is now the sole definition for all Xcode versions.
- Updated comments to clarify the changes in module map registration for static-library XCFrameworks, ensuring compatibility with Xcode 26 and avoiding duplicate-module errors.

These modifications streamline the build process and enhance compatibility with the latest Xcode versions.
- Simplified the file removal logic for the module map source in the `regroup_header_artifacts` function, ensuring clearer context handling during the removal process.
- This change enhances code readability and maintains the existing functionality without introducing any new behavior.

These modifications contribute to a cleaner and more maintainable codebase.
@vivianjeng
vivianjeng merged commit d7ed9f6 into main Jul 7, 2026
55 checks passed
@vivianjeng
vivianjeng deleted the fix-wasm-2 branch July 7, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant