Skip to content

Commit

Permalink
Fixed compilation of cargo-binstall
Browse files Browse the repository at this point in the history
Signed-off-by: Jiahao XU <[email protected]>
  • Loading branch information
NobodyXu committed Oct 13, 2023
1 parent 82ba3b4 commit 43e9702
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
2 changes: 2 additions & 0 deletions crates/bin/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use binstalk::{
fetchers::{Fetcher, GhCrateMeta, QuickInstall, SignaturePolicy},
get_desired_targets,
helpers::{
cacher::HTTPCacher,
gh_api_client::GhApiClient,
jobserver_client::LazyJobserverClient,
remote::{Certificate, Client},
Expand Down Expand Up @@ -151,6 +152,7 @@ pub fn install_crates(

client,
gh_api_client,
cacher: HTTPCacher::default(),
jobserver_client,
registry: if let Some(index) = args.index {
index
Expand Down
2 changes: 1 addition & 1 deletion crates/binstalk-fetchers/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

use std::{borrow::Cow, path::Path, sync::Arc};
use std::{path::Path, sync::Arc};

use binstalk_downloader::{
download::DownloadError, gh_api_client::GhApiError, remote::Error as RemoteError,
Expand Down
2 changes: 1 addition & 1 deletion crates/binstalk/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pub(crate) mod target_triple;
pub mod tasks;

pub(crate) use binstalk_downloader::download;
pub use binstalk_downloader::gh_api_client;
pub use binstalk_downloader::{cacher, gh_api_client};

pub(crate) use cargo_toml_workspace::{self, cargo_toml};
#[cfg(feature = "git")]
Expand Down
14 changes: 11 additions & 3 deletions crates/binstalk/src/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ use semver::VersionReq;
use crate::{
fetchers::{Data, Fetcher, SignaturePolicy, TargetDataErased},
helpers::{
self, gh_api_client::GhApiClient, jobserver_client::LazyJobserverClient, remote::Client,
self, cacher::HTTPCacher, gh_api_client::GhApiClient,
jobserver_client::LazyJobserverClient, remote::Client,
},
manifests::cargo_toml_binstall::PkgOverride,
registry::Registry,
Expand All @@ -16,8 +17,14 @@ use crate::{

pub mod resolve;

pub type Resolver =
fn(Client, GhApiClient, Arc<Data>, Arc<TargetDataErased>, SignaturePolicy) -> Arc<dyn Fetcher>;
pub type Resolver = fn(
Client,
GhApiClient,
HTTPCacher,
Arc<Data>,
Arc<TargetDataErased>,
SignaturePolicy,
) -> Arc<dyn Fetcher>;

#[derive(Debug)]
#[non_exhaustive]
Expand Down Expand Up @@ -50,6 +57,7 @@ pub struct Options {

pub client: Client,
pub gh_api_client: GhApiClient,
pub cacher: HTTPCacher,
pub jobserver_client: LazyJobserverClient,
pub registry: Registry,

Expand Down
1 change: 1 addition & 0 deletions crates/binstalk/src/ops/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ async fn resolve_inner(
let fetcher = f(
opts.client.clone(),
opts.gh_api_client.clone(),
opts.cacher.clone(),
data.clone(),
target_data,
opts.signature_policy,
Expand Down

0 comments on commit 43e9702

Please sign in to comment.