Skip to content

Commit b6c8de5

Browse files
authored
Do not call rustc for platform detection; use current_platform instead (#22)
* Do not call rustc for platform detection; use current_platform instead * Drop unused imports * Cargo.toml cosmetics
1 parent 651e392 commit b6c8de5

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ default = ["clap"]
1212

1313
[dependencies]
1414
clap = { version = "3.1.6", optional = true, features = ["derive"] }
15+
current_platform = "0.2.0"
1516
dunce = "1.0.1"
1617
glob = "0.3.0"
1718
serde = { version = "1.0.123", features = ["derive"] }
1819
toml = "0.5.8"
20+

src/subcommand.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ use crate::error::{Error, Result};
44
use crate::profile::Profile;
55
use crate::{utils, LocalizedConfig};
66
use std::ffi::OsStr;
7-
use std::io::BufRead;
87
use std::path::{Path, PathBuf};
9-
use std::process::Command;
108

119
#[derive(Debug)]
1210
pub struct Subcommand {
@@ -108,16 +106,7 @@ impl Subcommand {
108106
if artifacts.is_empty() {
109107
artifacts.push(Artifact::Root(package.clone()));
110108
}
111-
let host_triple = Command::new("rustc")
112-
.arg("-vV")
113-
.output()
114-
.map_err(|_| Error::RustcNotFound)?
115-
.stdout
116-
.lines()
117-
.map(|l| l.unwrap())
118-
.find(|l| l.starts_with("host: "))
119-
.map(|l| l[6..].to_string())
120-
.ok_or(Error::RustcNotFound)?;
109+
let host_triple = current_platform::CURRENT_PLATFORM.to_owned();
121110
let profile = args.profile();
122111
Ok(Self {
123112
args,

0 commit comments

Comments
 (0)