Skip to content

RFC: re-enable the Web Assembly CI job #16134

Open

Description

@basvandijk

Proposal

I propose to re-enable the Web Assembly job in ci.yml as a secondary, test-only job for nightlies, releases and release-ci runs (check level 2 and up), so that changes that break the WebAssembly build are noticed again. It would not (yet) gate merges, nightlies or releases, and it would not (yet) ship a linux_wasm32 archive. The changes are in the stack of PRs:

Background

#6424 disabled the job on 2024-12-20. That day's nightly built lean.wasm, but its tests failed because V8 rejected the module: exports count of 100019 exceeds internal limit of 100000. lean.js is linked with -s EXPORT_ALL=1, so that the interpreter can find compiled code with dlsym, and the number of exports grows with the library. V8 raised the limit to 1,000,000 in December 2024 (v8/v8@285bfe195f), and Node.js has included that change since version 24. Today's lean.wasm has 251,027 exports: Node.js 26 loads it, while the runner's default Node.js 22 still rejects it with the same error, exports count of 251027 exceeds internal limit of 100000.

Since v4.15.0 (2025-01-04), the last release with a linux_wasm32 archive, nothing upstream has built Lean for WebAssembly, and breakage has only been found downstream, for example #14973 and #15181 (Emscripten libuv stubs that no longer matched their declarations), #13952 (a C++ declaration of an exported Lean function with the wrong parameter type, which made initialization trap), #15816 (LEAN_SCALAR_PTR_LITERAL chosen by LEAN_EMSCRIPTEN instead of by pointer size) and #16089 (eight FFI definitions with the wrong number of parameters, which make lean.js trap during initialization). On master, the WebAssembly build currently fails: the runtime does not compile, as IO.FS.renameIfNew uses renameat2, and Lake builds Leanc, whose source CMake does not generate for Emscripten. The lean launcher for lean.js is also no longer generated, and Lake archives the WebAssembly libraries without a symbol index.

The stack of PRs mentioned above fixes these issues and a few other problems.

Why?

Questions for the maintainers:

  1. Is a non-blocking WebAssembly job acceptable, given that WebAssembly is not a supported target?
  2. Should PRs be able to run it without the rest of release-ci, for example with a wasm-ci label?
  3. Would you consider publishing linux_wasm32 archives again once the job has been green for a while?

Claude Code, an AI coding assistant, helped with the investigation, the changes and this proposal. I reviewed and checked them.

Community Feedback

Impact

Add 👍 to issues you consider important. If others benefit from the changes in this proposal being added, please ask them to add 👍 to it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions