Skip to content

Preserve repository-relative Git archive paths during sync - #826

Closed
astral-automations-bot[bot] wants to merge 2 commits into
zb/reproduce-bug/21244from
automations/fix-bug/21244
Closed

astral-automations-bot[bot] wants to merge 2 commits into
zb/reproduce-bug/21244from
automations/fix-bug/21244

Conversation

@astral-automations-bot

@astral-automations-bot astral-automations-bot Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

Fresh uv sync can look for a Git-hosted archive in the downstream project instead of the Git checkout, even though retrying with the written lockfile succeeds.

Source history traces this to astral-sh#10072: it introduced repository-relative GitPathBuiltDist::install_path and GitPathSourceDist::install_path, but their lock constructors applied relative_to against the workspace root and fell back to std::path::absolute. locked_git_url retained the original relative path, so the serialized lock was correct while the in-memory GitSource.path used by the first sync was not. The direct-archive tests locked before installing. Later, astral-sh#19589 preserved Git identity when lowering generated metadata that references an archive in the same checkout, but its regression only inspected the lockfile. Neither exercised installation from the newly constructed in-memory lock.

Preserve the repository-relative path in both Git archive lock constructors and use it consistently for locked_git_url and GitSource.path. The installer then resolves the archive inside the fetched Git checkout, so fresh sync and lockfile replay use the same path.

Fixes astral-sh#21244.

Comment thread crates/uv-resolver/src/lock/mod.rs Resolved
@zaniebot
zaniebot force-pushed the automations/fix-bug/21244 branch from d14440a to da3eca3 Compare August 20, 2026 19:36
@zanieb
zanieb marked this pull request as ready for review August 21, 2026 13:22
@astral-automations-bot

Copy link
Copy Markdown
Author

Promoted to #21264.

@astral-automations-bot astral-automations-bot Bot added the bug Something isn't working label Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants