mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 02:48:17 +00:00
Log when we fork (#4386)
We currently don't log if or when we split the resolution graphs into forks. I ran into this when trying to debug missing forking.
This commit is contained in:
parent
fa6ed34105
commit
e486eb86b7
1 changed files with 24 additions and 4 deletions
|
@ -544,7 +544,18 @@ impl<InstalledPackages: InstalledPackagesProvider> ResolverState<InstalledPackag
|
||||||
);
|
);
|
||||||
forked_states.push(state);
|
forked_states.push(state);
|
||||||
}
|
}
|
||||||
ForkedDependencies::Forked(forks) => {
|
ForkedDependencies::Forked {
|
||||||
|
forks,
|
||||||
|
diverging_packages,
|
||||||
|
} => {
|
||||||
|
debug!(
|
||||||
|
"Splitting resolution on {} over {}",
|
||||||
|
state.next,
|
||||||
|
diverging_packages
|
||||||
|
.iter()
|
||||||
|
.map(ToString::to_string)
|
||||||
|
.join(", ")
|
||||||
|
);
|
||||||
assert!(forks.len() >= 2);
|
assert!(forks.len() >= 2);
|
||||||
// This is a somewhat tortured technique to ensure
|
// This is a somewhat tortured technique to ensure
|
||||||
// that our resolver state is only cloned as much
|
// that our resolver state is only cloned as much
|
||||||
|
@ -1996,7 +2007,8 @@ impl Dependencies {
|
||||||
dependencies: vec![],
|
dependencies: vec![],
|
||||||
markers: MarkerTree::And(vec![]),
|
markers: MarkerTree::And(vec![]),
|
||||||
}];
|
}];
|
||||||
for (_, possible_forks) in by_name {
|
let mut diverging_packages = Vec::new();
|
||||||
|
for (name, possible_forks) in by_name {
|
||||||
let fork_groups = match possible_forks {
|
let fork_groups = match possible_forks {
|
||||||
PossibleForks::PossiblyForking(fork_groups) => fork_groups,
|
PossibleForks::PossiblyForking(fork_groups) => fork_groups,
|
||||||
PossibleForks::NoForkPossible(indices) => {
|
PossibleForks::NoForkPossible(indices) => {
|
||||||
|
@ -2028,8 +2040,12 @@ impl Dependencies {
|
||||||
new_forks.extend(new_forks_for_group);
|
new_forks.extend(new_forks_for_group);
|
||||||
}
|
}
|
||||||
forks = new_forks;
|
forks = new_forks;
|
||||||
|
diverging_packages.push(name.clone());
|
||||||
|
}
|
||||||
|
ForkedDependencies::Forked {
|
||||||
|
forks,
|
||||||
|
diverging_packages,
|
||||||
}
|
}
|
||||||
ForkedDependencies::Forked(forks)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2052,7 +2068,11 @@ enum ForkedDependencies {
|
||||||
/// Note that there is always at least two forks. If there would
|
/// Note that there is always at least two forks. If there would
|
||||||
/// be fewer than 2 forks, then there is no fork at all and the
|
/// be fewer than 2 forks, then there is no fork at all and the
|
||||||
/// `Unforked` variant is used instead.
|
/// `Unforked` variant is used instead.
|
||||||
Forked(Vec<Fork>),
|
Forked {
|
||||||
|
forks: Vec<Fork>,
|
||||||
|
/// The package(s) with different requirements for disjoint markers.
|
||||||
|
diverging_packages: Vec<PackageName>,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A single fork in a list of dependencies.
|
/// A single fork in a list of dependencies.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue