Skip to content

Commit 774d08b

Browse files
committed
fix(nvvm): fix broken LLVM 7 download URL in build.rs
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.
1 parent 103a8d5 commit 774d08b

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

crates/rustc_codegen_nvvm/build.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use tar::Archive;
1111
use xz::read::XzDecoder;
1212

1313
static PREBUILT_LLVM_URL_LLVM7: &str =
14-
"https://github.com/rust-gpu/rustc_codegen_nvvm-llvm/releases/download/LLVM-7.1.0/";
14+
"https://github.com/rust-gpu/rustc_codegen_nvvm-llvm/releases/download/llvm-7.1.0/";
1515

1616
fn main() {
1717
rustc_llvm_build(llvm19_enabled());
@@ -181,6 +181,13 @@ fn find_llvm_config_llvm7(target: &str) -> PathBuf {
181181
.expect("Failed to download prebuilt LLVM");
182182
}
183183

184+
let response_code = easy.response_code().unwrap();
185+
if response_code != 200 {
186+
fail(&format!(
187+
"Failed to download prebuilt LLVM from {url}. HTTP response code: {response_code}"
188+
));
189+
}
190+
184191
let decompressor = XzDecoder::new(xz_encoded.as_slice());
185192
let mut ar = Archive::new(decompressor);
186193

0 commit comments

Comments
 (0)