Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

xtask: Replace rustc module with llvm-tools crate #93

Merged
merged 1 commit into from
May 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -219,8 +219,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.