-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
re-vendored suggestion is incorrect with sparse crates.io #12802
Comments
cc @arlosi |
I tracked down the cause here: when packages are parsed, they're given the source id "registry+https://github.com/rust-lang/crates.io-index", but if sparse indices are enabled then The following patch silences the warning, but I'm not sure it's ideal -- it breaks a bunch of tests because it changes the source in the generated metadata. Another approach would be to special-case diff --git a/src/cargo/util/toml/mod.rs b/src/cargo/util/toml/mod.rs
index 813868ac3..fd954885a 100644
--- a/src/cargo/util/toml/mod.rs
+++ b/src/cargo/util/toml/mod.rs
@@ -2026,7 +2026,7 @@ fn to_dependency_source_id<P: ResolveToPath + Clone>(
let url = registry_index.into_url()?;
SourceId::for_registry(&url)
}
- (None, None, None, None) => SourceId::crates_io(manifest_ctx.gctx),
+ (None, None, None, None) => SourceId::crates_io_maybe_sparse_http(manifest_ctx.gctx),
}
} |
Problem
The error message for a resolver activation error includes this comment when used with crates.io:
This is not correct. This message should only be displayed when vendoring is enabled. Cargo is getting confused somehow, thinking index.crates.io is a replaced source. This message should only be displayed when vendoring is actually enabled.
Steps
Try to build with:
displays:
Possible Solution(s)
The error message is generated here.
I'm uncertain at this moment why the source seems to be replaced. I vaguely recall having cargo treat index.crates.io as equivalent for the git index, but I forget how that all works.
Notes
No response
Version
The text was updated successfully, but these errors were encountered: