-
-
Notifications
You must be signed in to change notification settings - Fork 934
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cli): add feature to disable downloads
- Loading branch information
1 parent
c2952a7
commit bcde22f
Showing
13 changed files
with
649 additions
and
651 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
use crate::Result; | ||
use anyhow::Context; | ||
use std::path::PathBuf; | ||
use tokio::process::Command; | ||
|
||
#[derive(Debug, Default)] | ||
pub struct RustcDetails { | ||
pub sysroot: PathBuf, | ||
} | ||
|
||
impl RustcDetails { | ||
/// Find the current sysroot location using the CLI | ||
pub async fn from_cli() -> Result<RustcDetails> { | ||
let output = Command::new("rustc") | ||
.args(["--print", "sysroot"]) | ||
.output() | ||
.await?; | ||
|
||
let stdout = | ||
String::from_utf8(output.stdout).context("Failed to extract rustc sysroot output")?; | ||
|
||
let sysroot = PathBuf::from(stdout.trim()); | ||
Ok(Self { sysroot }) | ||
} | ||
|
||
pub fn has_wasm32_unknown_unknown(&self) -> bool { | ||
self.sysroot | ||
.join("lib/rustlib/wasm32-unknown-unknown") | ||
.exists() | ||
} | ||
} |
Oops, something went wrong.