make a llvm-tools rustup component

This commit is contained in:
Jorge Aparicio
2018-05-30 08:01:35 +02:00
parent 8e673073f3
commit 66a7db9a35
6 changed files with 103 additions and 44 deletions

View File

@@ -957,6 +957,24 @@ impl Build {
self.package_vers(&self.release_num("rustfmt"))
}
fn llvm_tools_vers(&self) -> String {
let stdout = build_helper::output(
Command::new(self.llvm_out(self.config.build).join("build/bin/llvm-size"))
.arg("--version"),
);
for line in stdout.lines() {
if line.contains("LLVM version") {
if let Some(vers) = line.split_whitespace().nth(2) {
return vers.to_string();
}
}
}
panic!("The output of $LLVM_TOOL has changed; \
please fix `bootstrap::Build.llvm_tools_vers`");
}
/// Returns the `version` string associated with this compiler for Rust
/// itself.
///