mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-24 22:30:03 +00:00
Replace dep jobserver
with jobslot
(#355)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
56bafc8c9b
commit
32c3154abb
4 changed files with 19 additions and 8 deletions
|
@ -25,7 +25,7 @@ futures-util = { version = "0.3.23", default-features = false, features = ["std"
|
|||
generic-array = "0.14.6"
|
||||
home = "0.5.3"
|
||||
itertools = "0.10.3"
|
||||
jobserver = "0.1.24"
|
||||
jobslot = { version = "0.2.1", features = ["tokio"] }
|
||||
log = { version = "0.4.17", features = ["std"] }
|
||||
miette = "5.3.0"
|
||||
normalize-path = { version = "0.1.0", path = "../normalize-path" }
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::{num::NonZeroUsize, sync::Arc, thread::available_parallelism};
|
||||
|
||||
use jobserver::Client;
|
||||
use jobslot::Client;
|
||||
use tokio::sync::OnceCell;
|
||||
|
||||
use crate::errors::BinstallError;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use std::{path::PathBuf, process, sync::Arc};
|
||||
use std::{path::PathBuf, sync::Arc};
|
||||
|
||||
use cargo_toml::Package;
|
||||
use compact_str::CompactString;
|
||||
|
@ -151,10 +151,8 @@ async fn install_from_source(
|
|||
"Running `cargo install {} --version {} --target {target}`",
|
||||
package.name, package.version
|
||||
);
|
||||
let mut command = process::Command::new("cargo");
|
||||
jobserver_client.configure(&mut command);
|
||||
|
||||
let mut cmd = Command::from(command);
|
||||
let mut cmd = Command::new("cargo");
|
||||
|
||||
cmd.arg("install")
|
||||
.arg(package.name)
|
||||
|
@ -173,7 +171,8 @@ async fn install_from_source(
|
|||
|
||||
let command_string = format!("{:?}", cmd);
|
||||
|
||||
let mut child = cmd.spawn()?;
|
||||
let mut child = jobserver_client.configure_and_run(&mut cmd, |cmd| cmd.spawn())?;
|
||||
|
||||
debug!("Spawned command pid={:?}", child.id());
|
||||
|
||||
let status = child.wait().await?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue