mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 21:35:00 +00:00
uv-resolver: make PubGrubPackage orderable
It turns out that we use PubGrubPackage as the key in hashmaps in a fair few places. And when we iterate over hashmaps, the order is unspecified. This can in turn result in changes in output as a result of changes in the PubGrubPackage definition, purely as a function of its changing hash. This is confusing as there should be no semantic difference. Thus, this is a precursor to introducing some more determinism to places I found in the error reporting whose output depending on hashmap iteration order.
This commit is contained in:
parent
9f109f243c
commit
976bc9ba0e
5 changed files with 21 additions and 10 deletions
|
@ -23,7 +23,7 @@ use crate::FetchStrategy;
|
|||
const CHECKOUT_READY_LOCK: &str = ".ok";
|
||||
|
||||
/// A reference to commit or commit-ish.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
||||
pub enum GitReference {
|
||||
/// A specific branch.
|
||||
Branch(String),
|
||||
|
|
|
@ -12,7 +12,7 @@ mod source;
|
|||
mod util;
|
||||
|
||||
/// A URL reference to a Git repository.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Hash, Ord)]
|
||||
pub struct GitUrl {
|
||||
/// The URL of the Git repository, with any query parameters, fragments, and leading `git+`
|
||||
/// removed.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue