mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-22 00:02:32 +00:00
Use correct lock path for workspace dependencies (#4421)
Previously, distributions created through `Source::Workspace` would have the absolute path as lock path. This didn't cause any problems, since in `Urls` we would later overwrite those urls with the correct one created from being workspace members by path. Changing the order surfaced this. This change emits the correct lock path. I've manually checked the difference with `dbg!`, this is not observable on main, but on the diverging urls branch it fixes lockfile creation.
This commit is contained in:
parent
fc7c318dd0
commit
b865341517
3 changed files with 48 additions and 71 deletions
|
@ -332,8 +332,9 @@ pub fn relative_to(path: impl AsRef<Path>, base: impl AsRef<Path>) -> Result<Pat
|
|||
.as_ref()
|
||||
.ancestors()
|
||||
.find_map(|ancestor| {
|
||||
path.as_ref()
|
||||
.strip_prefix(ancestor)
|
||||
// Simplifying removes the UNC path prefix on windows.
|
||||
dunce::simplified(path.as_ref())
|
||||
.strip_prefix(dunce::simplified(ancestor))
|
||||
.ok()
|
||||
.map(|stripped| (stripped, ancestor))
|
||||
})
|
||||
|
@ -342,8 +343,8 @@ pub fn relative_to(path: impl AsRef<Path>, base: impl AsRef<Path>) -> Result<Pat
|
|||
io::ErrorKind::Other,
|
||||
format!(
|
||||
"Trivial strip failed: {} vs. {}",
|
||||
path.simplified_display(),
|
||||
base.simplified_display()
|
||||
path.as_ref().simplified_display(),
|
||||
base.as_ref().simplified_display()
|
||||
),
|
||||
)
|
||||
})?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue