Skip to content

Commit

Permalink
Merge #93
Browse files Browse the repository at this point in the history
93: xtask: Replace rustc module with llvm-tools crate r=mkroening a=mkroening



Co-authored-by: Martin Kröning <m.kroening@hotmail.de>
  • Loading branch information
bors[bot] and mkroening authored May 20, 2022
2 parents 0944b10 + 6778606 commit 60378e7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 45 deletions.
23 changes: 7 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion xtask/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ edition = "2021"

[dependencies]
anyhow = "1.0"
rustc_version = "0.4"
llvm-tools = "0.1"
xflags = "0.2"
xshell = "0.2"
9 changes: 6 additions & 3 deletions xtask/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! See <https://github.com/matklad/cargo-xtask/>.
mod flags;
mod rustc;

use std::{
env::{self, VarError},
Expand All @@ -10,6 +9,7 @@ use std::{
};

use anyhow::{anyhow, bail, Result};
use llvm_tools::LlvmTools;
use xshell::{cmd, Shell};

fn main() -> Result<()> {
Expand Down Expand Up @@ -210,8 +210,11 @@ fn binutil(name: &str) -> Result<PathBuf> {
let exe_suffix = env::consts::EXE_SUFFIX;
let exe = format!("llvm-{name}{exe_suffix}");

let mut path = rustc::rustlib()?;
path.push(exe);
let path = LlvmTools::new()
.map_err(|err| anyhow!("{err:?}"))?
.tool(&exe)
.ok_or_else(|| anyhow!("could not find {exe}"))?;

Ok(path)
}

Expand Down
25 changes: 0 additions & 25 deletions xtask/src/rustc.rs

This file was deleted.

0 comments on commit 60378e7

Please # to comment.