Feature: Impl opt-out options (#510)

Fixed #136

* Impl opt-out optioins in binstalk
* Replace field `Options::{gh_crate, quickinstall}_fetcher` with `resolver`
  which can determine order of resolver used.
* Add new field `Args::{disable_}strategies`
* Add new variant `BinstallError::InvalidStrategies`
* Add variant `BinstallError::NoFallbackToCargoInstall`
* Add code for supporting strategies in mod entry
* Test `--disable-strategies` in `tests.sh`
* Test for `--strategies` in `tests.sh`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-11-11 16:24:46 +11:00 committed by GitHub
parent 89fa5b1769
commit 9e80cf0700
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 141 additions and 11 deletions

View file

@ -1,14 +1,21 @@
//! Concrete Binstall operations.
use std::path::PathBuf;
use std::{path::PathBuf, sync::Arc};
use semver::VersionReq;
use crate::{manifests::cargo_toml_binstall::PkgOverride, DesiredTargets};
use crate::{
fetchers::{Data, Fetcher},
helpers::remote::Client,
manifests::cargo_toml_binstall::PkgOverride,
DesiredTargets,
};
pub mod install;
pub mod resolve;
pub type Resolver = fn(&Client, &Arc<Data>) -> Arc<dyn Fetcher>;
pub struct Options {
pub no_symlinks: bool,
pub dry_run: bool,
@ -18,4 +25,5 @@ pub struct Options {
pub cli_overrides: PkgOverride,
pub desired_targets: DesiredTargets,
pub quiet: bool,
pub resolver: Vec<Resolver>,
}