Skip to content

Commit

Permalink
Support configurations with the specific Rust version
Browse files Browse the repository at this point in the history
  • Loading branch information
denzp committed Jan 21, 2019
1 parent abbad02 commit 20815b5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rustc-llvm-proxy"
version = "0.1.7"
version = "0.1.8"
authors = ["Denys Zariaiev <denys.zariaiev@gmail.com>"]
license = "MIT"

Expand Down
1 change: 0 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ fn main() {
}

println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-changed={}/llvm_gen.rs", out_dir);

llvm::Generator::default()
.parse_llvm_sys_crate()
Expand Down
12 changes: 11 additions & 1 deletion src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,15 @@ fn collect_possible_paths() -> Result<Vec<PathBuf>, Error> {
}

fn extract_arch(toolchain: &str) -> String {
toolchain.split('-').skip(1).collect::<Vec<_>>().join("-")
toolchain
.split('-')
// Skip `nightly` rust version prefix.
.skip(1)
// Also skip rust version specification if exists.
.skip_while(|item| match item.chars().next() {
None | Some('0'...'9') => true,
_ => false,
})
.collect::<Vec<_>>()
.join("-")
}

0 comments on commit 20815b5

Please sign in to comment.