Repository navigation
Conversation
nikomatsakis
left a comment
There was a problem hiding this comment.
Codex found what it thinks is a bug (and pushed test commit b557d8ca):
I added
cached_lookup_does_not_substitute_another_registry, which currently fails.The test caches crates.io
foo 1.0.0and private-registryfoo 1.9.0, then requestsfoo = "^1.0". The cache-only lookup returns the private package because it scans every registry cache and chooses the highest matching version without checking the source.This means hook dispatch can load a different plugin from the one Cargo resolved during sync. Name and version alone don’t identify a package across registries.
Please preserve the resolved registry/source identity in the cache-only path and make this regression test pass.
|
Thanks! fixed at 88ae8bd |
Pull request was closed
88ae8bd to
db04c7b
Compare
What does this PR do?
Part of #413.
With the default recommendations registry, a workspace depending on
anyhoworthiserrorchains toerror-battery-pack, and every hook event and--helprancargo fetchandcargo metadatafor it without--offline(0.26s instead of 0.05s per event offline, seconds online). A[plugins] useentry for a non-dependency did the same. Two smaller bugs sit in the same code:crate-info <member>returned an unrelated crates.io crate, andsync,statusandusesaid "not in a Rust workspace" whencargo metadatafailed on a brokenCargo.toml.One commit each: under
UpdateLevel::Nonea crate that is not a workspace dependency is read only from$CARGO_HOME/registry/src(syncandcrate-infopassCheckand still download); workspace members are recorded asmember_cratesandcrate-infoanswers from them; a failedcargo metadatakeeps cargo's error, whichrequire()reports whileload()stays silent for hooks.Verified with offline repros for each bug and a
syncfrom an empty cargo home.Take into account:
--helpuntil the next sync (at the latest the nextSessionStart).crate_command.rsbranch.Disclosure questions
AI disclosure.