Skip to content

fix(nvvm): resolve Windows CI build failures#389

Open
Snehal-Reddy wants to merge 1 commit intoRust-GPU:mainfrom
Snehal-Reddy:fix-llvm-download
Open

fix(nvvm): resolve Windows CI build failures#389
Snehal-Reddy wants to merge 1 commit intoRust-GPU:mainfrom
Snehal-Reddy:fix-llvm-download

Conversation

@Snehal-Reddy
Copy link
Copy Markdown
Contributor

@Snehal-Reddy Snehal-Reddy commented May 1, 2026

Summary

  1. Broken LLVM Download URL: The hardcoded download URL incorrectly used the uppercase tag LLVM-7.1.0 (which has no release assets), instead of the correct lowercase tag llvm-7.1.0. Because curl didn't verify the HTTP response code, the script was attempting to unpack a GitHub 404 HTML page as a tarball, resulting in an obscure UnexpectedEof / TarError panic.
  2. Invalid MSVC Compiler Flags: When the cc crate attempts to compile the LLVM C++ shim (RustWrapper.cpp) using MSVC (cl.exe), it blindly passes all flags returned by llvm-config --cxxflags. Since the prebuilt LLVM was cross-compiled, llvm-config returns GCC-style warning flags (e.g. -Wextra), which causes MSVC to fail with a D8021 : invalid numeric argument '/Wextra' error.

Changes

  • Corrected PREBUILT_LLVM_URL_LLVM7 to use the lowercase llvm-7.1.0 tag.
  • Added an explicit HTTP response code check to catch download failures immediately. It will now fail with a clear, actionable error message showing the bad URL and response code.
  • Added logic to filter out all GCC-style warning flags (-W*) when compiling the C++ shim if the target contains "msvc".

Testing

  • cargo build passes
  • cargo clippy --workspace passes
  • Tested on: Windows / Linux

Notes

This issue manifested as build failures specifically when running cargo build in a clean Windows environment where USE_PREBUILT_LLVM triggers.

The tag name on GitHub was lowercase 'llvm-7.1.0', but the URL was hardcoded to use uppercase 'LLVM-7.1.0', which has no release assets.

Also added an explicit HTTP response code check to catch download failures early with a descriptive error message instead of failing later with an 'UnexpectedEof' during archive unpacking.
@Snehal-Reddy Snehal-Reddy changed the title fix(nvvm): fix broken LLVM 7 download URL in build.rs fix(nvvm): resolve Windows CI build failures May 1, 2026
@brandonros
Copy link
Copy Markdown
Contributor

i pulled this into #386 if we want

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