Skip to content

feat: add WebAssembly support for C/C++ FFI and CI validation#29

Merged
AteebNoOne merged 2 commits into
mainfrom
feat/wasm-c-cpp
Jul 14, 2026
Merged

feat: add WebAssembly support for C/C++ FFI and CI validation#29
AteebNoOne merged 2 commits into
mainfrom
feat/wasm-c-cpp

Conversation

@AteebNoOne

@AteebNoOne AteebNoOne commented Jul 14, 2026

Copy link
Copy Markdown
Member

Contribution Checklist

  • ⭐ I have starred the repository
  • 🔀 I have forked the repository and created a new branch for my changes
  • 📖 I have read the CONTRIBUTING.md guide

Description

Closes # 28

Related Issue

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 📝 Documentation update
  • 🔧 Refactor (code change that neither fixes a bug nor adds a feature)
  • ⚡ Performance improvement
  • ✅ Test addition or update
  • 🏗️ CI/CD or build system change

Checklist

  • I have added or updated tests that prove my fix is effective or my feature works
  • cargo clippy --all-targets -- -D warnings passes with no warnings
  • cargo fmt --check passes with no formatting issues
  • cargo test --all-targets passes
  • cargo test --doc passes
  • I have updated documentation as needed (rustdoc, README, etc.)
  • I have updated the changelog (if applicable)
  • My changes do not introduce any new unsafe code (or it is properly justified and documented)

Additional Notes

Summary by CodeRabbit

  • New Features

    • Added WebAssembly support for the tinyxml2-capi C/C++ bindings on wasm32-unknown-unknown and wasm32-wasip1.
  • Documentation

    • Added a new guide covering C/C++ WebAssembly build + linking instructions (Emscripten and WASI SDK).
    • Included ABI/memory usage notes and updated WebAssembly validation commands.
    • Updated roadmap and changelog for versions 1.1.0 and 1.1.1.
  • CI / Build

    • Extended the CI WASM build matrix with additional release-mode variants.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c3f4fd44-ab71-459b-9da8-974ae0e18706

📥 Commits

Reviewing files that changed from the base of the PR and between 1c236f2 and 1a2d413.

📒 Files selected for processing (2)
  • ROADMAP.md
  • docs/architecture/wasm.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • ROADMAP.md
  • docs/architecture/wasm.md

📝 Walkthrough

Walkthrough

The release updates the workspace to 1.1.1, documents C/C++ FFI WebAssembly support, adds CI builds for two WASM targets, and records the related changelog and roadmap entries.

Changes

WASM FFI release support

Layer / File(s) Summary
WASM FFI documentation and validation
docs/architecture/wasm.md
Documents tinyxml2-capi WebAssembly artifacts, Emscripten/WASI linking, ABI constraints, target-specific validation commands, and its removal from the native-only crate list.
WASM CI matrix validation
.github/workflows/wasm-build.yml
Adds release-mode tinyxml2-capi builds for wasm32-unknown-unknown and wasm32-wasip1.
Release and roadmap metadata
Cargo.toml, CHANGELOG.md, ROADMAP.md
Updates the workspace version to 1.1.1 and records the 1.1.0/1.1.1 release and roadmap entries.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

  • iTeebot/tinyxml2-rs#28 — The pull request implements the issue’s requested WASM support, CI validation, documentation, version update, roadmap entry, and changelog updates.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding WebAssembly support for the C/C++ FFI plus CI validation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 feat/wasm-c-cpp

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

@AteebNoOne AteebNoOne added the enhancement New feature or request label Jul 14, 2026
@AteebNoOne AteebNoOne self-assigned this Jul 14, 2026

@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: 2

🧹 Nitpick comments (1)
.github/workflows/wasm-build.yml (1)

36-38: 🗄️ Data Integrity & Integration | 🔵 Trivial | 🏗️ Heavy lift

Add a C/C++ link smoke test.

Both new jobs only run cargo build; they never compile/link the example with emcc or WASI clang. Add minimal link validation for each documented toolchain, or narrow the release claims to Rust artifact compilation.

Also applies to: 48-50

🤖 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/wasm-build.yml around lines 36 - 38, Extend the
wasm32-unknown-unknown-capi and corresponding WASI C API workflow jobs beyond
cargo build by compiling and linking the documented C/C++ example with the
appropriate emcc or WASI clang toolchain. Keep the smoke tests minimal and
ensure each job validates its claimed toolchain, or revise the release claims to
state Rust artifact compilation only.
🤖 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 `@docs/architecture/wasm.md`:
- Around line 139-140: Update the “String Lifetimes” documentation to state that
the returned *const c_char pointers are borrowed from TxDocument/TxPrinter-owned
CString caches, must not be freed by callers, and become invalid after document
mutation or when the owning wrapper is dropped.

In `@ROADMAP.md`:
- Line 320: Align the C/C++ FFI WASM Support roadmap item with the 1.1.1 release
by moving it under a clearly labeled 1.1.1 phase or updating the surrounding
phase scope from 1.1.0. Ensure the roadmap does not associate this deliverable
with the 1.1.0 milestone.

---

Nitpick comments:
In @.github/workflows/wasm-build.yml:
- Around line 36-38: Extend the wasm32-unknown-unknown-capi and corresponding
WASI C API workflow jobs beyond cargo build by compiling and linking the
documented C/C++ example with the appropriate emcc or WASI clang toolchain. Keep
the smoke tests minimal and ensure each job validates its claimed toolchain, or
revise the release claims to state Rust artifact compilation only.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2a2570ae-5dfa-41ea-aeee-52d2b39de8fe

📥 Commits

Reviewing files that changed from the base of the PR and between dd45aa7 and 1c236f2.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • .github/workflows/wasm-build.yml
  • CHANGELOG.md
  • Cargo.toml
  • ROADMAP.md
  • docs/architecture/wasm.md

Comment thread docs/architecture/wasm.md Outdated
Comment thread ROADMAP.md Outdated
@AteebNoOne
AteebNoOne merged commit 21d818e into main Jul 14, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Support WebAssembly (WASM) Compilation and Linking for C/C++ FFI Crate (tinyxml2-capi)

1 participant