feat(rattler): make clobber behavior configurable (#1027)#2082
Merged
baszalmstra merged 3 commits intoconda:mainfrom Feb 22, 2026
Merged
feat(rattler): make clobber behavior configurable (#1027)#2082baszalmstra merged 3 commits intoconda:mainfrom
baszalmstra merged 3 commits intoconda:mainfrom
Conversation
Add a ClobberMode enum that controls what happens when multiple packages install the same file path: - ClobberMode::Rename (default): existing behavior, losers are renamed to __clobbers__/ directory - ClobberMode::Error: raises an error if any clobbering is detected during post-processing This is exposed through InstallDriverBuilder::clobber_mode() and integrates into the post_process() step. When Error mode is active and clobbered paths exist, a ClobberingDetected error is returned. Closes conda#1027
baszalmstra
approved these changes
Feb 20, 2026
Collaborator
|
Please fill in the template correctly. You said you used an AI, which? |
Contributor
Author
just mentioned in the description |
baszalmstra
approved these changes
Feb 22, 2026
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
This PR introduces a configurable behavior for handling file collisions (clobbering) during package installation. Previously, rattler would always rename "losing" files to a clobbers/ directory. While safe, this can hide potential packaging bugs or environment inconsistencies.
We now provide a ClobberMode enum to give callers control:
ClobberMode::Rename (default): Maintains existing behavior where colliding files are moved to the clobbers/ directory.
ClobberMode::Error: Intercepts clobbered paths during the post_process step and returns a ClobberingDetected error, failing the installation.
Fixes #1027
How Has This Been Tested?
I have added two new asynchronous tests in crates/rattler/src/install/clobber_registry.rs:
test_clobber_mode_error: Verifies that when ClobberMode::Error is set and a transaction contains overlapping files, post_process returns PostProcessingError::ClobberingDetected.
test_clobber_mode_rename_is_default: Verifies that without explicit configuration, the driver still defaults to the renaming behavior and successfully creates the clobbers/ directory structure.
AI Disclosure
Tools:Claude
Checklist: