Skip to content

Windows Release CI: prebuilt LLVM + MLIR, no LLVM compile - #374

Merged
ASDAlexander77 merged 3 commits into
mainfrom
llvm-prebuilt-release-ci
Sep 27, 2026
Merged

ASDAlexander77 merged 3 commits into
mainfrom
llvm-prebuilt-release-ci

Conversation

@ASDAlexander77

Copy link
Copy Markdown
Owner

Windows Release CI stops depending on the hand-built LLVM zip on Dropbox, and compiles no LLVM or MLIR.

How

  • Official LLVM package: clang+llvm-22.1.8-x86_64-pc-windows-msvc.tar.xz (llvm/llvm-project release). It has the LLVM, Clang and LLD libraries with CMake packages, lld/wasm-ld, clang and the resource dir, built with the static CRT (/MT) the project needs, but no MLIR.
  • Prebuilt MLIR: a 50 MB archive built once by scripts/build_mlir_prebuilt_release.ps1 (MLIR standalone against the official package), hosted on the llvm-22.1.8-mlir prerelease.
  • scripts/install_llvm_prebuilt_release.ps1 (what CI runs) unpacks both into 3rdParty/llvm/x64/release, giving the same layout as the custom build. It also fixes the DIA SDK path the official package bakes into LLVMExports.cmake (The 18.1.2 binary windows release (the .tar.xz file) has a dependency on visual studio 2019 professional llvm/llvm-project#86250). If MLIR is already there it does nothing, so it never overwrites a custom build.
  • Test tree: test/tester/CMakeLists.txt takes LLVM_TOOLS_BINARY_DIR / LLVM_LIBRARY_DIR instead of 9 hardcoded 3rdParty/llvm/<cfg> paths, so tests link user programs with the same LLVM the compiler was built against. Existing layouts give the same values.
  • create-release.yml (Windows job) uses the same install. The release zip stages only lib/clang/<major>/include, because the official package also carries 25 MB of compiler-rt libs there that nothing uses.

Differences from the custom LLVM build

  • RTTI/EH are off in the LLVM libs. The project's MSVC flags force /GR /EHsc for its own code anyway.
  • The libs were built with clang-cl; they link fine with our MSVC-compiled code.
  • LLVMSupport brings rpmalloc as the process malloc for tslang.exe, tsbindgen.exe and TypeScriptRuntime.dll. The JIT suite passes with it.

Not changed

  • Debug still needs the custom build: nothing prebuilt has /MTd with assertions.
  • The Linux workflows still use their Dropbox archive. The official Linux package may not include MLIR, and I haven't checked.

Test plan

  • Windows Release CI on this branch: run 36329153530, 2959/2959 passed; LLVM + MLIR install took 58 s (it was over 30 min, unfinished, when MLIR was built on the runner)
  • Locally: install from the archives into a fresh prefix (40 s), tslang built against it, 2959/2959 with every test on the official lld and LLVM libs
  • Locally: build_mlir_prebuilt_release.ps1 produces the archive; the published asset's SHA-256 matches
  • create-release.yml resource-dir staging checked against the official package locally (lib/clang/22/include, 15 MB as before)
  • create-release.yml itself only runs on a v* tag, so it will first run at the next release

🤖 Generated with Claude Code

ASDAlexander77 and others added 3 commits September 27, 2026 15:26
The Windows test workflow downloaded a hand-built LLVM zip from Dropbox. The
official LLVM 22.1.8 Windows package (a GitHub release asset) has the LLVM,
Clang and LLD libraries, lld/wasm-ld, clang and clang's resource directory,
built with the static CRT the project needs - but no MLIR. The new
scripts/install_llvm_prebuilt_release.ps1 unpacks it, points its exported
DIA SDK path at the local Visual Studio (llvm/llvm-project#86250), builds MLIR
standalone against it from the matching source release and installs MLIR into
the same prefix. The prefix keeps the layout of the custom build, so
3rdParty/llvm/x64/release and everything that looks there are unchanged. The
script skips itself when the prefix already has MLIR, so it never overwrites
a custom build.

The test tree hardcoded 3rdParty/llvm/<cfg>/{bin,lib} for lld and the LLVM
libraries user programs link against; it now takes LLVM_TOOLS_BINARY_DIR and
LLVM_LIBRARY_DIR from the LLVM the build was configured with. Same values for
the existing layouts, and tests no longer silently use another LLVM than the
compiler's.

Verified locally: script end to end on a fresh prefix (about 11 minutes, MLIR
at -j20), rerun is a no-op; tslang built against that prefix with only
MLIR_DIR and Clang_DIR passes 2959/2959, with the test-runner scripts and all
8 LLVM_LIB script tests on the official lld and libraries.

Debug, the Linux workflow and create-release.yml are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Building MLIR on the 4-core runner took over 30 minutes (cancelled
unfinished), and a cache miss would pay it again. CI now compiles no LLVM or
MLIR at all: install_llvm_prebuilt_release.ps1 only downloads and unpacks the
official LLVM package and a prebuilt MLIR archive into one prefix.

The archive is made once per LLVM version by the new
build_mlir_prebuilt_release.ps1 (MLIR standalone against the official
package, installed into an empty prefix - its CMake package finds LLVM
relative to itself) and hosted as the asset of the llvm-22.1.8-mlir
prerelease. Shared steps live in llvm_prebuilt_common.ps1.

Verified locally: the build script produces the 50 MB archive; the install
script unpacks it into a fresh prefix in 40 seconds; tslang built against that
prefix passes 2959/2959. The published asset's SHA-256 matches the local file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Windows job of create-release.yml installs LLVM the way the Windows test
workflow now does: install_llvm_prebuilt_release.ps1 unpacks the official
LLVM package and the prebuilt MLIR archive into 3rdParty/llvm/x64/release, so
the default library build, LLVM_LIB_PATH and the wasm-ld copy are unchanged.

The release zip stages only clang's resource headers (lib/clang/<major>/
include): the official package also carries compiler-rt's libraries under
lib/clang/<major>/lib, 25 MB that neither tsbindgen nor tslang uses. The
staged tree is the same 15 MB as before (checked against the official
package locally).

The Linux job still uses its Dropbox archive. CACHE_VERSION is shared with it
and left alone; the Windows cache key changes with LLVM_FULL_VERSION and the
install scripts' hash.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ASDAlexander77
ASDAlexander77 merged commit 5b86026 into main Sep 27, 2026
1 of 2 checks passed
@ASDAlexander77
ASDAlexander77 deleted the llvm-prebuilt-release-ci branch September 27, 2026 16:07
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