Skip to content

fix(windows): bundle the LLVM runtime with Perry - #8018

Open
proggeramlug wants to merge 2 commits into
mainfrom
fix/windows-llvm-runtime-package
Open

fix(windows): bundle the LLVM runtime with Perry#8018
proggeramlug wants to merge 2 commits into
mainfrom
fix/windows-llvm-runtime-package

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • bundle the official LLVM 22 LLVM-C.dll beside perry.exe in the Windows release zip
  • keep the DLL beside the executable when staging @perryts/perry-win32-x64
  • fail packaging/staging if the PE import or runtime DLL is missing
  • update the gc-native-roots status after fix: restore CI portability and GC correctness #8017's dynamic-link fix

perry.exe on current main links successfully after #8017, but imports LLVM-C.dll. The release workflow did not package that DLL, so an extracted release exited with Windows loader error 0xC0000135 unless LLVM happened to be installed globally. This completes the #7985 fix without restoring the incompatible static /MT + rpmalloc link.

Validation

  • cargo build --profile perry-dev -p perry on Windows with the official LLVM 22.1.8 archive
  • PE imports include LLVM-C.dll and VCRUNTIME140.dll
  • isolated perry.exe + LLVM-C.dll bundle runs with C:\llvm\bin removed from PATH
  • tests/test_stage_npm_windows_llvm.sh passes its copy and missing-DLL refusal arms
  • workflow YAML parse, shell syntax, and git diff --check

No version bump.

Closes #7985

Summary by CodeRabbit

  • Bug Fixes

    • Windows release and npm packages now include the required LLVM-C.dll alongside perry.exe.
    • Packaging now validates required Windows runtime files and fails clearly when they are missing, preventing startup loader errors.
    • Windows arm workflow documentation now reflects resolved linker, archive, and Git Bash packaging issues.
  • Tests

    • Added automated checks to verify Windows packages include the runtime DLL and reject incomplete packages.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1aa76290-567c-4375-a689-5780ba72846c

📥 Commits

Reviewing files that changed from the base of the PR and between 81a88de and 17b3726.

📒 Files selected for processing (6)
  • .github/workflows/gc-native-roots.yml
  • .github/workflows/release-packages.yml
  • .github/workflows/test.yml
  • changelog.d/8018-windows-llvm-runtime.md
  • scripts/stage-npm.sh
  • tests/test_stage_npm_windows_llvm.sh

📝 Walkthrough

Walkthrough

Windows release and npm packaging now validate and bundle LLVM-C.dll beside perry.exe. Regression coverage checks successful staging and missing-runtime failures. Windows native-roots documentation records the linker, archive, and packaging fixes.

Changes

Windows LLVM packaging

Layer / File(s) Summary
LLVM runtime staging contract
scripts/stage-npm.sh, tests/test_stage_npm_windows_llvm.sh, .github/workflows/test.yml, changelog.d/8018-windows-llvm-runtime.md
Windows npm staging requires and copies LLVM-C.dll. The regression test covers successful staging and missing-DLL failure. CI runs the test, and the changelog records the packaging behavior.
Release validation and CI status
.github/workflows/release-packages.yml, .github/workflows/gc-native-roots.yml
Windows release packaging validates required files and verifies the LLVM-C.dll import with llvm-readobj before staging. The native-roots status documentation records the fixed Windows issues and pending green-run verification.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Mergeability Score: ⚪ Minimal · up to 17b37

The change bundles the required LLVM runtime with Windows builds and validates release and npm staging behavior; no actionable merge-blocking risk remains beyond normal checks.

Sequence Diagram(s)

sequenceDiagram
  participant ReleaseWorkflow as release-packages.yml
  participant LLVMReadobj as llvm-readobj.exe
  participant ReleaseStaging as Windows release staging
  ReleaseWorkflow->>ReleaseWorkflow: Check perry.exe, llvm-readobj.exe, and LLVM-C.dll
  ReleaseWorkflow->>LLVMReadobj: Inspect perry.exe imports
  LLVMReadobj-->>ReleaseWorkflow: Report LLVM-C.dll import
  ReleaseWorkflow->>ReleaseStaging: Stage perry.exe and LLVM-C.dll
Loading

Possibly related PRs

  • PerryTS/perry#7986: Updates the same Windows native-roots workflow for archive extraction and CI status.
  • PerryTS/perry#7387: Updates the Windows native-roots workflow configuration and status.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes bundling the LLVM runtime with Perry on Windows.
Description check ✅ Passed The description explains the change, rationale, linked issue, validation, and versioning status, so it is mostly complete despite omitted template headings.
Linked Issues check ✅ Passed The PR packages and stages LLVM-C.dll and fails closed when required runtime files are missing, completing the remaining Windows runtime work for [#7985].
Out of Scope Changes check ✅ Passed The workflow, staging, regression test, documentation, and changelog changes directly support the Windows LLVM runtime packaging objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/windows-llvm-runtime-package

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

windows: perry.exe cannot link against the official LLVM 22 release — /MT vs /MD, bundled rpmalloc, and missing inkwell target backends

1 participant