Skip to content

Commit

Permalink
Fix skipping optional dep: Skip fetcher if they provide 0 bin (rust-l…
Browse files Browse the repository at this point in the history
…ang#446)

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
  • Loading branch information
NobodyXu committed Sep 28, 2022
1 parent af3316a commit abd50a7
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions crates/binstalk/src/ops/resolve.rs
Expand Up @@ -243,13 +243,21 @@ async fn resolve_inner(
.await
{
Ok(bin_files) => {
return Ok(Resolution::Fetch {
fetcher,
package,
name: crate_name.name,
version_req: version_req.to_compact_string(),
bin_files,
})
if !bin_files.is_empty() {
return Ok(Resolution::Fetch {
fetcher,
package,
name: crate_name.name,
version_req: version_req.to_compact_string(),
bin_files,
});
} else {
warn!(
"Error when checking binaries provided by fetcher {}: \
The fetcher does not provide any optional binary",
fetcher.source_name(),
);
}
}
Err(err) => {
warn!(
Expand Down

0 comments on commit abd50a7

Please sign in to comment.