You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.
Tested locally and it still doesn't work:
normal case without customized registry:
cargo info https://github.com/rust-lang/crates.io-index/clap Updating crates.io indexerror: could not find `https://github.com/rust-lang/crates.io-index/clap` in registry `https://github.com/rust-lang/crates.io-index`
/// Tries to convert a valid `Url` to a `PackageIdSpec`.fnfrom_url(muturl:Url) -> CargoResult<PackageIdSpec>{if url.query().is_some(){bail!("cannot have a query string in a pkgid: {}", url)}let frag = url.fragment().map(|s| s.to_owned());
url.set_fragment(None);let(name, version) = {letmut path = url
.path_segments().ok_or_else(|| anyhow::format_err!("pkgid urls must have a path: {}", url))?;let path_name = path.next_back().ok_or_else(|| {
anyhow::format_err!("pkgid urls must have at least one path \ component: {}",
url
)})?;match frag {Some(fragment) => match fragment.split_once([':','@']){Some((name, part)) => {let version = part.parse::<PartialVersion>()?;(String::from(name),Some(version))}None => {if fragment.chars().next().unwrap().is_alphabetic(){(String::from(fragment.as_str()),None)}else{let version = fragment.parse::<PartialVersion>()?;(String::from(path_name),Some(version))}}},None => (String::from(path_name),None),}};Ok(PackageIdSpec{
name,
version,url:Some(url),})}
We used the original URL as the package spec URL. In the matches function, we use it to match the source ID URL directly.
/// Checks whether the given `PackageId` matches the `PackageIdSpec`.pubfnmatches(&self,package_id:PackageId) -> bool{ifself.name() != package_id.name().as_str(){returnfalse;}ifletSome(ref v) = self.version{if !v.matches(package_id.version()){returnfalse;}}ifletSome(u) = &self.url{if u != package_id.source_id().url(){returnfalse;}}true}
The text was updated successfully, but these errors were encountered:
Tested locally and it still doesn't work:
normal case without customized registry:
I printed the two URLs:
Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("github.com")), port: None, path: "/rust-lang/crates.io-index/clap", query: None, fragment: None }
Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("github.com")), port: None, path: "/rust-lang/crates.io-index", query: None, fragment: None }
As you can see the paths are different, so it won't match. I think this is a bug from cargo library: https://github.com/rust-lang/cargo/blob/9e9349d3f7a4ef687992b2f248bbe4fc5bfea09f/src/cargo/core/package_id_spec.rs#L146
We used the original URL as the package spec URL. In the matches function, we use it to match the source ID URL directly.
The text was updated successfully, but these errors were encountered: