Description
It appears that somewhat recently cargo metadata
changed the format of the package_id
field in its JSON output (presumably rust-lang/cargo#12914). Significantly, this changed the way that packages are sorted in internal data structures, such that while previously crate 1.1.1
and crate 1.1.1@git:XXX
would have sorted adjacent to one-another, they now sort further apart.
Lines 452 to 454 in abb7411
The new format for this field is a PackageIdSpec
, which is supposedly going to be a more stable format going forwards. This format change also will have broken one case where we did inspect the internal format of the PackageId
(despite it being documented as opaque).
Lines 214 to 217 in abb7411
The file URI in this case now looks more like path+file:///path/to/example#0.1.0
rather than example 0.1.0 (path+file:///path/to/example)
, so will no longer match the contains
check.
In order to keep tests passing with both older and newer versions of rustc, we'll likely need to tweak how we sort packages to avoid using package_id
for sorting when possible. In addition, there are some commands where the output contains the package id, specifically the dump-graph test, which will likely need to be updated in some way - likely by removing the unstable PackageId check, and instead never serializing package IDs.