mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-20 04:28:43 +00:00
Add error
logging if achieve doesn't contain bin required (#1298)
* Add `error` logging if achieve doesn't contain bin required So that users know that this is an upstream issue and will report to upstream. Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * Update crates/binstalk/src/ops/resolve.rs --------- Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
146d3f8f43
commit
0f7828569a
1 changed files with 8 additions and 3 deletions
|
@ -14,7 +14,7 @@ use maybe_owned::MaybeOwned;
|
||||||
use semver::{Version, VersionReq};
|
use semver::{Version, VersionReq};
|
||||||
use tempfile::TempDir;
|
use tempfile::TempDir;
|
||||||
use tokio::task::spawn_blocking;
|
use tokio::task::spawn_blocking;
|
||||||
use tracing::{debug, info, instrument, warn};
|
use tracing::{debug, error, info, instrument, warn};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
bins,
|
bins,
|
||||||
|
@ -267,13 +267,18 @@ async fn download_extract_and_verify(
|
||||||
// This binary is optional
|
// This binary is optional
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
let required_features = &bin.required_features;
|
let required_features = &bin.required_features;
|
||||||
|
let bin_name = bin.name.as_str();
|
||||||
|
|
||||||
if required_features.is_empty() {
|
if required_features.is_empty() {
|
||||||
|
error!(
|
||||||
|
"When resolving {name} bin {bin_name} is not found.\
|
||||||
|
This binary is not optional so it must be included in the archive, please contact with\
|
||||||
|
upstream to fix this issue."
|
||||||
|
);
|
||||||
// This bin is not optional, error
|
// This bin is not optional, error
|
||||||
Some(Err(err))
|
Some(Err(err))
|
||||||
} else {
|
} else {
|
||||||
// Optional, print a warning and continue.
|
// Optional, print a warning and continue.
|
||||||
let bin_name = bin.name.as_str();
|
|
||||||
let features = required_features.iter().format(",");
|
let features = required_features.iter().format(",");
|
||||||
warn!(
|
warn!(
|
||||||
"When resolving {name} bin {bin_name} is not found. \
|
"When resolving {name} bin {bin_name} is not found. \
|
||||||
|
|
Loading…
Add table
Reference in a new issue