Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix QuickInstall report bug for target universal2-apple-darwin #921

Merged
merged 1 commit into from
Mar 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions crates/binstalk/src/fetchers/quickinstall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ use super::{Data, TargetData};
const BASE_URL: &str = "https://github.com/cargo-bins/cargo-quickinstall/releases/download";
const STATS_URL: &str = "https://warehouse-clerk-tmp.vercel.app/api/crate";

fn is_universal_macos(target: &str) -> bool {
["universal-apple-darwin", "universal2-apple-darwin"].contains(&target)
}

pub struct QuickInstall {
client: Client,
gh_api_client: GhApiClient,
Expand Down Expand Up @@ -63,7 +67,7 @@ impl super::Fetcher for QuickInstall {

fn find(self: Arc<Self>) -> AutoAbortJoinHandle<Result<bool, BinstallError>> {
AutoAbortJoinHandle::spawn(async move {
if self.target_data.target == "universal-apple-darwin" {
if is_universal_macos(&self.target_data.target) {
return Ok(false);
}

Expand All @@ -79,12 +83,12 @@ impl super::Fetcher for QuickInstall {
fn report_to_upstream(self: Arc<Self>) {
if cfg!(debug_assertions) {
debug!("Not sending quickinstall report in debug mode");
} else if self.target_data.target == "universal-apple-darwin" {
} else if is_universal_macos(&self.target_data.target) {
debug!(
r#"Not sending quickinstall report for universal-apple-darwin
quickinstall does not support our homebrew target
universal-apple-darwin, it only supports targets supported by
rust officially."#,
and universal2-apple-darwin.
Quickinstall does not support these targets, it only supports targets supported
by rust officially."#,
);
} else {
tokio::spawn(async move {
Expand Down