Fix skipping optional dep: Skip fetcher if they provide 0 bin (#446)

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-09-29 00:51:11 +10:00 committed by GitHub
parent af3316a8f3
commit abd50a72ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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!(