Skip to content

Enable Clad plugin in WASM - #1167

Open
aaronj0 wants to merge 2 commits into
compiler-research:mainfrom
aaronj0:clad-wasm
Open

aaronj0 wants to merge 2 commits into
compiler-research:mainfrom
aaronj0:clad-wasm

Conversation

@aaronj0

@aaronj0 aaronj0 commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

#830 left CPPINTEROP_ENABLE_CLAD rejected under emscripten. Cross-building clad needs its configure step driven through emcmake, and clad v2.5 refuses to cross-compile without a host clad-tblgen, so the plugin gains CLAD_TABLEGEN_EXE, mirroring CPPINTEROP_TABLEGEN_EXE.

Tested on the llvm-wasm-23 cell with emsdk 6.0.8, clad on and off. The option stays off by default and no CI row enables it: clad v2.5 compiles its repl error-recovery guard out on clang >= 22, so a parse error in a clad-enabled interpreter replays a discarded ast until the stack overflows.

compiler-research#830 left CPPINTEROP_ENABLE_CLAD rejected under emscripten. Cross-building
clad needs its configure step driven through emcmake, and clad v2.5 refuses
to cross-compile without a host clad-tblgen, so the plugin gains
CLAD_TABLEGEN_EXE, mirroring CPPINTEROP_TABLEGEN_EXE.

Tested on the llvm-wasm-23 cell with emsdk 6.0.8, clad on and off. The
option stays off by default and no CI row enables it: clad v2.5 compiles
its repl error-recovery guard out on clang >= 22, so a parse error in a
clad-enabled interpreter replays a discarded ast until the stack overflows.
The emscripten shared-library rows build a host clad-tblgen next to
cppinterop-tblgen, reading the clad version from the pin in
plugins/clad/CMakeLists.txt, and configure with CPPINTEROP_ENABLE_CLAD=ON.
The static rows only run on schedule and build at one core, so they stay
off.
@aaronj0 aaronj0 changed the title Clad wasm Enable Clad plugin in WASM Nov 1, 2026
@aaronj0
aaronj0 requested review from mcbarton and vgvassilev and removed request for vgvassilev November 1, 2026 11:22
@codecov

codecov Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.80%. Comparing base (ede86c2) to head (b6411e3).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1167   +/-   ##
=======================================
  Coverage   88.80%   88.80%           
=======================================
  Files          24       24           
  Lines        6978     6978           
=======================================
  Hits         6197     6197           
  Misses        781      781           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mcbarton

mcbarton commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

I had a cursory look at this PR. The things which stood out are

  • We extract the clad git_tag from the cmake. I'd rather set this as and pass through to the cmake config (overwriting v2.5 if it doesn't match)
  • There are no documentation changes in this PR to update the Emscripten build instructions
  • It feels like we could build the native clad tblgen alongside building the native cppinterop tblgen, rather than building the clad tblgen separately, and doing this git tag extraction
  • The PR description appears to suggest we need llvm>=22 for this to work. CppInterOp has a minimum build of llvm 21, so we need a guard against the option being built against llvm 21 (this may already be present, since I only took a quick look)
  • CPPINTEROP_ENABLE_CLAD has not been enabled in the ci for the Emscripten static build

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

This branch has not been deployed

No deployments
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.

2 participants