Skip to content

llvm-wasm: install the wasm tree in the environment it was built in. - #157

Merged
mcbarton merged 2 commits into
mainfrom
llvm-wasm-install-env
Oct 30, 2026
Merged

mcbarton merged 2 commits into
mainfrom
llvm-wasm-install-env

Conversation

@vgvassilev

Copy link
Copy Markdown
Contributor

CppInterOp's Windows emscripten row fails to link against the LLVM 23 cell built with emsdk 6.0.8:

LLVM ERROR: Function ..CrashRecoveryContext9RunSafely.. is using
setjmp/longjmp but does not have +exception-handling target feature

The Windows llvm-wasm artifacts are built without wasm exception handling: CrashRecoveryContext.cpp.o in their libLLVMSupport.a carries no +exception-handling, the Linux one does. Every windows-2025 cell is affected; emsdk 6.0.8 is the first link to need it.

The wasm targets are built under emmake with
EMCC_CFLAGS=-fwasm-exceptions, in the environment emsdk_env() makes. On Windows that environment moves the ccache launcher from CMAKE__COMPILER_LAUNCHER to EM_COMPILER_WRAPPER, so the tree is configured without one. The
install that follows reconfigures in the job's own environment, where the launcher is still set; cmake picks it up, every compile command changes, and ninja rebuilds 2611 of the 3241 steps through ccache without EMCC_CFLAGS. Those are the objects that ship. On Linux the launcher is in both environments, and the install builds nothing.

Run the install in the environment of the build.

CppInterOp's Windows emscripten row fails to link against the LLVM 23
cell built with emsdk 6.0.8:

  LLVM ERROR: Function ..CrashRecoveryContext9RunSafely.. is using
  setjmp/longjmp but does not have +exception-handling target feature

The Windows llvm-wasm artifacts are built without wasm exception
handling: CrashRecoveryContext.cpp.o in their libLLVMSupport.a carries
no +exception-handling, the Linux one does. Every windows-2025 cell is
affected; emsdk 6.0.8 is the first link to need it.

The wasm targets are built under emmake with
EMCC_CFLAGS=-fwasm-exceptions, in the environment emsdk_env() makes. On
Windows that environment moves the ccache launcher from
CMAKE_<LANG>_COMPILER_LAUNCHER to EM_COMPILER_WRAPPER, so the tree is
configured without one. The
install that follows reconfigures in the job's own environment, where
the launcher is still set; cmake picks it up, every compile command
changes, and ninja rebuilds 2611 of the 3241 steps through ccache
without EMCC_CFLAGS. Those are the objects that ship. On Linux the
launcher is in both environments, and the install builds nothing.

Run the install in the environment of the build.
@vgvassilev
vgvassilev requested a review from mcbarton October 29, 2026 17:48
emsdk_env() starts from a copy of os.environ, and it was called after
os.environ.clear(). The install step then ran with PATH reduced to the
two emsdk directories and an empty entry, so cmake was not found: a
FileNotFoundError on Windows, and on Linux and macOS a PermissionError
from emscripten's cmake/ directory being the only match. Every
llvm-wasm cell failed before installing anything.

Build the environment first, then replace os.environ with it.
@mcbarton
mcbarton merged commit f9bc1e7 into main Oct 30, 2026
42 checks passed
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