Repository navigation
Windows Release CI: prebuilt LLVM + MLIR, no LLVM compile - #374
Merged
Merged
Conversation
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>
2 of 4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Windows Release CI stops depending on the hand-built LLVM zip on Dropbox, and compiles no LLVM or MLIR.
How
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.scripts/build_mlir_prebuilt_release.ps1(MLIR standalone against the official package), hosted on thellvm-22.1.8-mlirprerelease.scripts/install_llvm_prebuilt_release.ps1(what CI runs) unpacks both into3rdParty/llvm/x64/release, giving the same layout as the custom build. It also fixes the DIA SDK path the official package bakes intoLLVMExports.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/tester/CMakeLists.txttakesLLVM_TOOLS_BINARY_DIR/LLVM_LIBRARY_DIRinstead of 9 hardcoded3rdParty/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 onlylib/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
/GR /EHscfor its own code anyway.LLVMSupportbrings rpmalloc as the process malloc for tslang.exe, tsbindgen.exe and TypeScriptRuntime.dll. The JIT suite passes with it.Not changed
/MTdwith assertions.Test plan
build_mlir_prebuilt_release.ps1produces the archive; the published asset's SHA-256 matchescreate-release.ymlresource-dir staging checked against the official package locally (lib/clang/22/include, 15 MB as before)create-release.ymlitself only runs on av*tag, so it will first run at the next release🤖 Generated with Claude Code