refactor: replace pixi_git implementation with the unified rattler_git crate - #6578
Draft
wolfv wants to merge 9 commits into
Draft
refactor: replace pixi_git implementation with the unified rattler_git crate#6578wolfv wants to merge 9 commits into
wolfv wants to merge 9 commits into
Conversation
…t crate pixi_git and rattler_git share a common ancestor (both derived from uv-git) but drifted apart: pixi_git grew git-LFS support, a lazy HTTP client, cloneable errors and a graceful GitHub fast-path fallback, while rattler_git grew submodule handling with relative-URL resolution and corrupted-cache recovery. All of pixi_git's extras have been upstreamed into rattler_git, which is now the single low-level git cache implementation shared by pixi, rattler and rattler-build. pixi_git becomes a thin shim that re-exports rattler_git and keeps the pixi-specific pieces: - the `PIXI_GIT_LFS` environment variable (same tri-state semantics, now parsed by `rattler_git::source::lfs_enabled_from_env`), - `default_checkout_options()` (submodules on, LFS from the env var), - `to_git_client()` bridging `rattler_networking::LazyClient` into `rattler_git::LazyClient` without losing laziness. pixi additionally gains rattler_git's submodule and cache-robustness features that pixi_git lacked: relative submodule URLs are resolved against the real source URL (instead of the local bare database path), `protocol.file.allow=always` for file-based submodules, and corrupted git caches are detected and re-cloned instead of failing. The LFS integration tests moved to rattler_git together with the code. The `[patch.crates-io]` entries for rattler_git, rattler_build_source_cache and rattler_build_networking are TEMPORARY until the unified crates are released. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013EJTWLNjUFMPPPoT8746Me
rattler_prefix_guard is a path dependency of the patched rattler_git, so it appeared both from crates.io and from the rattler git branch, which 'cargo vendor --locked' rejects as a duplicate. Patching it from the same branch unifies the source. Also bumps the patched revs (clippy fix in rattler_git, py-rattler-build patch in rattler-build). TEMPORARY, to be removed together with the other patch entries. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013EJTWLNjUFMPPPoT8746Me
…fix) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013EJTWLNjUFMPPPoT8746Me
…d drive-letter endpoint fixes) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013EJTWLNjUFMPPPoT8746Me
… remote fix) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013EJTWLNjUFMPPPoT8746Me
…ed from rattler_networking upstream) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013EJTWLNjUFMPPPoT8746Me
conda/rattler#2590 was squash-merged and its branch deleted, so the branch-based [patch.crates-io] entries no longer resolve. Pin rattler_git and rattler_prefix_guard to the merge commit on main instead. Still TEMPORARY until the crates are released to crates.io. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013EJTWLNjUFMPPPoT8746Me
conda/rattler#2590 is merged; point the temporary rattler_git and rattler_prefix_guard [patch.crates-io] entries at the main branch instead of the merge commit. Still TEMPORARY until the crates are released to crates.io. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013EJTWLNjUFMPPPoT8746Me
rattler_git 0.2.0 (the unified git cache, conda/rattler#2590) is published, so drop the temporary rattler_git / rattler_prefix_guard [patch.crates-io] git dependencies and depend on the released crate. rattler_git 0.2.0 requires rattler_networking =0.30.2, which only exists in the rattler 0.47.1 release train, so move the rattler stack forward: rattler 0.46->0.47, rattler_conda_types 0.47->0.48, rattler_config 0.5->0.6, rattler_repodata_gateway 0.29->0.30, and rattler_upload 0.8->0.9 (the latter to reach rattler_digest 1.3.2, pulling sigstore 0.11). No pixi source changes were needed; the workspace compiles as-is. rattler-build #2648 (its adoption of the unified cache) is merged to main but not yet released, and its published crates still depend on the pre-0.47 rattler stack. Point the whole interdependent rattler_build_* set at rattler-build main so it stays consistent with rattler_git 0.2. Both temporary patch groups come off once rattler-build is released. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013EJTWLNjUFMPPPoT8746Me
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Companion to conda/rattler#2590, which unifies the low-level git cache implementation between pixi, rattler and rattler-build.
pixi_gitandrattler_gitshare a common ancestor (both derived from uv-git) but drifted apart:pixi_gitgrew git-LFS support, a lazy HTTP client, cloneable errors and a graceful GitHub fast-path fallback, whilerattler_gitgrew submodule handling with relative-URL resolution and corrupted-cache recovery. All ofpixi_git's extras are now upstreamed intorattler_git(see the rattler PR), and this PR makes pixi consume it.pixi_gitbecomes a thin shim that re-exportsrattler_gitand keeps only the pixi-specific pieces:PIXI_GIT_LFSenvironment variable (identical tri-state semantics, now parsed byrattler_git::source::lfs_enabled_from_env),default_checkout_options()— submodules on, LFS followingPIXI_GIT_LFS,to_git_client()— bridgesrattler_networking::LazyClientintorattler_git::LazyClientwithout losing laziness (the reqwest client is still only built if the GitHub fast path actually runs).Because all consumers imported through
pixi_git::…, no other pixi code changes except the singleGitResolver::fetchcall site, which now passes the checkout options explicitly.pixi also gains the
rattler_gitfeaturespixi_gitlacked:../sibling.git) are resolved against the real source URL instead of the local bare database path, so they no longer fail aftergit clone --local,protocol.file.allow=alwaysfor file-based submodules (Git ≥ 2.38.1),git rev-parse --git-dirvalidation) and re-cloned instead of erroring.The LFS integration tests moved to
rattler_gittogether with the code they test.[patch.crates-io]entries forrattler_git,rattler_build_source_cacheandrattler_build_networkingare temporary — they point at the companion branches (conda/rattler#2590, prefix-dev/rattler-build#2648) and must be replaced by released versions before merging.How Has This Been Tested?
cargo check --workspace --all-targetspasses with the patched graph (this also compiles rattler-build's source cache against the newrattler_git).cargo test -p pixi_git -p pixi_compute_sourcesand the fullpixi_command_dispatcherintegration suite (32 tests, incl. git checkout/pinning tests against local fixtures) pass.rattler_gititself (cargo test -p rattler_giton the rattler branch), coveringPIXI_GIT_LFSparsing, pointer-vs-blob checkouts, and warm-cache LFS validation.cargo clippy -p pixi_git -p pixi_compute_sources --all-targetsandcargo fmtare clean.AI Disclosure
Tools: Claude Code
Checklist:
🤖 Generated with Claude Code
https://claude.ai/code/session_013EJTWLNjUFMPPPoT8746Me
Generated by Claude Code