mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-13 14:16:36 +00:00

* Add a --bin argument to mirror cargo install --bin. * Update crates/bin/src/args.rs Co-authored-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Signed-off-by: Matan Lurey <matanlurey@users.noreply.github.com> * Update crates/binstalk/src/ops.rs Co-authored-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Signed-off-by: Matan Lurey <matanlurey@users.noreply.github.com> * Address feedback, make e2e-test test both source/non-source. * Update crates/bin/src/entry.rs Co-authored-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Signed-off-by: Matan Lurey <matanlurey@users.noreply.github.com> * Update crates/binstalk/src/ops/resolve/resolution.rs Co-authored-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Signed-off-by: Matan Lurey <matanlurey@users.noreply.github.com> * Update crates/binstalk/src/ops/resolve/resolution.rs Co-authored-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Signed-off-by: Matan Lurey <matanlurey@users.noreply.github.com> * Update crates/binstalk/src/ops/resolve/resolution.rs Co-authored-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Signed-off-by: Matan Lurey <matanlurey@users.noreply.github.com> * Get everything compiling again. * optimize ResolutionFetch::resolve_bins Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * fix e2e-test on unix due to ordering Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * fix specific-binaries.sh: relax no-compile Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: Matan Lurey <matanlurey@users.noreply.github.com> Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Co-authored-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
65 lines
1.6 KiB
Rust
65 lines
1.6 KiB
Rust
//! Concrete Binstall operations.
|
|
|
|
use std::{path::PathBuf, sync::Arc, time::Duration};
|
|
|
|
use compact_str::CompactString;
|
|
use semver::VersionReq;
|
|
|
|
use crate::{
|
|
fetchers::{Data, Fetcher, SignaturePolicy, TargetDataErased},
|
|
helpers::{
|
|
gh_api_client::GhApiClient, jobserver_client::LazyJobserverClient,
|
|
lazy_gh_api_client::LazyGhApiClient, remote::Client,
|
|
},
|
|
manifests::cargo_toml_binstall::PkgOverride,
|
|
registry::Registry,
|
|
DesiredTargets,
|
|
};
|
|
|
|
pub mod resolve;
|
|
|
|
pub type Resolver =
|
|
fn(Client, GhApiClient, Arc<Data>, Arc<TargetDataErased>, SignaturePolicy) -> Arc<dyn Fetcher>;
|
|
|
|
#[derive(Debug)]
|
|
#[non_exhaustive]
|
|
pub enum CargoTomlFetchOverride {
|
|
#[cfg(feature = "git")]
|
|
Git(crate::helpers::git::GitUrl),
|
|
Path(PathBuf),
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
pub struct Options {
|
|
pub no_symlinks: bool,
|
|
pub dry_run: bool,
|
|
pub force: bool,
|
|
pub quiet: bool,
|
|
pub locked: bool,
|
|
pub no_track: bool,
|
|
|
|
pub version_req: Option<VersionReq>,
|
|
pub cargo_toml_fetch_override: Option<CargoTomlFetchOverride>,
|
|
pub cli_overrides: PkgOverride,
|
|
|
|
pub desired_targets: DesiredTargets,
|
|
pub resolvers: Vec<Resolver>,
|
|
pub cargo_install_fallback: bool,
|
|
|
|
/// If provided, the names are sorted.
|
|
pub bins: Option<Vec<CompactString>>,
|
|
|
|
pub temp_dir: PathBuf,
|
|
pub install_path: PathBuf,
|
|
pub cargo_root: Option<PathBuf>,
|
|
|
|
pub client: Client,
|
|
pub gh_api_client: LazyGhApiClient,
|
|
pub jobserver_client: LazyJobserverClient,
|
|
pub registry: Registry,
|
|
|
|
pub signature_policy: SignaturePolicy,
|
|
pub disable_telemetry: bool,
|
|
|
|
pub maximum_resolution_timeout: Duration,
|
|
}
|